Mnesia vs others

Hi all
Ecto supports many database except Mnesia. My question is, would be a good choice to use Mnesia instead other database with Phoenix framework?



Check out this thread re other DBs - some good discussion there (tho I don’t think Mnesia is mentioned)…

1 Like

oh, Mnesia is very much different sort of database than what you would usually expect from relational database. I do not think I would use as a replacement for SQL database.

SQL is generally really good for performing queries that span across table, do reporting etc. With Mnesia you will need to do slightly more legwork, and possibly process some data in your Elixir/Erlang application.

I think good use cases are stuff like storing data that needs to be accessed throughout nodes of cluster. Possibly some core data in the system that needs to be shared/accessed in performant manner. That would be use in addition to SQL database, not instead of.

We have used Mnesia for a toy project where we store statistics that are gathered in time intervals. The choice was, however, made not as replacement to SQL database, but because it was fairly easy to integrate that with an app, and allowed us to get rid of external database dependency. If we had multiple users, accounts, etc. we would not use Mnesia.

Hope that helps a bit.