Concurrency6 min read
Race conditions in a Laravel app: reproduce them, then fix them
A small shop with every race a shop can have, each reproduced from a test that fires the action from ten processes at once, then fixed at the lowest layer that holds: a unique index, an atomic update, a WHERE clause, a locking read, a version column, a retried transaction. Five parts.