I would advise against using Mnesia because in fact Mnesia doesn’t give the ACID guarantees it advertises in the docs, as its not durable and you can loose data with netsplits, due to unexpected failures(it has a delay to write to disk) or when you start it(my case).
Some posts:
I have been developing an app in localhost, while keeping a staging version of the app running in another folder, with mix phx.server, that I use daily.
So, each time I shutdown or restart the laptop I don’t bother to manually stop it, but today I have stopped it accidentally with ctrl + c + c, and for my surprise when I started it again all my tables were empty
This was not the first time I have used ctrl + c + c to stop it, but never had this outcome.
I am usin…
I’m observing behavior with mnesia that is unexpected by me and could use some help understanding what’s going on. I’ve tested this with erlang 21.0.1 and 21.2.2, and elixir 1.7.4.
Given two scripts:
write.exs
IO.puts "Creating schema..."
:ok = :mnesia.create_schema([node()])
IO.puts "Starting mnesia..."
:ok = :mnesia.start()
IO.puts "Creating table..."
{:atomic, :ok} = :mnesia.create_table(:example, [{:disc_only_copies, [node()]}, type: :set, attributes: [:name, :value]])
IO.puts "Setting :f…
Thanks for the link to the very informative video.
I took a bunch of notes, some may be not totally correct, missing bits or not well understood by me, but anyway I will leave them here for others to review and point me where I am not getting it
MNESIA FOR THE CAPper
The good stuff
Runs in same memory space of Erlang, thus very fast access, not matched by other databases.
Stores data as Erlang terms.
The query language is Erlang list comprehensions.
If a crash occurs and …
http://erlang.2086793.n4.nabble.com/mnesia-sync-transactions-not-fsynced-td4673313.html
I am ditching Mnesia in favor of Mnevis, aka Mnesia with the RAFT consensus:
1 Like