Live data from Hacker News

Redis is fast – I'll cache in Postgres

dizzy.zone

231–240 of 311 posts

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

#231
post #229
post #227

Earlier quoted context omitted.

Probably about 10 cents, if you're even paying for tokens. Plenty of these tools have generous free tiers or allowances included in your subscription. I run a pricing calculator here - for 50,000 input tokens, 5,000 output tokens (which I estimate would be about right for a PostgreSQL optimization loop) GPT-5 would cost 11.25 cents: https://www.llm-prices.com/#it=50000&ot=5000&ic=1.25&oc=10 I use Codex CLI with my $2…

If optimizing a Postgress SQL server cost 11.25 cents and everybody can do it because AI how much are you going to bill your customer? .20 cents? If that is true in some months there will be no dba jobs. Funny that at the same time SQL is one of the most requested languages in job postings.

Knowing what "optimizing a PostgreSQL server's configuration" even means continues to be high value technical knowledge.

Knowing how to "run an agentic loop to optimize the config file" is meaningless techno-jabber to 99.99% of the world's population.

I am entirely unconcerned for my future career prospects.

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

#233
post #87

Earlier quoted context omitted.

> All of this at a fraction of the cost of HA redis This depends on your scale. Dynamodb is pay per request and the scaling isn’t as smooth. At certain scales Redis is cheaper. Then if you don’t have high demand maybe it’s ok without HA for Redis and it can still be cheaper.

> At certain scales Redis is cheaper. Can you specify in which scenario you think Redis is cheaper than caching things in, say, dynamodb.

[deleted]

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

#234
post #231
post #229

Earlier quoted context omitted.

If optimizing a Postgress SQL server cost 11.25 cents and everybody can do it because AI how much are you going to bill your customer? .20 cents? If that is true in some months there will be no dba jobs. Funny that at the same time SQL is one of the most requested languages in job postings.

Knowing what "optimizing a PostgreSQL server's configuration" even means continues to be high value technical knowledge. Knowing how to "run an agentic loop to optimize the config file" is meaningless techno-jabber to 99.99% of the world's population. I am entirely unconcerned for my future career prospects.

So your big advantage is that nobody has lauched agentic tools for the end user yet?

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

#235
post #175

Earlier quoted context omitted.

> The use case is not representative of a real-life scenario, so the value of the presented results are minimal. Maybe I'm reading the article wrong, but it is representative of any application that uses a PosgreSQL server for data, correct? In what way is that not a real-life scenario? I've deployed Single monolith + PostgreSQL to about 8 different clients in the last 2.5 years. It's my largest source of income.

When you run a relational database, you typically do it for the joins, aggregations, subqueries, etc. So a real-life scenario would include some application actually putting some stress on postgres. If your don't mind overprovisioning your postgres, yes I guess the presented benchmarks are kind of representative. But they also don't add anything that you didn't know without reading the article.

My stance has always been stick to 1 database for as long as humanly possible because having 2 databases is 1000x harder.

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

#237
post #210

Earlier quoted context omitted.

If you are going to ask ChatGPT some specific tidbit it's better to force it to search on the web. Remember, an LLM is a JPG of all the text of the internet.

Wait, what? Isn't that the whole point, to ask it specific tidbits of information? Are we to ask it large, generic pontifications and claim success when we get large, generic pontifications back? The narrative around these things changes weekly.

I use it as a tool that understands natural language and the context of the environments in work in well enough to get by, while guiding it to use search or just facts I know if I want more one-shot accuracy. Just like I would if I were communicating with a newbie who has their own preconceived notions.

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

#238
post #234
post #231

Earlier quoted context omitted.

Knowing what "optimizing a PostgreSQL server's configuration" even means continues to be high value technical knowledge. Knowing how to "run an agentic loop to optimize the config file" is meaningless techno-jabber to 99.99% of the world's population. I am entirely unconcerned for my future career prospects.

So your big advantage is that nobody has lauched agentic tools for the end user yet?

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.

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

#239

> 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…

> This is the kind of thing that is "hard and tedious" for only about five minutes of LLM query or web search time

not even! if you don't need to go super deep with tablespace configs or advanced replication right away, pgtune will get you to a pretty good spot in the time it takes to fill out a form.

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

https://github.com/le0pard/pgtune

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

#240
Great article. Not understanding the hate.

I think the jist of it is, you probably have sufficiently low requests/second (<1000) that using postgres as a cache is totally reasonable - which it is. If your hitting your load tests and hardware spend, no need to optimise more.

Post reply on HN