Summary

Elixir has its own built-in NoSQL persistence store call Mnesia. When I first heard this, I was blown away - but the more I worked with Elixir and OTP (the underlying framework), the more I understood why it was there.

I won't go into architecture in this book very much, but keep an eye out for additional manuals on this subject. OTP is deep, fascinating, and quite amazing to work with.

It's also old, which is good. Not so good for a database. At NDC London in 2015 I attended a talk by Francesco Cesarini which was all about high-scalability architecture with Erlang. I spoke to him afterwards about Mnesia and he had this to say:

Mnesia is interesting and really, really fast. But it's lived beyond its expiration date.

There are better solutions out there if you need a database that works well in a distributed system. Mnesia does not. Oddly, Mnesia is ACID compliant, which means there are guarantees that when a transaction is finished, the write will be complete. Being ACID compliant in a distributed system is problematic - you can't have data guarantees if one of your database nodes is offline.

Code

Added Amnesia4
View Code or clone the repo from https://github.com/bigmachine-io/taking-off