Pierre-Olivier Goulet
Pierre-Olivier Goulet

Reputation: 988

Updating two different database at the same time

Let's say I have two Databases like so :

DatabaseA

create table Table1 ( field1 int, field2 int, field3 int )

DatabaseB

create table Table1 ( field1 int, field2 int )

Our old application uses B and must continue to do so. We are developing a new application that is going to use A. What is the best way to make sure all changes in A:Table1 are replicated in B:Table1 ?


Here are a few things to consider:


Here are the options I have considered :


What are your toughs on this ?
Did I miss another option ?
Have you ever done something similar ?
Is there a software (free or not) that might do the job ?

As always, thank you all for your time and your input.

Upvotes: 2

Views: 3705

Answers (2)

Ben Thul
Ben Thul

Reputation: 32737

What do you think about transactional replication? You have the ability to replicate only certain columns and can write custom stored procedures to do the inserts, updates, and deletes. It's asynchronous too, so your new application shouldn't be bogged down by it.

Upvotes: 0

Yuck
Yuck

Reputation: 50855

You have lots of options here...

  • You can link the servers and have the updates applied together in a transaction. This is if the databases are not on the same server.
  • You could use Service Broker to provide guaranteed asynchronous updates to the other server.
  • Log shipping will also allow the other server to receive updates in a near real-time fashion.

In the end you'd need to read up more on each and decide which best fits your needs. It's going to be a trade-off between reliability and performance.

From the information in your question alone it sounds like Service Broker is going to be the best fit. You can still use triggers to invoke the broker, which then responds asynchronously.

Upvotes: 2

Related Questions