94 points · by sethev · 13y ago · 19 comments
The issue of having an easy audit trail is absolutely critical for many businesses, and is ill-served by most existing databases.
This is one thing I liked about CouchDB - CouchDB does not enforce this strictly, the way Datomic does, but the model encourages "append to edit" rather than strict modification. I haven't had the time yet, but I'm excited to check out Datomic specifically for this reason.
http://www.cs.hut.fi/~siva/hibase/
HiBase was project funded by Nokia. The Goal was to develop a persistent functional programming environment with for telecom environments.
The reason why it was functional was the observation that in functional programming environment you can model data as graph where references point only backwards in time. In other words, if you just constantly write your data into the database and have smart GC, you can recover very fast from crashes. Just like telecom environment likes it.
The project was canceled, some say for reasons to do with internal company politics, but it showed huge promise. It was already 10X faster than competing commercial databases that were tweaked by their developers to perform well in testing.
If you have any questions about pros/cons, what it's like to use, operational constraints/tradeoffs, please ask.
>Is adding a “peer” all there is to do to handle more reads?
Yes, modulo storage backend throughput capacity. It uses storage backends in a fairly dumb and efficient manner so in all likelihood peers will be the bottleneck.
>ops wise
PostgreSQL and DynamoDB are pretty popular, the ops scenario for the latter is pretty obvious. You can just scale the provisioned IOPS according to your storage backend throughput. Pretty sure DynamoDB can exceed anything you'll ever need in that regard. A sufficiently beefy PostgreSQL machine (SSD, etc) can go ham too.
The main shift in mentality with Datomic ops and application-wise is that you're prioritizing vertical scaling before horizontal scaling. I actually think that's the smarter thing to do from a cost and complexity stand-point anyway. I've worked in environments where horizontal scaling was deployed prematurely and we were managing 100 machines where ~3-5 would've sufficed.
Part of this enhanced emphasis on scaling is that you're incentivized to make the most of each peer. If you have peers that are making "lightweight" use of (Datomic/your data) but you need many of them running (for compute?) then call into a REST peer or custom REST interface to read/write the data. You implement sprocs through database functions which are just Clojure code, super nice.
Main scaling choke-point is just the transactor itself.
>Application wise
The two X-factors for Datomic in my experience are datalog and the deeply "historical" nature of the database and querying. Being able to arbitrarily time-slice queries with complicated relationships without having to change them in order to accommodate the "time-slicing" is amazing.
There are separate interfaces for querying and transacting, which is nice.
I would advise avoiding doing more migrations than necessary since that means you'll have to use my library Brambling though :)
The Datomic guys are working on implementing trivial schema changes (like adding indexes), but for the more complicated migrations, you'll have to use Brambling or something comparable.
Any other queries?
[This next part is me, not them] So despite being theoretically write bottlenecked, it still does better than postgres, because the transactor does less work (though they're in the same ballpark). What do you think?
I hope I'm quoting them right, from memory.
What's your failure recovery strategy when your writer fails?
But this week I'm backing up, and migrating datomic from AWS to our own hosted hardware.
Doing this for our dev environment? Man, it Just Worked. I couldn't be happier. I'm still rsyncing the files from AWS to hosted, but I couldn't be a happier systems administrator at this point.
When you take these snapshots, are you still touching the database? Or is the data held in memory in the application?
It seems like the former makes a lot more sense, but he makes it seem like he's only working with a cloned, local copy.
You could hypothetically thrash the LRU by working with a large dataset and forcing the LRU to cyclically evict the data, but even the pathological case is at worst identical to how SQL databases work.