版本化实体的最佳实践?
下午好,
我目前正处于一个用 .Net 编写并使用实体框架进行数据持久/存储的新项目的早期阶段。 所需的功能之一是能够“版本化”某些模型类型。 例如,一个模型是一个“需求”,它将具有 n 个“需求版本”,基本上具有一种返回该特定“需求”实例的历史/生命周期的方法。 在所有修订中唯一必须保持不变的是它的“ID”,其他所有内容在需求的整个生命周期中都是绝对可以更改的。
现在的问题是,我是否应该“简单地”在 Requirement >> 之间创建 1:n 关系? 要求版本? 其他功能需要是完全恢复旧状态为当前/最新状态的可能性,必须有能力进行次要和主要版本(更改)等,最后但并非最不重要的能力是创建跨版本的“基线”具有最新版本的需求集合,以便稍后返回到该特定基线并显示所有包含的需求版本?
这必须扩展到几百万个需求记录,每个需求记录都有几千个修订..这就是我特别问的原因..简单的 1:n 关系的扩展方面等。
有没有人做过类似的事情,也许是一些关于版本控制/基线等的建议/最佳实践等?
干杯& 谢谢, -约尔格
Good afternoon,
I am currently in the very early phase of a new project written in .Net and using Entity Framework for data persistence/storage. One of the features required is the ability to 'version' certain model types. E.g. one model is one 'Requirement' which will have n 'Requirement Versions', basically having a way of going back in the history/lifecycle of that particular 'Requirement' instance. The only thing that has to be static across all revisions is it's 'ID', everything else is absolutely changeable throughout the requirement's lifetime.
Now the Q is, should I 'simply' create a 1:n relationship between a Requirement >> RequirementVersion? Other features need are the possibility to completely revive old states to be the current/latest one, there must be the ability to have minor and major version (changes) and such, and last but not least the ability to create a 'Baseline' across a collection of Requirements with the latest version to go back to that particular Baseline at a later point of time and displaying all of the included RequirementVersions?
This has to scale up to a couple million Requirement Records, each of them having a couple thousand revisions.. that's particularly why I am asking.. the scaling aspect of a simple 1:n relationship etc.
Has anyone done something similiar and maybe some suggestions/best practices etc regarding versioning/baselining etc?
Cheers & thanks,
-Jörg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这取决于每个需求有多少数据。
如果需求有大字段(例如需求描述)。
如果需求足够小,您可以使用需求>> 要求版本。 在大多数情况下,您不会有显着的数据增长,特别是您可以利用 SQL2008 压缩。
This depends on how much data each Requirement has.
If Requirement has large fields (e.g. Requirement Description).
If Requirement is small enough you can use Requirement >> RequirementVersion. In most cases you will not have significant data grow, especially you can utilize SQL2008 compression.