4 ms·
To the same table? To the same row? Say you're an ecomm, how do you update inventory on an item "concurrently"? If you're going to say "locks" or "atomic commi
by dorfsmay 7y ago
To the same table? To the same row?
Say you're an ecomm, how do you update inventory on an item "concurrently"? If you're going to say "locks" or "atomic commit", that's exactly what I mean by "you have to serialize your writes".
- mcguire 7y agoHow much contention are you expecting?
- dorfsmay 7y agoThis is a business prediction/problem and exactly what defines your bottleneck.
- hultner 7y agoJust thinking out loud here but the particular case of inventory of an item should be possible to decrement/increment using a PN-Counter CRDT as long as you are fine with eventual consistency. Of course there's a risk of overcommitment which has to be considered but such risks usually exists in commerce any way due to or factors.
- dorfsmay 7y agoYes, eventual consistency, which is exactly the alternative I mention in my original post. If you can tolerate eventual consistencies (most problem can), than the database is no longer the slower piece.