1

I have JSON documents like the following:

{
  _id: 'some_id',
  title: 'Untitled',
  units: [
    {
       title: 'Untitled',
       theme: 'basic'
    },
    {
       title: 'Untitled'
    }
  ],
  values: [1, 2, 3]
}

I'm looking for database or approach that allows me to support versioning of that document. Basically I need the following:

  • Partial edits of document should be possible without having to update the entire document
  • Get full diff between two revisions
  • Rollback document to particular revision

May you advise something for my purpose?

Community
  • 1
  • 1
Erik
  • 14,060
  • 49
  • 132
  • 218
  • Btw, if you want to persist changes only, then you can probably use event sourcing and build an application on top of that, which does what you need. I don't know of a database which is capable of what you need, but I am far from a db expert. If there is one, I am sure you can find it here: http://nosql-database.org/ – inf3rno Jun 05 '14 at 10:25
  • 1
    Thanks for the git joke :) But seriously I'm looking for an approach that could fit my needs. I can to store documents in MongoDB like database but I don't understand how could make revision support event in application level – Erik Jun 05 '14 at 11:06
  • Does this help? http://stackoverflow.com/questions/4185105/ways-to-implement-data-versioning-in-mongodb – inf3rno Jun 05 '14 at 11:45
  • Btw I would create an event storage, and add a read cache in where all frequently used versions would be available (not just the changes). I don't think there is a nosql database with these features, but who knows, maybe others has the answer. Good luck! – inf3rno Jun 05 '14 at 11:47

0 Answers0