Both the rails book (1st Ed) and the docs on the rails site (and the
Mongrel FAQ) tell me that rails (& ActionPack /ActiveRecord) is not
threadsafe. Since I need lots of worker threads in the app I’m working
(details at the end of this mail) this poses quite a problem for me.
Is the lack of thread safety a conscious design decision (kind of
understandable for rails as such, but IMHO strange for ActiveRecord) or
just something nobody has found the time to take care of yet? Is there
any documentation on what exactly lacks thread safety? From
http://wiki.rubyonrails.org/rails/pages/HowTosWorkerThreads I got the
impression that it’s mainly a lack of connection pooling in
which (in theory) shouldn’t be too difficult to fix…
Some details on my project:
It’s a tool taking care of (in the future) most of the administrative
at http://dotsrc.org/ – setting up mirrors, handling their automatic
updates, setting up hosted projects, adding / modifying users etc.
The “down to the metal” functionality is done in a distributed daemon
instance per server, one of them a designated “master” containing stuff
like an internal cron and channeling all requests from the frontend).
frontend is basically a normal rails application.
Since both of these parts share a large part of the code (e.g. the
complete database model), I’m implementing them as “2-in-1” rails app,
i.e. same lib/, app/models, etc, but different
app/(frontend|backend)/(controller,view,helper) and different startup
scripts. Works fine so far, and allows me to make good use of rails
using it (with ActionWebService) also for the frontend <-> backend
I’m porting the app from a custom-baked framework over to rails.