I’m making a Django app using a postgresql database for a family who need to coordinate their grocery purchases.
Say one person has on their mobile device a full list of the groceries and is in the supermarket, buying and ticking each item off the list.
His partner decides to stop at another shop and begins buying the items on the same list.
How would you approach ensuring that they don’t buy double or, more importantly, that they don’t end up messing up the data entirely?
A simple first-come, first-served lock, giving the second user only read-only rights? Or is there a more flexible way?
And if the best way is a lock, how much does postgresql do for you?