D
D
donlino2014-05-11 13:25:48
Erlang
donlino, 2014-05-11 13:25:48

How to use Mnesia in Cowboy app?

Actually the following interests:
1. In what folder the basis has to be stored?
2. Starting the database when the application starts and stopping when the application stops?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
afiskon, 2014-05-11
@donlino

erlang.org/doc/man/mnesia.html
1. The path to the database is specified either through command line arguments (-mnesia dir) or in the application settings (mnesia_dir). Strictly speaking, you, the developer, do not need to think about where the end user of your software will put the base, he will figure it out himself
2. Erlang itself will take care of launching applications in the correct order, you just write the dependencies correctly. In fact, cowboy and mnesia can run at the same time, as long as your application runs after them. And similarly with the end.
I want to remind you that a single Mnesia table can store no more than 4 GB of data. Also, you VERY need to be able to cook it so that queues do not accumulate, for example, and so on. I'm 99.9% sure that you don't really need Mnesia.

M
Maxim Sokhatsky, 2014-06-26
@5HT

Erlang Abstract Database synrc.github.io/kvs
For storing chains in Key-Value storages: Mnesia, Riak, KAI, SQL.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question