Qqwy
TypeCheck Core Team
Looking at the stacks that existing large companies have used, WhatsApp internally uses Mnesia to store the messages, while Discord uses Cassandra.
Also, in the past we’ve had quite a long discussion about ‘When to use Mnesia’ (vs. a traditional relational database), but this was about a year ago, and maybe there have been changes to the Mnesia Ecto bindings or similar?
What I already know:
- Cassandra runs on Java, Mnesia runs inside your BEAM.
- Both are distributed databases.
- Mnesia does not do conflict resolution (although you can write your own, and the packages
unsplitand [reunion](GitHub - snar/reunion: Mnesia partition handler · GitHub exist to do this for you). Cassandra always uses last-write-wins for conflict resolution.
Trending in Discussions
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
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hi there! :wave:
@frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
I’ve been using Emacs as my main code editor for more than a two years. It’s a custom build version although I’ve tried doom emacs and sp...
New
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
New
Lately I’ve been thinking about how to organize components as a LiveView application grows. One of the pain points I’ve found (for myself...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex










Showing Posts 24 to 15- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
marciol
Seems that Riak Team are working in an implementation called
leveledin pure Erlang GitHub - martinsumner/leveled: A pure Erlang Key/Value store - based on a LSM-tree, optimised for HEAD requests · GitHubThis seems to be a strong candidate to be included in the OTP release, what do you think?
rvirding
Yes, it would. That would be the major difference between the standard Mnesia which uses
detsas a backend and one usingleveldb. Dets is part of the standard BEAM and implemented in it while leveldb is not. That is one reason I that I expect that leveldb will not be included in the standard OTP release.Qqwy
As far as I can see, LevelDB itself would need to run outside of OTP, or am I missing something?
(Not that this is a problem per se, but it is something to be aware of.)
dch
It would be nice to see that eleveldb driver that Klarna was working on for Mnesia shipped with OTP, and directly usable. GitHub - klarna/mnesia_eleveldb: An eleveldb backend for Mnesia · GitHub
rvirding
Do you mean implementing it in the BEAM or implementing it in Erlang in the same way as Mnesia?
finnillson
I would like to see Mnesia (or something to take its place) be updated to address peoples concerns with using it.
CouchDB is nice but the JSON documents interface is crap, imo.
BEAM could benefit with having a modern distributed DB embedded natively in it ready to go without the little quirks of Mnesia that make it a no go for a lot of use cases.
I realize this is a HUGE task.
Imagine a modern JIT’d BEAM with a blazing fast, native, distributed DB that uses the native Erlang terms that would scale and work right out of the box.
dch
It might not fit for your use case, but ICouch v0.6.2 — Documentation is the most feature complete couch library out there. I don’t use ecto at all yet so I’ve not done any investigation into couch+ecto comparisons.
Riak is maintained now, and is pretty close to a 2.9 release riak/doc/Release 2.9 Series - Overview.md at develop-2.9 · basho/riak · GitHub although I have no idea how you’re supposed to figure that out just by reading the main repo page.
wrt CouchDB’s revision handling yup you are right, however in practice with a front end proxy in front and a sweeper view to handle conflicts I don’t really have issues in practice. It’s possible to get conflicts “inside” a cluster if couchdb can’t meet the requested quorum level (which is more of an admin problem, but …) and accepts a write with 202, and then you manage to write again to the lost node. At least, your data from both writes isn’t lost, and your application can figure out how to merge that as needed.
There’s no particular reason you couldn’t request conflict info on every GET, but personally I prefer 2 other approaches which work for me:
Conflicts are a key part of CouchDB’s mesh architecture if you have multiple clusters, and in practice the issue comes up infrequently.
Given the same N revision docs, couchdb will always pick the same winner (which may not be the one you want) consistently.
Also you can embed your Elixir app “inside” CouchDB as a further supervisor. This is really cool but probably of little practical use for most people.
tangui
Depends on what you call “unmaintained”. As far as I know Riak IP was acquired by bet365 last year and Riak has since been moving forward. A new 2.9 RC has been released last month: http://lists.basho.com/pipermail/riak-users_lists.basho.com/2019-January/039316.html
You can see (some?) dev effort here: Commits · basho/riak · GitHub
I guess the sustainability of Riak might be questionable (seems to depend on the will of one company, few developers, etc.). However I came to the same conclusions as you (and partly thanks to these articles) that compared with other solutions it has the best guarantees for eventual consistency (at least for what I plan to do with it).
Qqwy
Note: We are still busy researching the different options here; I am working hard to get Planga up to speed on one of the distributed databases.
So a quick update of my findings w.r.t. CouchDB, Cassandra and Riak in the meantime:
userstructure, and Alice changesuser.emailanduser.phonewhereas Bob changesuser.phone, assuming Alice’s change happens earlier, the end result will have Alice’s email change and Bob’s phone change in there. (Regardless of if they have seen each-other’s changes in the meantime!)What is a bit unfortunate is that for all three of these systems, the existing database client libraries are all unfinished. It is very likely that we’ll need to write our own Ecto adapter (or, if this turns out to be infeasible, a custom DB wrapper).
dch
BTW you’re welcome to ask about CouchDB directly - contact me, or the couchdb user mailing list. There’s commercial support available, hosted solutions too, and a BEAM-friendly community as well on IRC. See the https://couchdb.org/ website for more info.