<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I always planned reliability for Mnesia as hot/cold<div class=""><br class=""></div><div class="">A shared resilient network storage fabric underneath both a running Mnesia instance and a non-running one.</div><div class=""><br class=""></div><div class="">Failover would then be losing a server and bringing up the other one. Obviously this can be expensive with large tables that need to be loaded fully into memory, etc, etc…</div><div class=""><br class=""></div><div class="">Gordon</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 14 Oct 2015, at 09:46, Richard Carlsson <<a href="mailto:carlsson.richard@gmail.com" class="">carlsson.richard@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">The simple view of Mnesia is that it's a transaction layer on top of ETS tables, with some varying forms of backing storage. Transactions are pessimistic, based on locking. Some small optimizations have been done to the locking mechanism in recent years, but it's maybe more could be done in that area. It might also be possible to add built-in support for optimistic transactions based on timestamps or compare-and-swap, for certain usage patterns. The semantics of dirty reads/writes need to be better documented, and if possible cleaned up a bit, because the behaviour can depend on table type and whether or not the tables are local or remote. The table size problems can probably be considered to be solved by mnesia_ext with leveldb or other backends. None of this will make it less of a 90's database though. Adding eventual consistency (e.g. based on vector clocks) as alternative to transactions would make it more modern.<br class=""><br class="">The big thing that would help, as Gordon mentioned, is a new distribution/replication layer. The existing one basically assumes that tables are not huge and the network between nodes is fast and reliable with netsplits being rare, like in a small cluster in a telecom base station. We use Mnesia, but not in distributed mode - we have a custom distribution layer (stable, but very limited) on top of local Mnesia instances that are not directly aware of each other.<br class=""></div><div class=""><br class=""></div><div class=""> /Richard<br class=""><br class=""></div></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature"><br class=""> /Richard</div></div>
<br class=""><div class="gmail_quote">On Wed, Oct 14, 2015 at 9:25 AM, Gordon Guthrie <span dir="ltr" class=""><<a href="mailto:gguthrie@basho.com" target="_blank" class="">gguthrie@basho.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Mnesia is also a pain when it partitions - you have to write your own reconciliation programmes.<div class=""><br class=""></div><div class="">There has been a lot of work done on eventual consistency in *the other* Erlang database - Riak (disclaimer I am working at Basho now)</div><div class=""><br class=""></div><div class="">Riak implements eventual consistency - and post-partition self-healing using Consistent Replicated Data Types (or CRDTs) and the canonical set of standalone CRDT libraries is written in Erlang:</div><div class=""><a href="https://github.com/basho/riak_dt" target="_blank" class="">https://github.com/basho/riak_dt</a></div><div class=""><br class=""></div><div class="">There is a comprehensive reading list here:</div><div class=""><a href="https://christophermeiklejohn.com/crdt/2014/07/22/readings-in-crdts.html" target="_blank" class="">https://christophermeiklejohn.com/crdt/2014/07/22/readings-in-crdts.html</a></div><div class=""><br class=""></div><div class="">The combination of using Klarna’s (forthcoming) leveldb backend and a CRDT eventual consistency layer on top would be an interesting start offering a distributed transactional database with eventual consistency</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">Gordon</div></font></span><div class=""><div class="h5"><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 14 Oct 2015, at 02:16, Richard A. O'Keefe <<a href="mailto:ok@cs.otago.ac.nz" target="_blank" class="">ok@cs.otago.ac.nz</a>> wrote:</div><br class=""><div class=""><div class=""><br class="">On 14/10/2015, at 6:46 am, <<a href="mailto:lloyd@writersglen.com" target="_blank" class="">lloyd@writersglen.com</a>> <<a href="mailto:lloyd@writersglen.com" target="_blank" class="">lloyd@writersglen.com</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">I asked Fred what it would it take to upgrade Mnesia for the 21st century (or, at least, for the next decade). He didn't know.<br class=""></blockquote><br class="">There's one thing that strikes me.<br class=""><br class="">I could go to a shop today and buy a 1 TB external drive for<br class="">NZD 75, including Goods and Services Tax of 15%. (At least<br class="">that's what the ad I saw a couple of days ago said.)<br class="">That's almost exactly USD 50. This is a drive that fits in<br class="">a shirt pocket, with room left over for all sorts of junk.<br class=""><br class="">To make Mnesia a data base for the 2010s, it has to be able to<br class="">handle at least 1TB of data. Heck, I've got enough goodies-for-<br class="">research money left that I could get the department to buy me<br class="">ten of these gadgets, so let's say Mnesia<br class=""> - should be able to handle a single table in the low TB<br class=""> - should be able to handle a collection of tables in the<br class=""> tens of TB<br class=""> - where "handle" includes creating, populating, checking,<br class=""> recovering, and accessing in "a reasonable time".<br class=""><br class="">That's a "single machine data base for the 2010s".<br class="">Of course there are multicore, cluster, and network issues as<br class="">well.<br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">erlang-questions mailing list<br class=""><a href="mailto:erlang-questions@erlang.org" target="_blank" class="">erlang-questions@erlang.org</a><br class=""><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank" class="">http://erlang.org/mailman/listinfo/erlang-questions</a><br class=""></div></div></blockquote></div><br class=""></div></div></div></div><br class="">_______________________________________________<br class="">
erlang-questions mailing list<br class="">
<a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank" class="">http://erlang.org/mailman/listinfo/erlang-questions</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>