A replicated stored procedure executed in a replicate database is called a request function. It is called a request function because it requests a change in the primary database. You can use request functions to modify primary data without connecting to the primary data server through the WAN.
When you execute a user stored procedure in a replicate database, Replication Server sends the procedure to the primary database where you created the function replication definition.
When you execute the stored procedure, Adaptive Server records the procedure execution in the transaction log so that RepAgent can pass the request to the replication system. A request function is not required to perform any work in the local database, although it may. The real work is done when the primary Replication Server receives the procedure and executes it in the primary database.
In Figure 2-6, the gray arrows show the flow of the request function delivery. The black arrows show the flow of replicated data from the primary database to the replicate database.
Figure 2-6: Modifying primary data with request function delivery
The Replication Server at the replicate site stores request functions in a queue and delivers them to the primary Replication Server as soon as possible. If the primary is not available, the remote Replication Server stores the procedure until the problem is corrected.