[ejabberd] ANN. Couchdb Backend

Stephan Maka stephan at spaceboyz.net
Wed Apr 8 22:10:06 MSD 2009

Christopher Zorn wrote:
> Just wanted to announce that I started a couchdb backend for ejabberd.

This is an interesting project.

I did an internship at ProcessOne in the past semester and my task was
to abstract out backend specific code from the modules. I do not want to
discourage you, but the following reasons kept me from implementing a
CouchDB backend:

* CouchDB's primary keys (_id) are picky on allowed characters, because
  you can use attachments and other features. Watch out for that.
  In particular, I was hitting attachments even when escaping the
  document id. Might have been a bug.

* Due to CouchDB's versioning, any write operation will cause the
  database to grow size-wise. In the version I experimented with this
  turned out to be quite rapidly. I advise periodic compaction

* Last, but most important, CouchDB has no transactions like Mnesia or
  any SQL database have. They're important for a reliable IM server.
  Even in case you invent your own schema, you will still have to pay
  attention to write over the exact revision of a document that you've
  read before. I eventually implemented a MVCC layer on top of
  erlang_couchdb: couch_lier[1]. I've been desperately wanting comments
  on that. :)

As I said my task was a more general approach, targeting minor
modifications to the modules themselves, ergo to reduce code duplication
while not introducing new bugs.


[1] http://github.com/astro/erlang_couchdb/tree/couch_lier

More information about the ejabberd mailing list