If you are interested in the benefits you can get from immutability in a database, or at least a database that offers the illusion of immutability, check Datomic.
Datomic is a Database invented by Rich Hickey in alliance with Think Relevance, there are plenty of videos where they explain the architecture, the goals, the data model. Search infoq, one in particular is titled Datomic, Database as a Value. In confreaks you can find a keynote Rich Hickey gave at the euroclojure conference in 2012. confreaks.com/videos/2077-euroclojure2012-day-2-keynote-the-datomic-architecture-and-data-model
There is a talk in vimeo.com/53162418 which is more development oriented.
Here is another from stuart halloway
- Datomic is a database of facts in time, called datums, in 5-tuples [E,A,V,T,O]
- E Entity id
- A Attribute name in the entity (can have namespaces)
- V Value of the attribute
- T Transaction ID, with this you have notion of time.
- O One operation of assertion (present or current value), rejection (past value);
- Uses it's own data format, called EDN (Extensible Data Notation)
- Transactions are ACID
- Uses datalog as query language, wich is declarative as SQL +
recursive queries. Queries are represented with data structures, and extended with your jvm language, you don't need to use clojure.
- The database is decoupled in 3 separate services (processes,machines):
- Query Engine.
- You can separately, scale each service.
- It's not open source, but there is free (as in beer) version of Datomic.
- You can state a flexible schema.
- set of attributes is open
- add new attributes anytime
- no rigidity in definition or query
Now, since the info is stored as facts in time:
- all you do is add facts to the database, you never delete them
(except when is required by law)
- you can cache everything forever. Query Engine, lives in the application server as an in memory database (for jvm languages non-jvm languages have access through a REST API.)
- you can query as of time in the past.
The database is a value, and a parameter to the query engine, the QE manages the connection and the caching. Since you can see the db as a value, and immutable data structure in memory, you can merge it with another data structure made from values "in the future" and pass that to the QE & query with future values, without changing the actual database.
There is an open source project from Rich Hickey, called codeq, you can find it in github Datomic/codeq, which extends the git model, and stores references to git objects in a datomic-free database, and make queries of your code, you can see an example of how to use datomic.
You can think of datomic as a ACID NoSQL, with datums you can model tables or documents or Kv-stores or graphs.
UPDATE). Like doctor's medical records.