[erlang-questions] mnesia vs raw file

t x txrev319@REDACTED
Tue Apr 8 11:06:10 CEST 2014


I have the following problem:

  On my client side, I have an editor where I want to record
_individual keystrokes_ (so I can replay how the file was composed.)

  Thus, my "document" is a list of

  {timestamp, cursor-location, key-pressed}

  Now, when I'm recording this on the erlang side, I want the
following conditions:

  * writing a new term (i.e. recording a keystroke) should be amortized O(1)

  * reading the entire document should be O(N), where N = number of
entries, and it should involve minimum number of seeks (I would prefer
all the terms be continuous blocks)


My two options:

* opt1: mnesia
* opt2: raw file


I'm almost certainly convinced that opt2 = correct option. However, I
want the opinions of those more qualified than me to see if I have
missed anything / if any part of my thinking is not clear.

Thanks!



More information about the erlang-questions mailing list