Which DB do you use with Elixir/Erlang in write-heavy apps (no update)?

I know that a couple of nosql dbs such as Cassandra or Couchbase work fine for write-heavy applications, but what about mnesia bag type disk_copies? Does it suit, despite of the table size limit?

5 Likes

It depends upon what sort of data you’re looking to store and how you’re wanting to store it. If you can get away with using a key-value database (such as Redis), then that would most likely be your most performant option (not to mention the nice simplicity of the data model makes it pleasurable to work with). Otherwise, I’ve heard that ScyllaDB is suppose to be very performant, particularly for a column-family database (it aims to basically be a high performance version of Cassandra).

I can’t speak for mnesia though, since I have no experience with it.

4 Likes

Thanks for reply @tpunt. I’m looking for a data, where primary key can be non-unique (key-value or column db), so I can fetch a batch of records using that primary key. Also it should be fast on writes. Probably the db would be CP.
Most likely the in-memory db would be too expensive. Is there any Elixir or Erlang client for Scylla?
I’ve also heard about RocksDB and that it’s designed to work with SSD.

1 Like

That doesn’t sound like a PK, but rather just some sort of grouping value.

What’s CP?

Redis doesn’t keep the whole database in memory. It snapshots to disc periodically (I expect other key-value data stores to do the same too).

Good question - I’m not sure if there is. A quick Google search would suggest not.

That looks like an interesting alternative, and it looks like there are clients for it in Erlang too.

Our blog post about databases

So if you want search by something more than key (key must be unique :)) the option is column base database like Cassandra or Scylla. Cassandra is fast on write and slow on read. Cassandra is also eventually consistent → not CP database type. And it is not easy to maintain Cassandra :). I don’t know about Scyllia.
In other case you will need to create composite key and store collection of records in this key.

CP (Consistency and Partition Tolerance) ?

4 Likes

Yes I mean consistency and partition tolerance.

I found erocksdb adapter in Erlang[quote=“mkunikow, post:5, topic:739”]
So if you want search by something more than key (key must be unique :))
[/quote]

Mnesia bag type suits well in this component. The only thing is table size limit.

In case of Cassandra, this Erlang client looks pretty mature.

1 Like

Anyone already used ScyllaDB with elixir/phoenix and can give feedback how it works?
Because I didn’t found any adapters for elixir /w scylladb

Fully compatible with Apache Cassandra

Does it work with something like this GitHub - cqerl/cqex: Idiomatic Cassandra client for Elixir ?

1 Like

Thanks, didn’t thought about that. Thanks.

well i think discord uses it in production

I worked short period for a company who uses ScyllaDB, whatever tools, libraries works for CassandraDB they also works for ScyllaDB, like Xandra library
And ScyllaDB is a monster, very highly performant DB and I found this free GUI tool by Netflix this works for both Cassandra and ScyllaDB
If your use case suits for CassandraDB then I recommend to use ScyllaDB

4 Likes