Live data from Hacker News

Redis is fast – I'll cache in Postgres

dizzy.zone

291–300 of 311 posts

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

#291
post #280
post #261

Earlier quoted context omitted.

You can become a DB expert by reading books, forums and practicing hard. These days you can replace those books and forums with a top tier LLM, but you still need to put in the practice yourself. Even with AI assistance that's still a lot of work.

You could not replace good books with Intenert and you can't replace good books with a any LLM. You can replace books with your own time and research. Again making statements that are just not true. Typical HN behavior.

I don't appreciate how you accuse me of "making statements that are just not true" without providing a solid argument (as opposed to your own opinion) as to why what I'm saying isn't true.

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

#292
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.

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

When not hosted on AWS? Who says we have to compare dynamodb to AWS managed Redis? Redis the company has paid hosted versions. You can run it as part of your k8s cluster too.

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

#293
post #97
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.

You would need to get to insane read counts pretty much 24/7 for this to work out. For HA redis you need at least 6 instances, 2 regions * 3 AZs. And you're paying for all of that 24/7. And if you truly have 24/7 use then just 2 regions won't make sense as the latency to get to those regions from the other side of the globe easily removes any caching benefit.

> And if you truly have 24/7 use then just 2 regions won't make sense as the latency to get to those regions from the other side of the globe easily removes any caching benefit.

Tell that to Github or HN or many other sites? So caching for them doesn't make sense?

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

#294

Why do we promote articles like this that have nice graphs and are well written, when they should get a grade 'F' as an actual benchmark study. The way it is presented, a casual reader would think Postgres is 2/3rds the performance of Redis. Good god. He even admits Postgres maxxed out its 2 cores, but Redis was bottlenecked by the HTTP server. We need more of an academic, not a hacker, culture for benchmarks.

it's called blog for a reason

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

#295
post #290

Earlier quoted context omitted.

The problem is, I ask it a basic question, it confidently feeds me bullshit, I correct it twice, and only then it does an actual search.

I use GPT-5 thinking and say "use search" if I think there's any chance it will decide not to.

This is what I have in my custom instructions:

    Stay brief. Do not use emoji.
    Check primary sources, avoid speculation.
    Do not suggest next steps.
Do I have to repeat this every time I suspect the answer will be incorrect?

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

#296
post #279
post #275

Earlier quoted context omitted.

What would a "proof" of that even look like? There are thousands (probably millions) of us walking around with anecdotal personal evidence at this point.

Some years ago when everybody here gave their anecdotal evidence about how Bitcoin and Blockchain were the future and they used it every day. You were a fool if you did not jump on the bandwagon. If the personal opinions on this site were true, half of the code in the world would be functional, lisp would be one of the languages most used and Microsoft would have not bougth DropBox. I really think HN hive minds opini…

> Some years ago when everybody here gave their anecdotal evidence about how Bitcoin and Blockchain were the future and they used it every day.

I hardly remember anyone on HN, a tech audience, saying they used blockchain everyday. Why don't you go find some of that evidence?

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

#297
I completely agree with your view! I use postgres for all, as the cost of switching to the (scalable) solution for this kind of problems is low, and in the ens let’s be realistic about how “viral” your app can get…

When I worked in a bigger company in the past we used postgres to store raw blobs for data transformation pipelines (+1T table), and queries to it were instant due to good index usage. Others might have gone to BigQuery or something else making more complex and def more expensive.

PS: I love tools like Temporal, Hatchet or Oban that rely on Postgres and can scale a ton too.

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

#298
post #282
post #279

Earlier quoted context omitted.

Some years ago when everybody here gave their anecdotal evidence about how Bitcoin and Blockchain were the future and they used it every day. You were a fool if you did not jump on the bandwagon. If the personal opinions on this site were true, half of the code in the world would be functional, lisp would be one of the languages most used and Microsoft would have not bougth DropBox. I really think HN hive minds opini…

I'm going to believe my own experience on this one.

I am going to wait until Chat GPT 8 solves quantum physics like the ex ceo of this site has stated.

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

#299

Earlier quoted context omitted.

How was the LLM accessing the docs? I’m not sure what the best pattern is for this. You can put the relevant docs in your prompt, add them to a workspace/project, deploy a docs-focused MCP server, or even fine-tune a model for a specific tool or ecosystem.

> I’m not sure what the best pattern is for this. > You can put the relevant docs in your prompt I've done a lot of experimenting with these various options for how to get the LLM to reference docs. IMO it's almost always best to include in prompt where appropriate. For a UI lib that I use that's rather new, specifically there's a new version that the LLMs aren't aware of yet, I had the LLM write me a quick python sc…

Sounds like a good way of tackling this - thanks for sharing!

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

#300

Earlier quoted context omitted.

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

good point, even postgres crippled was "good enough" so it doesn't change the overall message. Nonetheless, we should strive to do realistic and valid benchmarks, no?
Post reply on HN