Re: replication via tuple streams
Date: Wed, 28 Mar 2007 22:52:01 GMT
Message-ID: <lkCOh.84937$zU1.37511_at_pd7urf1no>
Marshall wrote:
> It seems like there are two ways to implement database
> replication in a master/slave configuration: replicating
> DML or replicating insert/delete tuple streams.
>
> (I will speak of the single table case without considering
> schema changes.)
>
> We have database master and slave, and table A in each.
> In the replicate-DML case, any DML statement (insert,
> update, delete) issued to master.A is replicated to
> slave.A and applied. This sounds very tidy, in that the
> DML statement itself is likely to be quite compact.
> However there is a limitation. Consider table master.B
> that is not replicated, and a statement like:
>
> insert into A select * from B
>
> When that statement arrives at the slave, it won't
> be able to execute it because it doesn't have table B.
>
> So this approach more or less requires replication for
> the transitive closure of the set of tables you want +
> the set of tables that might get mentioned in DML.
>
> In another approach, we replicate instead the tuple
> streams. Imperative statements may cause some tuples
> to be deleted, or some to be inserted, or some to be
> deleted then some to be inserted (update.) The lack
> of table B in the above query is no difficulty, because
> the actual tuples in the subselect are transmitted,
> which is exactly what needs to be inserted to slave.A.
> ...
p Received on Thu Mar 29 2007 - 00:52:01 CEST