ejabberd “cloud edition alpha”
Eric Cestari - cstar - May 14, 2009Objectives
It’s an ejabberd-based proof-of-concept, with a set of custom modules aiming for making it stateless and very scalable on the storage backend.
All state data (including user accounts, roster information, persistent conference room, pubsub nodes and subscriptions) are stored in AWS webservices, S3 or SimpleDB.
It helps scaling up and down, and keeps managing costs at a proportianal cost. AWS services are very wide, and massively parallel access is what it’s all about.
Default ejabberd configuration uses mnesia, but Process One recommends switching some services like roster or auth to ODBC when load increases.
But DBMS have their own scaling problems, and that’s yet another piece of software to administrate.
CouchDB seems loads of fun, and I’d like to put some effort running ejabberd over it later on. Some work has started, but not much progress yet. (and CouchDB is still software to one needs to manage).
Current state
ejabberd_auth_sdb: store users in SimpleDB. The version in github stores password encrypted, but forces password in PLAIN over XMPP, that means that TLS is required (really !). I have a version somewhere which exchanges hashes on the wire but stores password in clear in SimpleDB. Your call.mod_roster_sdb: roster information is stored in SimpleDBmod_pubsub: nodetree data is stored in S3 along with items. Subscriptions are stored in SimpleDB. I reimplemented nodetreedefault and nodedefault, with means that PEP works fine too.mod_muc: Uses modular_muc with the S3 storage for persisting rooms.mod_last_sdb: Stores last activity in SimpleDB
Still lacking :
Following the names of the modules, where to store data, in my opinion.
mod_shared_roster: in SimpleDBmod_vcard: VCards in S3, index in SimpleDBmod_private: S3mod_privacy: S3mod_muc_log: S3 (with a specific setting for direct serving, maybe)
These modules are the only one which have state that should be persisted on disk. Mnesia is of course still be used for routing, configuration – but that’s transient data.
Transactions and latency
We loose transactions by switching away from mnesia or ODBC. That may or may not be a problem. I think it won’t be, but I don’t have data to prove one way or the other.
Latency also grows, but erlsdb and erls3, the libraries on which the modules are built, can interface with memcached (and are ketama enabled) if you use merle. Additionally using merle will keep usage costs down.
ejabberd mod_pubsub underwent several optimizations recently, and that improved performance of non-memcached AWS mod_pubsub. Initial code had latency around 10 seconds between publishing and receiving the event. Since last week’s improvement, performance is much better.
Down the road
I’d wish to see an EC2 AMI based on this code, just pass the domain name or the ejabberd.cfg file to ec2-start-instance and boom ! you have an ejabberd server up and running.
Want more horse power ? Start another one on the same domain in the same EC2 security group, the ejabberd nodes autodiscover each other and you’ve got a cluster. ec2nodefinder is designed for this use.
Combined with the very neat upcoming load-balancing and autoscaling services Amazon Web Services, there’s a great opportunity for deploying big and cheap!
Alternatives to the AWS loadbalancing would be pen, or a “native” XMPP solution.
A few things would need to be implemented for this to work well, like XMPP fast reconnect via resumption and/or C2S/S2S process migration between servers, because scaling down is as important as scaling up in the cloud.
If you want to participate, you’d be very welcome. Porting the modules I did not write, or testing and sending feedback would be … lovely.
And of course if Process One wants to integrate this code in a way or another, that would also be lovely !
Get it
Get it, clone it, fork it ! There’s bit of documentation on the README page.
[edited : added links to XEP-0198 and rfc3920bis-08, thanks to Zsombor Szabó for pointing me to them]
Categories: Blogs Eric Cestari
Comments
No comments so far, you could be the first.Add comment
Erlang on Twitter
» fedorausers (Fedora Linux Users): #linux #fedora Re: erlang-doc - dubious dependencies http://dlvr.it/4cWnw
» bestform (bestform): @danielefrijia lisp und erlang habe ich beides schon beruflich eingesetzt.
» bestform (bestform): Es gibt übrigens durchaus Antworten, die ich akzeptieren würde. Lisp, Erlang, Clojure, von mir aus auch Scala. Na? Wie sieht’s aus? :)
» charpi (Nicolas Charpentier): RT @pavlobaron: Even if #erlang hasn’t been mentioned in the latest #thoughtworks report, it won’t keep us from building real cool things with it
» chrisumbel (chris umbel): the functional work i’ve done in the last 18 months (erlang & clojure) have clearly changed how i write Java & .Net code 4 the good
» grzegorzkazulak (Grzegorz Kazulak): @strzalekk erlang? nice :)
» aprimc (Andrej Primc): Reinventing the wheel. No agreeable template engine in Erlang.
» fedorausers (Fedora Linux Users): #linux #fedora erlang-doc - dubious dependencies http://dlvr.it/4cNwW
» opencrowd (OpenCrowd): Cloudant’s BigCouch is open-source. BigCouch is a set of Erlang/OTP applications for creating a cluster of CouchDBs http://bit.ly/bILJ8p
» Missing_Faktor (Rahul Goma Phulore): RT @pavlobaron: Even if #erlang hasn’t been mentioned in the latest #thoughtworks report, it won’t keep us from building real cool things with it
Statistics
Number of aggregated posts: 10079
Number of comments: 554
Most recent article: September 01, 2010
Latest comments
» Nissan Frontier Superchager on Erlang Doesn’t Fit The JVM: I don’t believe it is the silver bullet that fixes all the problems that required you to do your JVM tuning….Nissan Frontier Superchager
» Nissan Frontier Superchager on What to do About Erlang's Records?: The general solution is to delete all the keys that should have new values, then insert the new key/value pairs…
» videomob on Java And Threads (Jetty): Хватит спамить, накинулись