开发者

Javascript/Node.js: data patching scheme

I'm writing a little app in node. I have posts that I want wiki-like revisions for. I'm also saving the post very frequently as they're being edited, so I do not want to save full revisions on each edit.

Is anyone aware of any existing开发者_如何学编程 schemes for storing patches rather than revisions? This will be json/plaintext, no need to diff binaries or anything.


Unless you settle for simple last-edit-wins logic, this is quite complicated (actually, it will still be if you do :). You might be interested in the wave protocol, open-sourced.


You could start by reading the blog post Time and Space Tradeoffs in Version Control Storage by Eric Sink (SourceGear founder) where he discusses the very question you ask:

Storage is one of the most difficult challenges for a version control system. For every file, we must store every version that has ever existed. The logical size of a version control repository never shrinks. It just keeps growing and growing, and every old version needs to remain available.

So, what is the best way to store every version of everything?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜