New tutorial
Joe Armstrong
joe@REDACTED
Wed Feb 5 14:58:00 CET 2003
Hello everybody,
A while back Todd Proebsting asked me how you build a simple
fault-tolerant server.
After a moment's thought I said "that's easy"
After two moments thought I said "that's difficult"
and after three moments thought I said "It's possible".
To make something fault-tolerant you need at least two machines and
you need to replicate things - if you think you can do this on one
machine stop reading now and go play with visual basic ...
I made myself a little client-server. The server is actually two
servers and and data on these two servers is replicated using shared
mnesia disk tables.
The client knows about both servers - if server one is down it tries
server two and vice versa, this is similar to DNS - the alternative is
some complicated IP-failover stuff - which is very non-portable.
Transactions between the client and (virtual) server are idempotent.
The solution I came up with is not entirely obvious (at least it
wasn't to me) but it is (hopefully) simple enough to be grokked if you
know a small amount of Erlang.
The solution and all the code are available at:
http://www.sics.se/~joe/tutorials/robust_server.html
All comments, corrections and improvements are welcomed.
/Joe
More information about the erlang-questions
mailing list