4 ms·
My main interest in Erlang is mnesia. A relational/object hybrid data model that is suitable for telecommunications applications. A DBMS query language, Query
by wildduck 7y ago
My main interest in Erlang is mnesia.
A relational/object hybrid data model that is suitable for telecommunications applications.
A DBMS query language, Query List Comprehension (QLC) as an add-on library.
Persistence. Tables can be coherently kept on disc and in the main memory.
Replication. Tables can be replicated at several nodes.
Atomic transactions. A series of table manipulation operations can be grouped into a single atomic transaction.
Location transparency. Programs can be written without knowledge of the actual data location.
Extremely fast real-time data searches.
Schema manipulation routines. The DBMS can be reconfigured at runtime without stopping the system.
- samvher 7y agoYeah mnesia is extremely clever and very fun to learn. Also being able to store basically any term without having to do conversions is very useful. I've found some practical aspects a bit painful though. It took me a while to figure out how to make backups, migrate schemas to different sets of nodes, that sort of thing. Also there are size limits on disk-based tables which are a bit limiting, and while you can use table fragmentation to get around that to some extent it doesn't seem straightforward to use (I haven't dared so far). I also don't like the way it deals with netsplits - when nodes reconnect it tends to require manual action to resolve.
- marci 7y ago> Also there are size limits on disk-based tables which are a bit limiting There's now mnesia on leveldb https://github.com/klarna/mnesia_eleveldb https://github.com/klarna/mnesia_eleveldb https://www.youtube.com/watch?v=KcJw3RYFWUM https://www.youtube.com/watch?v=KcJw3RYFWUM
- lostcolony 7y ago'I also don't like the way it deals with netsplits' I actually prefer it. Too often systems out there don't tell you what they do in the event of a netsplit. They may have marketing copy somewhere that tells you what they try to do, but then you see the Jepsen tests and realize that's a lie, or is naive, or whatever. Mnesia makes no secrets about it. In the event of a partition it stays partitioned, operating as separate nodes. It's up to you to figure out what to do about that. You can grab a Raft implementation to perform leader election, with the tradeoffs that entails. You want it to self-heal and deconflict based on arbitrary logic, for an eventually consistent system? You can do that too. You want to pretend it doesn't happen, stick your fingers in your ears, "LALALALA" until it does and requires manual intervention? That's fine too! What it DOESN'T do is give you a false sense of security while handwaving away the decisions and implementation concerns that were made to determine CAP behavior, which I find pretty much every other distributed data store does. It definitely has pain points in learning it, and it also has some very definite limitations, but as a baked in, minimally biased distributed store, it's a battery I really loved having included.