[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Question about drb and databases

Ben Johnson

9/21/2006 4:54:00 PM

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.

--
Posted via http://www.ruby-....

4 Answers

Paul Lutus

9/21/2006 5:06:00 PM

0

Ben Johnson wrote:

> 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?

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.

--
Paul Lutus
http://www.ara...

Ben Johnson

9/21/2006 5:26:00 PM

0

Paul Lutus wrote:
> Ben Johnson wrote:
>
>> 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?
>
> 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.

--
Posted via http://www.ruby-....

Ezra Zygmuntowicz

9/21/2006 6:44:00 PM

0


On Sep 21, 2006, at 10:25 AM, Ben Johnson wrote:

> Paul Lutus wrote:
>> Ben Johnson wrote:
>>
>>> 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?
>>
>> 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.
>
> --
> Posted via http://www.ruby-....
>

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

Fredxx

2/11/2013 3:33:00 PM

0

On 11/02/2013 13:42, Andy Wainwright wrote:
>
> The present situation is extremely unfair on disabled people who want
> to work. Someone may be capable of physically doing a job, but may
> well need three months or so off a year with health issues, often
> without notice.

Interesting, I know of MS sufferers who are quite fit for 90% of the
time with occasional relapses. In the mean time they get disability
benefit and a free car.