Subject RE: [firebird-support] Sticky replication issue
Author Alan McDonald
> I'm planning to add n-way replication abilities to my application. My
> question is about conflict resolution, where two different
> locations modify
> the same record.
> I was reading IBReplicator's description of this type of conflict
> resolution, saying that you can have it Priority-Based (you set the
> different locations' priorities, and whichever one has the higher
> priority
> "wins"), timestamp-based (either the earliest or the latest timestamp
> "wins"). The other option is master-slave, which isn't n-way replication.
> Here's the issue: Our CUSTOMERS table has a field that tracks "points"
> earned by a customer for their purchases (a customer incentive
> program). This is a single field in the CUSTOMERS table, that's simply a
> running total. Let's say at the start of the day, a customer has 25
> points, which is reflected correctly at all locations. The
> customer earns
> 5 points at location A. It's database now shows that the customer has 30
> points (25+5=30). The customer then drives across town to location B and
> earns 10 points, so it's database now shows 35 points (25+10=35). Now,
> it's the end of the day, and it's time to do the replication. What we
> REALLY want is for both databases to show 40 points (25+5+10=40).
> I don't
> see how either priority-based or timestamp-based conflict
> resolution could
> possibly make this happen, because the number 40 was never written to
> EITHER database.
> How could this be accomplished?
> -Joe
by not having a running total field but instead, have a points transaction
field which can be added to and deducted from at any location. The current
points available to the customer is always the sum of the transactions
(both -tive and +tive).