7 ms·
If you already have Postgres in your project and now you get the requirement for an additional cache store, I think it will be less complicated to reuse what yo
by Fannon 5y ago
If you already have Postgres in your project and now you get the requirement for an additional cache store, I think it will be less complicated to reuse what you already have instead of adding another DB to your stack.
Of course, at some point of scaling needs a dedicated cache store will make sense anyway.
(Just some justifications from a german engineer :) )
- arpa 5y agoTrue. However, since cache is usually transient, adding this key-value store/cache is as easy as "docker run redis". No need to provision block storage, and it's really lightweight in comparison. (that being said, I try really hard not to judge; after all, i'm not without fault: it's 2021 and i'm using bash over cgi-bin to serve web pages for my own hobby projects :))) )
- rualca 5y ago> True. However, since cache is usually transient, adding this key-value store/cache is as easy as "docker run redis". No need to provision block storage, and it's really lightweight in comparison. If you're using postgres for caching only, as you do Redis, then you also do not need to provision block storage. If you happen to already have Postgres running for other uses, you also do not need to provision block storage. Finally, I would add that Redis clients such as Redisson are resource hogs that cause performance problems on apps, while pg clients are barely noticeable.
- mosselman 5y agoRedis as a cache server requires different settings from redis as a job queue. So you can’t reuse the same server anyway.
- himinlomax 5y agoRedis is not a DB. Only idiots think Redis is a DB. To be fair, I've met plenty of such idiots, so if you happen to be one, you're not alone. I'm not calling people names to be mean here; I'm trying to save your lives.
- deleted 5y ago[deleted]
- cube2222 5y agoCould you explain why Redis is not a DB instead of just calling people who disagree with you idiots?
- himinlomax 5y agoIt offers no guarantees commonly afforded by databases. I have seen several instances, real life instances of people incorrectly assuming those guarantees when using Redis. So sure, if you know exactly what you're doing, you can use Redis as a database, but the reality is that it's much safer to assume you can't as a first approximation. Calling people "idiots" here is a public service. I'm sure there are non idiots who can prove me wrong, but they're the minority among production users of Redis that rely on it for non perishable data.
- kube-system 5y agoNon-ACID databases are still databases. Everyone should use the right tool for the job, and ACID is not a requirement for every job.
- squiggleblaz 5y ago> Only idiots think [x]... I'm not calling people names to be mean here; I'm trying to save your lives. If you don't mean to call people names, my advice is to not call them names. For instance, in this particular case, a perfectly intelligent person whose expertise is in another area of software development might have been misinformed. In this case, you're going to achieve your goal (saving "lives") for more effectively if you state (a) what you mean by "a DB" and (b) why it is always a worse decision to use Redis as a DB than to use some other tool for that end.
- himinlomax 5y agoI mean it in the same way you'd put a "not to be operated by morons" sticker on dangerous industrial equipment. Redis offers little to no guarantees, particularly in a cluster, and unless your data is perishable (session state, cache ...) and you now exactly what you're doing, that's less than what most users expect. I've seen it happen several times already.