Erlang in docker, what about Mnesia disc storage?

Hi,

I am considering deployment for my Erlang back-end software and need to decide on either docker or VPS.

The preliminary deployment is initially 2 public nodes, each with a cowboy entry for clients (websockets), some logic and a mnesia db with few writes and many reads.

Mnesia is planned to be mirrored for all nodes (same mnesia for all nodes) and stored both in RAM and on disc on all nodes.

One option is deploymnet in a Docker. My uncertainty lies in mnesia storage. What is effective manners to deal with it? Should it be located inside the docker or maped to an external folder?

Or would you rather have a separate backend server where disc copies reside and only run ram copies in the docer instances?

I expect to be able to update docker instances along the way, i.e. deploy a new docker with updated erlang and software that has passed V&V.

Any thought or best practices?

You can use volumes for persistent storage. In our example we first start and initialize all the nodes manually where each one has it’s own volume. That is done once and afterwards you may start and stop containers.

In Kubernetes we use an init container to automate initialization. Scaling a Stateful set is done by automating joining an existing cluster.