Learn about warm standby applications for a primary database.
In this example, a single Replication Server manages both the primary and replicate databases. In other instances, different Replication Servers may manage the primary and replicate databases.
The numbers in the figure indicate the flow of transactions from client applications through the replication system in a warm standby application for a primary database.
Clients execute transactions in the active primary data server.
The active primary data server updates the active primary database.
The Replication Agent for the active primary database reads transactions for replicated data in the database log. It forwards the transactions to the Replication Server, which writes them into an inbound queue.
All transactions for replicated data, including those executed by the maintenance user, are sent to the Replication Server for application in the standby database.
The Distributor thread reads transactions from the inbound queue.
The Distributor thread processes transactions against subscriptions and writes replicated transactions into an outbound queue.
Transactions executed by the maintenance user, which are always replicated into the standby database (because you set the send_warm_standby_xacts parameter when you configure RepAgent with sp_config_rep_agent), are not replicated to replicate databases unless you also set the send_maint_xacts_to_replicate parameter for RepAgent.
A DSI thread reads transactions from the outbound queue.
The DSI thread executes the transactions in the replicate data server.
The replicate data server updates the replicate database.
If the transactions are to be replicated to a database managed by a different Replication Server, they are written into an RSI outbound queue managed by an RSI thread instead of a DSI thread. The RSI thread delivers the transactions to the other Replication Server.
The inbound queue is read by the standby DSI and the Distributor. The two threads do their work concurrently. Messages cannot be truncated from the inbound queue until both threads have read them and delivered them to their destination. The messages remain in the queue until the DSI has applied them to the standby database and, if there are subscriptions or replicated stored procedure executions, the Distributor has written them to the outbound queue.
Depending on your replication system, the transactions may be replicated into the standby database before the replicate database. However, Replication Server guarantees that the standby primary database and replicate databases will be kept in sync with the active primary database.