Hacker News new | ask | show | jobs
by vbezhenar 839 days ago
Because Redis is almost infinitely scalable while Postgres is not. You have limited vertical scalability budget for your database. The more things you put into your database, the more budget you spending on things that could be done elsewhere.

Sometimes it makes sense, when your workload is not going to hit the limits of your available hardware.

But generally you should be prepared to move everything you can out of the database, so database will not spend any CPU on things that could be computed on another computer. And cache is one of those things. If you can avoid hitting database, by hitting another server, it's a great thing to do.

Of course you should not prematurely optimize. Start simple, hit your database limits, then introduce cache.