[erlang-questions] Access control framework and method for data versioning

Magnus Ottenklinger <>
Wed Dec 21 22:06:43 CET 2016

> For the same application, I need to implement versioning of data, i.e.
> data should not be changed after it is recorded but superseded by a new
> version offering a full history of the data. Data is stored in some
> NoSQL database system.
> I would love to hear some suggestions on implementing versioning of data.

Some time ago, I did a lot of thinking on how I would implement something like this. A
friend and I prototyped something like that over a day by using git as a backing storage.
The pull/push model of git does not fit the problem perfectly, but storing documents in
git is very straight forward to get started. On top of that, you only need a simple
PUT/GET API (no other calls, as nothing committed to storage may ever change) and a call
to traverse the tree. For calling git, we called the git executable directly after taking
a look into erlgit[1], which offered more than we actually needed for the prototype.

Now, to make it completely distributed, a simple KV-store seems very appropriate, although
storing the meta data in an efficient manner comes down to maintaining your own secondary
index (you want to represent a tree of objects, after all). Additionally, concurrent
access to a shared tree representation is not trivial without support for transactions.

As I did not find enough time to really implement this system, I also did not take the
time to research into other fitting storage mechanisms. Maybe a graph database would be
the simplest approach to implement this.


[1] https://github.com/gleber/erlgit

More information about the erlang-questions mailing list