[erlang-questions] Mnesia vs. ets+dets
Charles Hixson
charleshixsn@REDACTED
Mon Nov 10 02:26:45 CET 2014
On 11/09/2014 12:56 PM, T Ty wrote:
> I usually advocate using Mnesia because any schema you come up with
> you will later want some form of fault tolerance and as Joe Armstrong
> keeps harping, you can't do fault tolerance with one node.
>
> That said, Mnesia does not automatically split data between tables.
> You have to explicitly setup fragmented tables for it.
>
> To control how often Mnesia dumps from RAM to disc see:
>
> -mnesia dc_dump_limit Number. Controls how often disc_copies tables
> are dumped from memory. Tables are dumped when filesize(Log) >
> (filesize(Tab)/Dc_dump_limit). Lower values reduces cpu overhead but
> increases disk space and startup times. The default is 4.
>
>
>
> On Sun, Nov 9, 2014 at 8:00 PM, Charles Hixson
> <charleshixsn@REDACTED <mailto:charleshixsn@REDACTED>> wrote:
>
> I'm going to be running on a single node, at least for the
> foreseeable future, if that matters.
>
> I expect the data to grow to be too large to fit into RAM, OTOH,
> only a small subset will be needed at any one time. Also I expect
> active items to have frequent updates, but most items to rarely be
> updated (only when a purge is contemplated). There doesn't seem
> to be any way to control the frequency with which Mnesia
> synchronizes to disk...but I also don't see any information about
> how often it does so. Once every few minutes wouldn't be a
> problem, but on every change would be prohibitive. On the plus
> side, Mnesia will automatically handle splitting the data between
> tables (when the data grows too large to fit into one dets file).
>
> One way of handling the problem is to operate out of an ets
> database which pulls in data as needed from various dets files and
> occasionally synchronizes with them. This starts looking complex,
> and Mnesia is clearly intended to solve problems *like* this. I
> just can't determine that it will handle *this* problem. If I
> could set the rate of synchronization between RAM and disk, it
> would be the clear best approach...but I haven't even found any
> documentation on that.
>
> OTOH, I'm quite new to Erlang (I've just written one successful
> program) so I could easily be missing something that's extremely
> obvious to someone more experienced.
>
> Any comments or suggestions?
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141109/41e3ea1a/attachment.htm>
More information about the erlang-questions
mailing list