garrison

garrison

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.

Showing Posts 1 to 10

dimitarvp

dimitarvp

Ideally FoundationDB + SQL compatibility. Sorry for low-effort response but lately I’ve been fangirling over FoundationDB way too much.

al2o3cr

al2o3cr

I’ll turn this question on its head: what sort of features, functionality, and so on are you envisioning you can ONLY get with an Elixir database?

garrison

garrison OP

As you should!

Indeed, FDB is essentially the perfect architectural donor. It checks off almost everything on my list (though I do have a few more things I want which FDB doesn’t support). But of course FDB cannot be embedded in Elixir!

As for SQL, I think it’s a mistake. One very important thing I left off the list is incrementalization, i.e. live query support. SQL is made up of several decades of bloat and functionality which is probably useful for business processing but not useful for application building (my primary interest). Incrementalizing all of that functionality is essentially impossible (people keep trying, though).

Honestly I’d rather just bite the bullet and throw it away. It’s not like SQL was ever even good to begin with, it survives because it’s the standard (and yet every implementation is nonstandard, funny how that works!).

garrison

garrison OP

I don’t think there is any functionality which you could only get with an Elixir database. Even a database written in C could technically satisfy the “embedded” criterion if you were ambitious enough.

I will, though, gladly accept responses that reinterpret the question as “what features, functionality, and so on would you like to see from a new database which is by total and complete coincidence written in Elixir” :slight_smile:

Schultzer

Schultzer

What is the issue with SQL, it’s a language and it’s implementation dependent, so you could use it for anything that works on sets which is most data, relational or not.

There are so many SQLish languages out there, datadog, grafana etc that would have benefited from being a subset of SQL with implementation specific operators.

garrison

garrison OP

Really opening pandora’s box here, you could write a book on what’s wrong with SQL (and I bet there are several). Instead of derailing the thread into oblivion (I’m fully aware it’s my own doing) I’ll instead link this article which I enjoyed and need to read again. But there are so many more reasons.

Which is kind-of the point I was making. SQL’s best selling point is that it’s a standard (it’s bad at pretty much everything else) except it’s also not even good at that. You can’t even trivially port an app between MySQL and Postgres!

I am fully aware you are the author of the SQL library btw, which I think is really cool! But I will note that by adding composability to SQL you have, in fact, also managed to create something which is not SQL!

Schultzer

Schultzer

I don’t see how composability breaks anything, it’s still SQL, although with an advance engine that helps you write SQL that fits you.

To me, when people dis SQL, then it comes from a misunderstanding of what it is, regardless of the standard, most database are non standard, and there lies my point. SQL is whatever the query planner decide. Because the standard is implementation specific, which is, for me, a superpower.

Changing database is not a solid argument, because you rarely do it, and if you need to, then you can afford it too.

garrison

garrison OP

I am not trying to suggest that it “breaks” anything. I think your library is really cool, I’ve never seen anything quite like it before. It’s like a hybrid of an ORM DSL and actual SQL syntax, which makes up for one of the biggest shortcomings of SQL (hard to compose).

But the reason you have to make up for shortcomings of SQL with DSLs (or very clever macro strings that look like SQL but are not, actually) is that SQL itself is, uh, bad.

Well no, the execution of the query plan is what the query planner decides. SQL is a language. It does actually exist, like, as a language. There were better languages before it (QUEL), but it won because, you know, IBM.

jstimps

jstimps

I’m sure it comes as no surprise that I agree with your list. :grinning_face_with_smiling_eyes:

I would be eager to use, and contribute to, a BEAM native DB with a low level API compatible with FDB’s core feature set (ordered keyset, get range, clear range, transactions, mvcc). A high level relational API is where many people would live, but the direct storage engine access is so powerful.

The FDB team never got the chance to implement all the Data Layers on top of their storage engine because of the acquisition. It would be exciting to have an ecosystem where those ideas could carry on.

Here’s a few things I would add to a wishlist

  • Stellar documentation
  • Public roadmap, including list of what features are considered “experimental” and whether or not there is an expected path/timeline toward production safety
  • No query planner, or a very limited one. Permissive planners have caused me a lot of headaches.
Schultzer

Schultzer

Exactly , it’s a language, but how the query planner decides to interpret and execute that, is sole on the query planner. And that is exactly why you would not need any other languages regardless of your data is
relational or not.

To take it a step further, there is nothing stopping us from querying mnesia, ets or dets with SQL. In fact this has already been done with Ecto.Query.

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 94592 917
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
AstonJ
Since we have deprecated our Erlang sections (as we have dedicated Erlang Forums now) let’s add this thread for those who’d like to post ...
New
maennchen
:warning: Security advisory: Decimal DoS vulnerability A vulnerability has been published for decimal where very large exponents can cau...
New
Null-logic-0
What IDE or editor are you using for Elixir development? Personally, I use Zed, and I really like it, but sometimes I wish there were a ...
New

Other Trending Topics Top

marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews