erlang/Mnesia adaptor for rails

I’m working on a site that will most likely be huge and could easily
be one of the largest ruby on rails sites yet. While we will be
using databases to some extent on the backend, I know that’s only
going to scale out so far, so I’ve been looking at some alternatives.
Memcache is nice and I’m sure we will use it, but we are really
looking for something more along the lines of a distributed rdbms. At
the same time I’ve been playing around with erlang and mnesia for the
first time.

It seems to me that it should be possible to write an AR adaptor that
communicates as a client to an erlang node via tcp, and have code on
the node to translate sql into mnesia database calls. While
translating sql would be a pain, supporting simple queries should be
doable without too much effort.

Anyone working on something like this, or have ideas on interfacing
rails with erlang OTP systems?

Chris

Read up on Erlang ports - that’s probably the mechanism I’d look at
first to use in interfacing Rails with Erlang.

The reason I’d look at it first is that it exists now, is fairly
straightforward to implement and works. If for some reason it’s not
going to work (and I can see that having to translate between SQL and
Mnesia calls might be one reason not to use it), then I think you’re
on the right track looking at something like a TCP socket connection.

It might also be worth reading up on the limitations around massive
Mnesia databases. Although I haven’t built anything particularly
large with Mnesia, it seems as though some people are concerned with
Mnesia’s ability to handle very large datasets and have been
discussing this on the Erlang groups recently. Taking what I’ve read
at strictly face value, I’d have concerns about it as well until I’d
done some fairly rigorous investigation of my own.

Regards

Dave M.

On Sep 8, 2007, at 6:44 PM, snacktime wrote:

It seems to me that it should be possible to write an AR adaptor that
communicates as a client to an erlang node via tcp, and have code on
the node to translate sql into mnesia database calls. While
translating sql would be a pain, supporting simple queries should be
doable without too much effort.

Anyone working on something like this, or have ideas on interfacing
rails with erlang OTP systems?

Chris

Chris-

You might want to take a look at CouchDB. It’s built on erlang but
exposes data as json objects over a REST interface with a map/reduce
javascript query language.

http://couchdb.org/

Cheers-
– Ezra Z.
– Founder & Ruby Hacker
[email protected]
– Engine Y., Serious Rails Hosting
– (866) 518-YARD (9273)