[erlang-questions] Support for newcomers and the popularity of Erlang

Daniel Eliasson daniel.eliasson@REDACTED
Tue Mar 20 09:11:28 CET 2012

Hi Wojciech,

I think you should consider what kind of data you're storing and how
you want to use it, and decide on your database from that. Mnesia is
good for a "working database", but wouldn't be my choice for
persistent storage of large amounts of data. You'll hog a lot of RAM
and run into table size limits. Riak seems to be a better choice for
large distributed key-value storage, assuming you can live without

But ask yourself: will I need to use this data outside my application?
Do you need to perform analysis, run arbitrary queries on it? If the
answer is yes, I would use PostgreSQL or some other competent
relational database.

Another advantage (a really big one) of having a database with proper
schemas is that you get your datatypes defined in at least one place.
A dynamic language like Erlang combined with a database like Mnesia
that happily stores whatever terms for you easily leads to very ill
defined data structures. That will lead to a lot of pain over time.

Daniel Eliasson

On 19 March 2012 18:54, Ulf Wiger <ulf@REDACTED> wrote:
> On 19 Mar 2012, at 18:42, Wojciech Knapik wrote:
> On Mon, Mar 19, 2012 at 6:08 PM, Jesse Gumm <gumm@REDACTED> wrote:
>> Have you looked into riak for distributed, master-less data replication?
> From what I've read on github, I can't tell what the benefits would be and I
> was hoping to familiarize myself with mnesia.
> Would riak be a better fit ?
> It depends much on your access patterns.
> Mnesia offers transaction consistency, meaning that you can run fairly
> complex update transactions and let mnesia worry about consistency across
> your data set. This is a wonderful feature, but it tends to become
> troublesome in very large clusters, since the increasing cost of ensuring
> consistency puts a limit on scalability, and netsplits become increasingly
> likely as your clusters go. Netsplits and transaction consistency make poor
> bedfellows.
> Riak is a key-value database with no transaction concept whatsoever
> (although individual writes are of course atomic). Thus, if you have
> concurrent read-write patterns against the same data, you will find the
> results …arm, interesting for any but the simplest of update patterns.
> (See
> e.g. http://www.infoq.com/presentations/Eventually-Consistent-HTTP-with-Statebox-and-Riak for
> an example of roughly how far you can push concurrent updates in riak. It
> should also give you an idea of how riak works.)
> OTOH, if all you do is simple get/put, and you need high throughput and
> excellent fault tolerance, riak will let you scale to levels way beyond what
> any sane person would attempt with mnesia.
> BR,
> Ulf W
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list