[erlang-questions] Q: recommendations on mnesia record size?

Ulf Wiger ulf@REDACTED
Mon Feb 26 08:24:45 CET 2007


Den 2007-02-26 04:03:54 skrev jm <jeffm@REDACTED>:

> Are there any guide lines or rules of thumb on how
> large or complex a record stored in mnesia should
> be allowed to get before being redesigned?

Not really, other than the usual reminders that
- records are copied (in fact more than once when using
   transactions), so the size of the record matters in that
   respect.
- the number of fields in the record matters when updating
   it, since the whole top level is copied each time
   (although you need a fairly large amount of elements
   for it to become significant.)

In short, there are cost tradeoffs, and you need to get
a feeling for them. But while I believe there is an
upper limit to the number of elements in a tuple, I
don't think it is of practical interest.

The system limits are described in:
http://www.erlang.org/doc/doc-5.5.3/doc/efficiency_guide/part_frame.html

I did see once a program where a whole tree structure
was kept as one object in a mnesia database, and the
entire tree was read (within a transaction) for each
prev/next operation. This is not something I'd recommend.

BR,
Ulf W
-- 
Ulf Wiger



More information about the erlang-questions mailing list