Is there a thread safe ActiveRecord replacement?

Magnus Naeslund mag at kite.se
Wed Mar 7 15:43:53 EST 2007


I'm using merb as an application server backend for a client application, the goal is to be able to handle thousands of parallell sessions (not parallell requests). It will use sendfile to send files.
The controller uses an singleton that saves sessions in a hash that is memory resident cross requests, but isn't persistent otherwise.

I'm using ActiveRecord since there is an Rails site used to administer the whole thing, and I thought it would be nice to share the models.
Since ActiveRecord is mutexed this not only scales bad (or atleast the scaling point is not where I'd like it), but if something murphy-like is happening on the database server (or in between), the whole server is hung which is "not ideal".

So: is there a (lightweight) ActiveRecord replacement that I can use instead?
I'm not sure yet if I really need the belongs_to style relational mappings yet, but I would consider that a big plus.
It doesn't need to be compatible with ActiveRecord, but I can't rename the tables or modify the table definitions since the Rails app will break.

Any ideas?

Regards,
Magnus

P.S.: I love merb so far, I only wish it existed when the original Rails site was created :)


More information about the Merb-devel mailing list