[erlang-questions] Retrieving "semi-constant" data from a function versus Mnesia

Joe Armstrong erlang@REDACTED
Mon May 11 14:32:11 CEST 2015


On Sun, May 10, 2015 at 10:32 PM, Benoit Chesneau <bchesneau@REDACTED> wrote:
>
>
> On Sun, May 10, 2015 at 10:23 PM Joe Armstrong <erlang@REDACTED> wrote:
>>
>> How large is the total data?
>>
>> If it's small you could define this in a module and not use a database
>> or process at all.
>
>
> How small should it be? What if the compiled bean is about 888 kilobytes?

It depends :-)

There are many factors involved:

   a) How much memory do you have
   b) How often do you want to change the configuration data
   c) How quick do you the change to be

Assume

  a) is a smallish number of GBytes (normal these days)
  b) is "relatively rarely" (I don't know what this means - (aside - this is why
      I always ask people to provide numbers in their questions))
     Say once a day
  c) is a few seconds

Then it should be perfectly doable. Making a module containing all the
config data
and recompiling when necessary is certainly the fastest way to access the data -
this has very fast reads but very slow writes - you could think of a
module as a database
optimized for reads but not writes :-)

/Joe



>
> - benoit



More information about the erlang-questions mailing list