Re: Oracle vs Informix comparison
Posted in 1996
You wrote: > >In article <589udr$mgk@svna0001.clipper.ssb.com>, Stephen A Tahmosh ><tahmossx@itd.ssb.com> writes >>Why is replication off of the logs automatically better than that provided via >>stored procedures and triggers? >>All data (almost) is logged - not all data is replicated (usually). >>Triggers/Stored Procedures can be defined only on objects which need >>replication. >> > > With stored procedures replication happens as follows. > > Application updates one table. > Triggers fires > Procedure fires > Procdures sends update to remote site > Remote site performs update > Remote site replys update ok. > ... > Application commits. > Commit send to remote site (2 phase commit protocal followed). > > Application continues. You are describing a synchronous replication scenario wherein the updating transaction waits for the replication to be completed before the commit occurs. In Oracle7 (which uses triggers/stored procedures and deferred transaction queues) to handle replication, the simpler update-anywhere environment works as follows ( for asynchronous replication) Application inserts a row into a table at the master site; The AfterInsert trigger fires which updates a snapshot log with the ROWID of the newly inserted row; Application commits the insert transaction; From the replication site, at pre-defined intervals or on demand, the changes from the master site (since the last refresh) are pulled in through background processes . (Recognize that 2PC is required for this replication txn - to update the remote site and at the master site to mark the records as having been replicated ) > > > I.e. 6 steps per table update (including 2 x network messages). > several steps for the commit (2phase commit). > + transaction logging. > > With logical log replication the 6 steps per update do not happen > and neither does to two phase commit. Instead the transaction logging > is sent across the network. This can contain the whole transaction > in less network messages (since >1 update can be put in one message). > Also the application can update and data replication replicate but > they do not have to happen in sync. Only when a commit/checkpoint > occurs do they have to sync. > > Incorrect; Asynchronous replication implies that the sites would be out of sync for some time (basically your refresh interval). Checkpoint should have nothing to do with replication (sync or async) Raj