• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to synchronizing master database with slave database

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello All,

I have two databases running in two servers. i need to use java implement synchronize master-slave database.

when i insert data in master database table1(name, boolean), it should be automatic insert into slave database table1 (name, only when boolean is true).

any suggestions how should i start with this?

thanks in advance!
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

When database needs to synchronize data, it usually done through replication using the database provided tools. This will mean the primary database is the one user insert/update/retrieve data and let the database do the replicating to the secondary database in its own time frame. I'm sure this time frame can be set long or short.

when i insert data in master database table1(name, boolean), it should be automatic insert into slave database table1 (name, only when boolean is true).



Given your requirement, if replication is used, the slave database will have data that are boolean=false too. I'm no DBA maybe it can choose what data to replicate. So do check with your DBA first.

If nothing seems to work, then you would have to manually insert into both databases.
 
ls klu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks K.Tsang.

i think also use java monitore the timestamp and primary key to decide if a new record inserted.

i mean when the master db table1 boolean is false, this record will not share for slave, will not replicate to other slave databanks.



 
reply
    Bookmark Topic Watch Topic
  • New Topic