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

Motiejus Jakštys desired.mta@REDACTED
Sun May 10 01:37:07 CEST 2015


On Sat, May 9, 2015 at 2:35 PM, Peter Johansson <flexchap@REDACTED> wrote:
> Hi to all fellow Erlang-users out there !
>
> I'm working with a web-application prototype, powered by Erlang, at the
> current time .....
> and is for the moment preoccupied with the choose of a suitable
> implementation regarding in-memory storage of shared/"top-level"
> configuration-data terms.

This is a great question! However, the answer might be not what you
really expect.

The usual approach suggested by Erlang community is:
1. Build the simplest thing possible. It be sufficient for you in 95%
of the cases. Most likely, your bottle-neck will be somewhere else,
...
2. ... unless you figure out it's not by measuring it. Measure.
3. After (1) and (2) you know your bottle-neck, and have a much better
idea how performance can be improved. Also, when you have the
measurements and the infrastructure, it's much easier to just try
multiple approaches and pick the fastest one.

For me the simplest solution for your problem is to keep the
configuration where it belongs: the application environment (retrieve
with application:get_env/3).

-- 
Motiejus Jakštys



More information about the erlang-questions mailing list