存储版本历史 [英] Storing Version Histories

查看:122
本文介绍了存储版本历史的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开展一个小方案项目,目前正在努力研究如何保存历史记录。

顶部是一个文档,每个文档都是一系列名称/值对值可能是名称/值本身的列表。每个文档都存储在一个文件中,并且是人类的,也是机器的,可读的。



所以我需要在文档中包含历史记录并保持其可读性。我想只是附加最新版本的文件,但最终会导致一个大文件,每次更新通常只有一个或两个值发生变化。



我原来的想法是这样的:



I am working on a little side project and I am currently trying to work out how to hold a history.
At the top is a document, each document is a series of name / value pairs with the value potentially being a list of name / values itself. Each document is stored within a file and is human, as well as machine, readable.

So I need to contain the history within the document and keep it human readable. I would like to just append the file with the latest version, but that would result in a large file in the end with often only one or two values changing on each update.

My original idea was this:

0 {
  name bob
  age 42
  address {
    house 4
    road high street
  }
}
1 {
  # another year older
  age 43
}
2 {
  address {
    # change the house number
    house 7
  }
}





这可以从存储和检索的角度来看,但是在几个版本之后它可能变得很麻烦。我可以重建以前版本的任何版本的内容,但是有更好的方法吗?



记住我需要保持它的人性化。



This works from a storage and retrieval perspective, however after a few versions it could become cumbersome. I can rebuild the content for any version from the previous ones, but is there a better way?

Remember I need to keep it human readable.

推荐答案

尝试像我这样的文档存储数据库引擎: RaptorDB - 文档存储 [ ^ ]

这一切适合你。
Try a document store database engine like my : RaptorDB - the Document Store[^]
Which does all this for you.


这篇关于存储版本历史的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆