5 PostgreSQL Mistakes I See in Every Spring Boot App

Your ORM is lying to you a little. Here’s where. Here’s how it usually goes. Spring Boot app, Spring Data JPA, Postgres behind it. Everything is fast in dev, because dev has 200 rows. Staging is fine too. Then production hits a few million rows and suddenly the database CPU is at 90%, a deploy hangs for ten minutes, and someone in Slack asks “did anyone change anything?” Usually nobody changed anything. The problem was there from day one, it just needed data to show up. ...

October 27, 2026 · 13 min · Vitalii Sukach

Your DELETE + INSERT Is Burning PostgreSQL’s CPU. Here’s What’s Actually Happening on the Page.

A deep dive into MVCC, heap pages, vacuum, and what to do when you have billions of rows to update. The symptom You have a table that stores user state. Something happens — an event arrives — and your code does the obvious thing: BEGIN; DELETE FROM user_state WHERE user_id = $1; INSERT INTO user_state (user_id, state, score, updated_at) VALUES ($1, $2, $3, now()); COMMIT; It’s clean. It’s idempotent. It doesn’t require you to think about which columns changed. For a long time it works fine. ...

August 17, 2026 · 23 min · Vitalii Sukach