Atomic State Mutation

Make a logical operation that spans several writes to persistent state land all-or-nothing, isolated from concurrent writers, with dependents cleaned up in the same transaction. Use this whenever one conceptual operation involves multiple writes — insert-then-delete, merge, consolidate, migrate, move-across-tables, write-plus-cascade — and a crash or a concurrent writer between steps would leave the store inconsistent; and whenever you hit "database is locked", duplicated rows after a merge, or dangling references after a delete. Push to use this whenever you see more than one write that must all succeed together, even if the code currently commits them separately.

annatchijova 5d9dad0 3 files · 9.7 KB Updated

File contents

annatchijova/SKILLS/tree/main/atomic-state-mutation commit 5d9dad0d42

Frequently asked questions

npx skillmds@latest add annatchijova/atomic-state-mutation