Live data from Hacker News

Redis is fast – I'll cache in Postgres

dizzy.zone

251–260 of 311 posts

Re: Redis is fast – I'll cache in Postgres

#251
Postgres needs to be tuned for the workflow and the hardware.

It's a travesty to run it on default settings.

All it takes is 5 mins to do it.

Use pgtune - https://pgtune.leopard.in.ua/

I know the author concludes that he would still use Postgres for his projects.

But, he would get much better benchmark numbers if it was tuned.

Re: Redis is fast – I'll cache in Postgres

#252
post #242

Earlier quoted context omitted.

I agree that people like to hire profesionals. That is why I hire db experts to work on our infra, not prompt engenieers. Saying that anybody can learn to unblock a sink by watching youtube is your tipical HN mentality of stating opinons as facts.

you can become a db expert with the right prompts

You can learn how to pour a drink in 1 minute, that is why most bartenders earn minimum wage.

You can't become a db expert with a promt.

I hope you make a lot of money with your lies and good luck.

Re: Redis is fast – I'll cache in Postgres

#253
post #242
post #238

Earlier quoted context omitted.

Anyone can learn to unblock a sink by watching YouTube videos these days, and yet most people still hire a professional to do it for them. I don't think end users want to "optimize their PostgreSQL servers" even if they DID know that's a thing they can do. They want to hire experts who know how to make "that tech stuff" work.

I agree that people like to hire profesionals. That is why I hire db experts to work on our infra, not prompt engenieers. Saying that anybody can learn to unblock a sink by watching youtube is your tipical HN mentality of stating opinons as facts.

"Saying that anybody can learn to unblock a sink by watching youtube is your tipical HN mentality of stating opinons as facts."

I don't understand what you mean. Are you saying that it's not true that anyone could learn to unblock a sink by watching YouTube videos?

Re: Redis is fast – I'll cache in Postgres

#254
post #242
post #238

Earlier quoted context omitted.

Anyone can learn to unblock a sink by watching YouTube videos these days, and yet most people still hire a professional to do it for them. I don't think end users want to "optimize their PostgreSQL servers" even if they DID know that's a thing they can do. They want to hire experts who know how to make "that tech stuff" work.

I agree that people like to hire profesionals. That is why I hire db experts to work on our infra, not prompt engenieers. Saying that anybody can learn to unblock a sink by watching youtube is your tipical HN mentality of stating opinons as facts.

Personally I'd like to hire a DB expert who also knows how to drive an agentic coding system to help them accelerate their work. AI tools, used correctly, act as an amplifier of existing knowledge and experience.

Re: Redis is fast – I'll cache in Postgres

#255
post #225

Earlier quoted context omitted.

That's the reader's fault then. I see the blog post as the counter to the insane resume-building over-engineered architecture you see at a lot of non-tech companies. Oh, you need a cache for our 25-user internal web application? Let's put an front a redis cluster with elastisearch using an LLM to publish cache invalidation with Kafka.

There's also a sort of anti-everything attitude that gets boring and lazy. Redis is about the simplest thing possible to deploy. This wasn't about "a redis cluster with elastisearch using an LLM" it was just Redis. I sometimes read this stuff like people explaining how they replaced their spoon and fork with a spork and measured only a 50% decrease in food eating performance. And have you heard of the people with a $…

There is this cv-driven-development when you have to use Redis, Kafka, Mongo, Rabbit, Docker, AWS, job schelduers, Microservices, and so on.

The less dependencies my project has the better. If it is not needed why use it?

Re: Redis is fast – I'll cache in Postgres

#256

> Both postgres and redis are used with the out of the box settings Ugh. I know this gives the illusion of fairness, but it's not how any self-respecting software engineer should approach benchmarks. You have hardware. Perhaps you have virtualized hardware. You tune to the hardware. There simply isn't another way, if you want to be taken seriously. Some will say that in a container-orchestrated environment, tuning go…

> for only about five minutes of LLM query or web search I think I have more trust in the PG defaults that in the output of a LLM or copy pasting some configuration I might not really understand ...

Then either have the LLM explain the config, or go Google it. LLM output is a starting point, not your final config.

Re: Redis is fast – I'll cache in Postgres

#257
post #225

Earlier quoted context omitted.

That's the reader's fault then. I see the blog post as the counter to the insane resume-building over-engineered architecture you see at a lot of non-tech companies. Oh, you need a cache for our 25-user internal web application? Let's put an front a redis cluster with elastisearch using an LLM to publish cache invalidation with Kafka.

There's also a sort of anti-everything attitude that gets boring and lazy. Redis is about the simplest thing possible to deploy. This wasn't about "a redis cluster with elastisearch using an LLM" it was just Redis. I sometimes read this stuff like people explaining how they replaced their spoon and fork with a spork and measured only a 50% decrease in food eating performance. And have you heard of the people with a $…

Software development has such a pro-complexity culture that, I think, we need more anti-stuff or pushback.

Re: Redis is fast – I'll cache in Postgres

#258
post #129

Earlier quoted context omitted.

I disagree. They found that Postgres, without tuning, was easily fast enough on low level hardware and would come with the benefit of not deploying another service. Additionally tuning it isn’t really relevant. If the defaults are fine for a use case then unless I want to tune it for personal interest it’s either a poor use of my fun time or a poor use of my clients funds.

The default shared memory is 128MiB, not even 1% of typical machines today. A benchmark run with these settings is effectively crippling your hardware by making sure 99% of your available memory is ignored by postgres. It's an invalid benchmark, unless redis is similarly crippled.

> If the defaults are fine for a use case then unless I want to tune it for personal interest it’s either a poor use of my fun time or a poor use of my clients funds.

It doesn't matter if you've crippled the benchmark if the performance of both options still exceeds your expectations. Not all of us are trying eek out every drop of performance

And, well, if you are then you can ignore the entire post because Redis offers better perf than postgres and you'd use that. It's that simple.

Re: Redis is fast – I'll cache in Postgres

#259

> Both postgres and redis are used with the out of the box settings Ugh. I know this gives the illusion of fairness, but it's not how any self-respecting software engineer should approach benchmarks. You have hardware. Perhaps you have virtualized hardware. You tune to the hardware. There simply isn't another way, if you want to be taken seriously. Some will say that in a container-orchestrated environment, tuning go…

Isn't tuning before hitting constraints a premature optimisation? The approach of not spending time on tuning settings before you have to seems sane.

And TFA shows you that in this world Postgres is close enough to Redis.

Re: Redis is fast – I'll cache in Postgres

#260
I get the argument for using Postgres, but it's mostly about the convenience of the tool, specific constraints, and the bottlenecks it solves, especially with TTL and a cache interface already implemented.

And dealing with unlogged table contents are not crash-safe.

I believe Redis would have performed better with more allocated CPU.

Post reply on HN