Distributor thread and related modules

For each primary database managed by a Replication Server, there is a distributor (DIST) thread, which in turn uses SQT to read from the inbound queue and SQM threads to write transactions to the outbound queue. Thus, for example, if there are three primary databases, then there are three inbound queues, three DIST threads, and three SQT threads.

NoteIf the only destination for transactions is a standby database, disable the DIST thread, which also disables the SQT thread. The SQM thread is present and responsible for writing to the queue.

In determining the destination of each transaction row, the DIST thread makes calls to the following modules: Subscription Resolution Engine (SRE), Transaction Delivery, and Message Delivery. All DIST threads share these modules. These modules, and the role they play in the replication system, are described in the following sections.


Subscription Resolution Engine

The Subscription Resolution Engine (SRE) matches transaction rows with subscriptions. When it finds a match, it attaches a destination-database ID to each row. It marks only rows required for subscriptions, thereby minimizing network traffic. If no subscriptions match, the DIST thread discards the row data.

For each row, the SRE determines whether subscription migration occurs.

When the SRE detects subscription migration, it determines which operation to replicate (insert, delete, or update) to maintain consistency between the replicate and primary tables.


Transaction Delivery module

The Transaction Delivery (TD) module is called by the DIST thread to package transaction rows for distribution to data servers and other Replication Servers.


Message Delivery module

The Message Delivery (MD) module is called by the DIST thread to optimize routing of transactions to data servers or other Replication Servers. The DIST thread passes the transaction row and the destination ID to the MD module. Using this information and routing information in the RSSD, the module determines where to send the transaction:

After determining how to send the transaction, the MD module places the transaction into the appropriate outbound queue.