Devarshi Shimpi @devarshi.dev · Mar 10

Your schema will cost you more than your server ever will. I learned this building an internal tool. Search suggestion cache on Postgres. Clean schema, proper indexes. At 25k rows, it felt solid. Then I modeled 1M queries x 250 regions. 250 million rows.

1 likes 1 replies

?

Replies

Devarshi Shimpi · Mar 10

"javascript tutorial" stored 250 separate times. Suggestions 95% identical. Full payload duplicated every time. The fix was a JSONB collapse. One row per query, regional keys inside the JSON, fallback to "default" for identical regions.