4 ms·
"Use Postgres for caching instead of Redis with UNLOGGED tables and TEXT as a JSON data type." What the heck?! No!
by daneel_w 4y ago
"Use Postgres for caching instead of Redis with UNLOGGED tables and TEXT as a JSON data type."
What the heck?! No!
- robin_reala 4y agoMore info on why not?
- qatanah 4y agoYou offload some load like pg connections from postgres to redis. Your pg shared buffers would also be available for other stuff.
- daneel_w 4y agoIf the suggestion truly is to try squeeze as much utility as possible out of a single RDMBS setup, and if you already need and use an RDBMS, then I would consider it as an option. If not, it's an absolutely idiotic choice. And that's the problem with this article - it really comes of as a suggestion to supplant your Redis setup, a dedicated key-value store, with Postgres, a full-fledged and highly complex relational database.
- kmbfjr 4y agoBecause it is not a cache. High entropy tables require a lot of vacuuming, which adds overhead to actual database operations. While you can set autovacuum parameters per table, they still are not free . If you need something like Redis or memcache, use that for anything that is heavy on writes and deletes.