You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Frank Böttcher <Fr...@schiffl.de> on 2010/06/28 15:09:30 UTC

Replicate multiple Database Instances

Hi,

I have read the manual, but I am still not sure if derby could fulfill my needs.

I need to have 3 or more physical machines. Each of the machines has its own database. The database-scheme is identical for all of the machines. On every machine data is written. I need to have all data to be synchron in all 3 databases. I thought I can do the following to solve this problem.

Machine one holds db1, the derby instance has the following roles: db1(master), db2(slave), db3(slave).
Machine two holds db2, the derby instance has the following roles: db1(slave), db2(master), db3(slave).
Machine three holds db3, the derby instance has the following roles: db1(slave), db2(slave), db3(master).

1.Is it working like that?
2.How can I force the 3 database to synchronize each other on startup?

Thx in advance for any help.

Frank Boettcher



AW: Replicate multiple Database Instances

Posted by Frank Böttcher <Fr...@schiffl.de>.
Hi,

Thx for the quick reply. In this case I will do the synchronizing by my main application.

Regads,

Frank

-----Ursprüngliche Nachricht-----
Von: Dag.Wanvik@Sun.COM [mailto:Dag.Wanvik@Sun.COM] 
Gesendet: Montag, 28. Juni 2010 21:28
An: Derby Discussion
Betreff: Re: Replicate multiple Database Instances

Frank Böttcher <Fr...@schiffl.de> writes:

Hi,

each master database can only have one slave database currently.
A Derby instance *can* act as master for one database and as slave for
another database, I think.

So I guess you could set it up like in a ring:

   m1: db1(master)           db3(slave)
   m2: db1(slave) db2(master)
   m3             db2(slave) db3(master)

There is no automation currently; when a master dies, the slave needs
to be told to take over explicitly. Client code would also detect the
need to start talking to the now new master. Since replication is
asynchronous, the slave is not guaranteed to hold all committed data
on the master but should be transactionally consistent.

Hope this helps,
Dag


> Hi,
>
> I have read the manual, but I am still not sure if derby could fulfill my needs.
>
> I need to have 3 or more physical machines. Each of the machines has its own database. The database-scheme is identical for all of the machines. On every machine data is written. I need to have all data to be synchron in all 3 databases. I thought I can do the following to solve this problem.
>
> Machine one holds db1, the derby instance has the following roles: db1(master), db2(slave), db3(slave).
> Machine two holds db2, the derby instance has the following roles: db1(slave), db2(master), db3(slave).
> Machine three holds db3, the derby instance has the following roles: db1(slave), db2(slave), db3(master).
>
> 1.Is it working like that?
> 2.How can I force the 3 database to synchronize each other on startup?
>
> Thx in advance for any help.
>
> Frank Boettcher
>
>

-- 
Dag H. Wanvik, staff engineer
Sun Microsystems, Java Core and Desktop - Java DB/Derby
Haakon VII gt. 7b, N-7485 Trondheim, Norway
Tel: x43496/+47 73842196, Fax:  +47 73842101
Sun IM: dw136674, Yahoo IM: dag_h_wanvik

Re: Replicate multiple Database Instances

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
Frank Böttcher <Fr...@schiffl.de> writes:

Hi,

each master database can only have one slave database currently.
A Derby instance *can* act as master for one database and as slave for
another database, I think.

So I guess you could set it up like in a ring:

   m1: db1(master)           db3(slave)
   m2: db1(slave) db2(master)
   m3             db2(slave) db3(master)

There is no automation currently; when a master dies, the slave needs
to be told to take over explicitly. Client code would also detect the
need to start talking to the now new master. Since replication is
asynchronous, the slave is not guaranteed to hold all committed data
on the master but should be transactionally consistent.

Hope this helps,
Dag


> Hi,
>
> I have read the manual, but I am still not sure if derby could fulfill my needs.
>
> I need to have 3 or more physical machines. Each of the machines has its own database. The database-scheme is identical for all of the machines. On every machine data is written. I need to have all data to be synchron in all 3 databases. I thought I can do the following to solve this problem.
>
> Machine one holds db1, the derby instance has the following roles: db1(master), db2(slave), db3(slave).
> Machine two holds db2, the derby instance has the following roles: db1(slave), db2(master), db3(slave).
> Machine three holds db3, the derby instance has the following roles: db1(slave), db2(slave), db3(master).
>
> 1.Is it working like that?
> 2.How can I force the 3 database to synchronize each other on startup?
>
> Thx in advance for any help.
>
> Frank Boettcher
>
>

-- 
Dag H. Wanvik, staff engineer
Sun Microsystems, Java Core and Desktop - Java DB/Derby
Haakon VII gt. 7b, N-7485 Trondheim, Norway
Tel: x43496/+47 73842196, Fax:  +47 73842101
Sun IM: dw136674, Yahoo IM: dag_h_wanvik