Menu

1,250,964 audit rows that record nothing happening, 418 MB of a 0.5 GB quota, and the table I was sure was the problem
📰

1,250,964 audit rows that record nothing happening, 418 MB of a 0.5 GB quota, and the table I was sure was the problem

DEV Community: postgres·Daniel Pertu·about 15 hours ago
#XbyIvwyc
#devtopostgresql#devto#dev#table#rows
Reading 0:00
15s threshold

Munchable's database lives on a hosted Free plan with a 0.5 GB quota. That is a constraint I chose, and it has been one of the more educational parts of the project, because a quota turns storage into a thing you have to design rather than a thing you have.

It has been exceeded twice. The two incidents taught completely different lessons, and the second one is the one I would want somebody else to read before they ship an audit table.

The first time was boring

A large table was large. The fix was to decide how much of it the product actually needed, cut it to that, and move on. Dull, and the kind of problem that announces itself: you look at the biggest table, it is the biggest table, done.

The important thing it left behind was a habit of checking sizes at all, which is what made the second incident survivable.

The second time, the big table was innocent

Sixteen days later, the quota alert fired again. The dashboard said 720 MB. pg_database_size said 674 MB.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.