views:

76

answers:

2

I have two webservices, each service has its own database, one is master (A) and other is slave (B). If a call is made to service B, it also calls A to sync A's database.

If for some reason A is not available, B needs to bring A up to date with its data at a later time.

Any suggestion on what mechanism can be used for out of process data synchronization?

A: 

You can setup a master-master replication between 2 databases. We do this with MySQL.

ZZ Coder
A: 

It sounds like the command pattern could be useful to you - store the "missed" transactions and apply them later. You may have to do some trickery to work out which of the last few calls you made to A happened, and which didn't.

If A is updated from another source and you loose the link (rather than A going down completely), you may have a battle on your hands to resolve any conflicts. I'd recommend a Temporal Database of some sort to help manage that.

Alternatively, have you thought of using a messaging system such as MSMQ?

Dave Roberts