Skip to content

Comment on Reflections on MongoDBparent

Comments

I don't think those need to be transactions they can be done with atomic operations

- Adding to a shopping basket is adding a row to a table which is atomic (same for deletions)

- topping up a online credit is "UPDATE credit_balance SET credit=new_value WHERE credit=expected_old_value AND user_id=this_user", which is atomic and then check the number of affected rows is 1.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.