Remix.run Logo
sixo 12 hours ago

If you use an UNLOGGED table in Postgres as a cache, and your DB restarts, you no longer have a cache. Then your main table gets a huge spike in traffic and likely grinds to a halt.

frollogaston 11 hours ago | parent | next [-]

Cache isn't meant to persist, and something is wrong if you hard depend on it persisting.

wielebny 11 hours ago | parent | prev | next [-]

If you need persistence on your Redis, then you're not using is as a cache. You're using it as a key-value store.

Spivak 12 hours ago | parent | prev | next [-]

Same as the folks who use in-memory Redis. Is there something uniquely bad about Postgres for this situation?

If your cache is so performance critical that you can't lose the data then it sounds like you need a (denormalized) database.

shakna 11 hours ago | parent | prev [-]

Cache is not the only solution to the thundering herd.