Change of role between Primary and Secondary Database

  • We need to have a database in two SQL Servers one at Mumbai and another at Houston and both the database should be in sync.

    In the morning the Mumbai DB will be primary and Houston will be secondary (read-only) so that users at Mumbai will connect to the primary.

    In the evening the Mumbai DB will be secondary (read-only) and Houston DB will be Primary so that Houston users will connect to the primary.

    So that at any time only one database will be available for any DML operation to avoid any conflict and user access to the DB for respective location will be fast.

    Which HA solution can be considered for this scenario.

  • You may want to look at replication solutions, but you are still going to have to identify a way to identify and resolve potential conflicts. Take a look at merge replication, transactional replication with subscriber updates and peer-to-peer replication.

    Joie Andrew
    "Since 1982"

  • Thanks Joie, I had tried peer-to-peer replication but here all the nodes are available for read-write and conflict resolution is based on peer id.

    Merger replication will add an id field in all the tables, since its an application database so cannot take the risk of it (future application/db updates may delete the id field, guessing).

    In any way can we change the roles of a database to primary-to-seconday and secondary-to-primary based on time (secondary will be read-only) so that no management or monitoring will be needed for conflict resolution.

  • Then you are looking at either database mirroring, log shipping or a 3rd party app that can do what you need. If your storage sub-system can handle the replication you may be able to have a geo-cluster that can do what you need.

    In all of these scenarios though you will need to have an accepted outage everytime you need to fail the primary over to the secondary and vise-versa.

    Joie Andrew
    "Since 1982"

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply