Re:Redis is fast – I'll cache in Postgres
by dizzyVik on Thursday September 25, 2025 @11:25PM
(#45382284)
Author here. Redis is definitely faster. I was specifically not going for absolute peak performance for either redis or postgres - that would require going down to the wire protocols. The idea was emphasize that there' a "good enough" level of performance. Once you need that sort of speed - sure, there are ways to achieve it.
Re:Redis is fast – I'll cache in Postgres
by motorest on Friday September 26, 2025 @12:25AM
(#45382624)
> The idea was emphasize that there' a "good enough" level of performance. Once you need that sort of speed - sure, there are ways to achieve it.
To this I would add that more often than not the extra cost and complexity of a memory cache does not justify shaving off a few hypothetical milliseconds from a fetch.
On top of that, some nosql offerings from popular cloud providers already have CRUD operations faster than 20ms.
Re:Redis is fast – I'll cache in Postgres
by aaronblohowiak on Thursday September 25, 2025 @11:13PM
(#45382203)
Even so 35ms+ latency for Redis reads is very very high I’d want to understand what is happening there
Re:Redis is fast – I'll cache in Postgres
by oa335 on Thursday September 25, 2025 @10:35PM
(#45381973)
Postgres also supports query pipelining - at it seems like the popular go Postgres client library pgx supports it:
https://github.com/jackc/pgx/issues/1113#event-6964024724
I'd suggest using Redis pipelining -- or better: using the excellent rueidis redis client which performs auto-pipelining. Wouldn't be surprising to see a 10x performance boost.
https://github.com/redis/rueidis