[erlang-questions] If you make WhatsApp today...

Ulf Wiger <>
Mon Oct 12 08:03:08 CEST 2015

> On 11 Oct 2015, at 23:44, Jesper Louis Andersen <> wrote:
> Were I to start, I'd definitely do the API modularity split as well, but I'd probably pick postgresql as a backing store over mnesia, perhaps with mnesia as an in-memory cache for active users. The assumption is user data is not changing that often, and postgresql have the added value of being a system I *know* how to operate and handle. There is much to be said for picking technology which is tried and proven and you know how to operate.

FWIW, while playing around* with the extended mnesia version at Klarna, we also experimented with a pgsql backend to mnesia.

It worked pretty well, although there were some bootstrapping challenges esp. during testing**, but ultimately, the leveldb backend was a better fit for their needs.

* They stopped playing around and are now using ‘mnesia_ext’ with a leveldb backend
** You could either create a pgsql instance inside the mnesia directory, or connect to a running pgsql, in which case consistency checks where needed

As I understand it, Klarna will publish the leveldb backend (the pgsql backend was an experiment, so I don’t know about that).

For those who want to experiment with *some* backend, there’s

https://github.com/klarna/otp/blob/OTP-17.5.6-mnesia_ext/lib/mnesia/test/mnesia_ext_filesystem.erl <https://github.com/klarna/otp/blob/OTP-17.5.6-mnesia_ext/lib/mnesia/test/mnesia_ext_filesystem.erl>

which is used in the test suite.

A very simple example of how to get started with it can be found here:
https://github.com/klarna/otp/blob/OTP-17.5.6-mnesia_ext/lib/mnesia/test/mnesia_ext_test.erl <https://github.com/klarna/otp/blob/OTP-17.5.6-mnesia_ext/lib/mnesia/test/mnesia_ext_test.erl>

Ulf W

Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151012/7e551c7e/attachment.html>

More information about the erlang-questions mailing list