How I destroyed the company's DB - by Anton Zaides
I received a message from the support team, telling me one of our customers has a problem. I decided it was important enough to start debugging. After 15 minutes, I understood the issue - there were some corrupted orders created in our DB, and we needed to delete them. Sounds trivial, right? At the end of the article I share my lessons, and how you can apply them to your own team. And welcome to the 600+ new subscribers since last week! For those of you not working in startups - please don’t judge 😅 There were a few hundred orders to delete, so I decided to not do it manually but to write a short SQL query (red flag 🚩) It was a bit more complex than that, but to simplify: UPDATE orders SET is_deleted = true WHERE id in (1, 2, 3) You can already see the scale of the disaster… I pressed CTRL+Enter and ran the command. When it took longer than a second, I understood what happened. The program I used (DBeaver) saw the empty 3rd line, and ignored the 4th line. Yes, I deleted all the orde
It was on a quiet Saturday. I received a message from the support team, telling me one of our customers has a problem. I decided it was important enough to start debugging. After 15 minutes, I understood the issue - there were some corrupted orders created in our DB, and we needed to delete them. Sounds trivial, right? At the end of the article I share my lessons, and how you can apply them to your own team. And welcome to the 600+ new subscribers since last week! For those of you not working in startups - please don’t judge 😅 There were a few hundred orders to delete, so I decided to…
related reading
- A Bunch of Programming Advice I'd Give To Myself 15 Years Ago | Marcus' Blogmbuffett.com
- Reflections on a decade of codingscattered-thoughts.net
- How we tracked down a 16-year-old SQLite bugtailscale.com
- The only scalable delete in Postgres is DROP TABLE — PlanetScaleplanetscale.com
- Databases are Fucking Stupid | Probably Danceprobablydance.com
- The startup's Postgres survival guidehatchet.run
- Hōrōshi バガボンド (@KatanaLarp) on Xx.com
- A More Human Approach To Databasesccorcos.github.io
- Against SQLscattered-thoughts.net
- The Joel Test: 12 Steps to Better Code – Joel on Softwarejoelonsoftware.com
- The unwritten laws of software engineeringnewsletter.manager.dev
- Databases in 2024: A Year in Review // Blog // Andy Pavlo - Carnegie Mellon Universitycs.cmu.edu