Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Quite large if your question is "what's the storage capacity of an mnesia database made up of a huge number of <code>disc_only_copies</code> tables" - you're largely limited by available disk space.</p> <p>An easier question to answer is what's the maximum capacity of a single mnesia table of different types. <code>ram_copies</code> tables are limited by available memory. <code>disc_copies</code> tables are limited by their <code>dets</code> backend (<a href="http://www.erlang.org/~hakan/mnesia_consumption.txt" rel="noreferrer">Hakan Mattsson on Mnesia</a>) - this limit is 4Gb of data at the moment.</p> <p>So the simple answer is that simple <code>disc_copies</code> table can store up to 4Gb of data before they run into problems. (<em>Mnesia doesn't actually crash if you exceed the on-disk size limit - the ram_copies portion of the table continues running, so you can repair this by deleting data or making other arrangements at runtime</em>)</p> <p>However if you consider other mnesia features, then the answer is more complicated.</p> <ul> <li><a href="http://erlang.org/doc/apps/mnesia/Mnesia_chap5.html#5.4" rel="noreferrer"><code>local_content</code></a> tables. If the table is a <code>local_content</code> table, then it can have different contents on each node in the mnesia cluster, so the capacity of the table is <code>4Gb * &lt;number of nodes&gt;</code></li> <li><a href="http://erlang.org/doc/apps/mnesia/Mnesia_chap5.html#5.3" rel="noreferrer">fragmented tables</a>. Mnesia supports user configurable table partitioning or sharding using table fragments. In this case you can effectively distribute and redistribute the data in your table over a number of primitive tables. These primitive tables can each have their own configuration - say one ram_copies table and the rest disc_only_copies tables. These primitive tables have the same size limits as mentioned earlier and now the effective capacity of the fragmented table is <code>4Gb * &lt;number of fragments&gt;</code>. (<em>Sadly if you fragment your table, you then have to modify your table access code to use <code>mnesia:activity/4</code> instead of <code>mnesia:write</code> and friends, but if you plan this in advance it's managable</em>)</li> <li><a href="http://code.google.com/p/mnesiaex/" rel="noreferrer">external copies</a> If you like living on the extreme bleeding edge, you could apply the <a href="http://code.google.com/p/mnesiaex/" rel="noreferrer">mnesiaex</a> patches to mnesia and store your table data in an external system such as <a href="http://code.google.com/p/erlaws/" rel="noreferrer">Amazon S3</a> or <a href="http://code.google.com/p/tcerl/" rel="noreferrer">Tokyo Cabinet</a>. In this case the capacity of the table is limited by the backend storage.</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload