Question about drb and databases

B

Ben Johnson

Let's say I have 2 servers. One has the database, the other doesn't. The
main application is being ran on the one with the database. If I was to
distribute ruby using DRb to the other server does that process need a
different kind of database connection? Basically what I'm asking is do I
need to connect to the database using localhost or the IP? Because wont
the database calls go over the wire like all of the other calls
therefore a localhost connection should work, right?

Thanks for your help.
 
B

Ben Johnson

Paul said:
No -- unless I am not understanding you. But if both machines are on the
same intranet, the IP approach (using an intranet IP) should be fairly
swift.

Strictly speaking, 'localhost' refers to a particular machine's
self-identity, not to an intranet machine's identity.

Right, but if I distribute ruby onto a completely different machine the
ruby files do not have to be present over there do they? Does it cache
them on the other server or do everything over the wire?

I'm doing a ruby on rails project here. So, if it does everything over
the wire, wouldn't it do the db calls over the wire as well since the db
calls run through the ActiveRecord files?

Thanks for your help.
 
E

Ezra Zygmuntowicz

Right, but if I distribute ruby onto a completely different machine
the
ruby files do not have to be present over there do they? Does it cache
them on the other server or do everything over the wire?

I'm doing a ruby on rails project here. So, if it does everything over
the wire, wouldn't it do the db calls over the wire as well since
the db
calls run through the ActiveRecord files?

Thanks for your help.

Hey Ben-

You are going to need to use an IP connection for the drb server on
the machine without the database. If you want it to be able to run
queries and work with your models it needs a db connection. Unless
the only way you access your models is over drb and the models
include DRbUndumped on the machine with the database. But I think
that for what you are trying to do, you will need to have the drb
server on the machine with no database, use an IP address as its host
in the database.yml file.

-Ezra
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top