3 ms·
why both? isn't that wasteful? which one wins if they disagree? do you sync both at the same frequency?
by swyx 6y ago
why both? isn't that wasteful? which one wins if they disagree? do you sync both at the same frequency?
- eloff 6y agoIt depends on the business logic. If e.g. a user updates a numeric value on an entity, and there's a conflict probably you choose the most recent value. The action taken (user updates value) is pretty useless in this case. In other cases, e.g. inventory reduced by X because X units purchased/consumed - then it's more important to have the action itself, and a conflict would involve applying both actions and possibly alerting someone if that causes the value to be invalid (e.g. inventory below 0.)