tags:

views:

192

answers:

3

All I need is a large persistent lookup table in Erlang and dets seems like just the thing though I need a definative answer to:

  • just how big the total size of the binaries in the table can be.
  • how big each entry can be
  • what to do if the answer to the first question is less than 100G
+7  A: 

This is kind of an RTFM question. As quoted directly in the second paragraph of the DETS manual:

The size of Dets files cannot exceed 2 GB. If larger tables are needed, Mnesia's table fragmentation can be used.

Dustin
unless its 64 bit erlang or one of the other exceptions floating around. Which is why I ask here.
Arthur Ulfeldt
dets still have the limit on 64bit beams, its in the file format.
Christian
+1  A: 

One obvious approach, once it is thought of, is to hash dets entries over multiple dets files.

A linear hash should make it dynamically growable, by splitting buckets into newly created dets files when one file reaches an upper threshold.

There are also a number of port drivers that enable you to use sleepycat/berkely db, or tokyo tyrrant. Those databases have file limits that are much higher than 2Gb.

Christian
a good one here:http://dukesoferl.blogspot.com/2008/06/tokyocabinet-and-mnesia.html
Arthur Ulfeldt
A: 

using mnesia fragmented dic_copies can overcome these limits provided you know how many fragments to crate ahead of time
http://www.trapexit.org/Mnesia%5FTable%5FFragmentation

Arthur Ulfeldt