The Elixir ecosystem is one of our biggest strengths, and the BEAM really lends itself to native implementations (e.g. Cachex over Redis, Bandit over Apache). But one thing which I feel is sorely missing is a good database. There are of course some options, perhaps most notably mnesia
, but pretty much everyone here is using Ecto/Postgres (myself included).
What sort of features, functionality, and so on would you like to see from an Elixir database? I’ll give my personal list to start, but I’d like to hear some other perspectives as well.
Here’s what I’d like to see:
-
Embedded. The database should run entirely within the BEAM. In any other ecosystem “embedded+distributed” is an oxymoron, but not here!
-
High availability. Fault-tolerance is a core tenet of Erlang/Elixir, so an Elixir database should naturally follow suit. Losing some number of nodes should not cause meaningful downtime.
-
Replication. Similarly, data should be replicated such that losing some number of nodes does not cause data loss or corruption.
-
Horizontal scalability. Scaling out across cores and nodes is another core tenet which should be followed. Doing this properly would require autosharding as well.
-
Multitenancy. Native multitenancy is critical for driving down operational costs. A single cluster should be able to serve many isolated tenants.
-
Relational. The relational model is one of the great inventions of computer science and deserves respect. By relational I do not mean SQL, which has been a corruption of the relational model essentially since inception.
-
OLTP. An OLTP database would cover the vast majority of use cases. Also, it is fairly easy to build an OLAP database on top of an OLTP database, but going the other way is essentially impossible.
-
Transactional. Transactions should be atomic and isolated across nodes. I don’t even think I need to justify this tbh.
-
Interactive transactions. Deterministic databases are just too hard to use. Interactive transactions can scale if the database is designed properly.
-
Strong consistency. It is trivial to weaken strong consistency and nearly impossible to strengthen weak consistency. Therefore strong consistency must be offered by default. I would not accept anything less than strict serializability.
-
SSD storage. In-memory databases were all the rage in the late 2000s, but then SSD prices cratered way faster than DRAM. Essentially all modern databases run on SSDs. (RIP Optane)
-
Free. A huge number of “open source” databases have been rugpulled recently. Nobody is going to trust database startups for a generation IMO. Anything closed or proprietary is DOA.
As you can see, nothing ever written in Erlang or Elixir checks off more than a couple of these.