Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a concurrent-access data storage format that can be version controlled?

I have a project that requires the data storage to be version controlled (e.g. in git or svn). To be clear, I mean versioning of the contents of the data store, not the schema. We will take snapshots of the data itself, for example to be able to restore to a previous state. Branch and merge is also needed.

The basic requirements are:

  • each data store can reside in its own directory (repository)
  • possible to merge divergent versions of the data contents (either manually, or with a tool)
  • able to run basic select queries to make a visual report

And ideally:

  • safe for concurrent access
  • some level of relationship integrity

I've looked at various options. Merge is hard with SQLite (binary format). CouchDB has great merge possibilities (multimaster replication), but doesn't allow different directories for each data store. Plain JSON or other text files make queries and relationships hard.

Is there a data storage format that can be version controlled in this way? How would you solve this problem?

EDIT (more context): the specific use case is to implement distributed software issue tracking, in a similar style to Fossil SCM. But while I am interested in existing tools that solve this, I'm particularly interested in exploring and understanding different data store options that could be used to build such a tool.

like image 344
mtmacdonald Avatar asked Jul 28 '14 12:07

mtmacdonald


1 Answers

One solution that comes to my mind is to convert your data into a format that support versioning control. For instance XML. Then when you want restore your data to a specific version, just checkout the corresponfing XML and do the oposite.

There is also an XML based database engine: BaseX

Taken from BaseX site:

BaseX is a light-weight, high-performance and scalable XML Database engine and XPath/XQuery 3.0 Processor, which includes full support for the W3C Update and Full Text extensions. An interactive and user-friendly GUI frontend gives you great insight into your XML documents.

You can take a look at this too (Oracle): Generating XML Data from the Database

like image 87
Raydel Miranda Avatar answered Sep 20 '22 04:09

Raydel Miranda