Re: remote database ActiveRecord model

Isak Hansen
Tue, 24 Apr 2007 08:07:00 -0000

On 4/24/07, Aryk Grosz
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
>
> Does anyone know how to make a model connect to a remote database and
> only for that specific model?
>
> That way I can do the typical CRUD functions on a remote server?
>

AFAIK distributed transactions with Ruby/Rails is an unsolved problem.
If neccessary, your best bet is probably talking to a Java or .net
-based backend over a web service, or perhaps having a look at JRuby;
which can probably work with JTA.

However, if you, like most rails/php/web/mysql programmers, don''t care
about or need data integrity, connecting one of your models to a
different db is fairly simple.

Start at
<http://wiki.rubyonrails.com/rails/pages/HowtoUseMultipleDatabases>,
and/or search this groups archives for "multiple databases".


HTH,
Isak



> --
> Posted via http://www.ruby-forum.com/.
>
> >
>