Mapping ejabberd storage into MongoDB

I need to store all data (archived messages, offline messages, roster items, etc) in MongoDB storage. There is one problem: MongoDB is document-oriented storage, so it does not provide ODBC interface.
I think there is two possible solutions of this problem:
1. Write MongoDB<->ODBC mapper for ejabberd common queries. This solution is possible because of existing MongoDB erlang drivers (actually, two of them), so it is possible to translate ODBC queries into driver-specific queries.
2. Use MongoDB erlang driver natively. While reading ejabberd_odbc.erl source file I saw some code, responsible for native mysql && postgresql support. This code is using db drivers available as external modules. There are some functions in ejabberd_odbc.erl like ***_to_odbc(), ***_item_to_odbc(), which are responsible for converting results to odbc notation. MongoDB driver returns results as list()'s.

I'm not erlang expert, i've started learning it a week ago, so i need some help. Which solution is easiest? I think, second.
And, at last, can i expect on some help in coding?

Thanks.

Are you still interested in

Are you still interested in ejabberd+MongoDB? I came up with the following solution:

https://github.com/master/mongosql
https://github.com/master/ejabberd

Basically, it's ODBC wrapper on top of MongoDB and a few patches (really a few) to ejabberd core.

Syndicate content