4 ms·
Do you have specific criticisms? There are myriad and varied different use cases for a cache. I’ve used Postgres in a pinch. It’s fine, for certain things. I’ve
by macNchz 3y ago
Do you have specific criticisms? There are myriad and varied different use cases for a cache. I’ve used Postgres in a pinch. It’s fine, for certain things. I’ve used a lot of other caches as well that would be highly inappropriate for the situations I’ve used Postgres in.
In my experience there are far more highly-overwrought bloated architectures deployed than there are overly-clever minimalist ones. Everyone wants to put the cool tools on their resume.
- lnxg33k1 3y agoSo for one we do cache to remove load from dbms, then makes a lot of sense to remove load from dbms by giving it the load of cache too, another thing might be that separate services might be optimised for different tasks, redis is built with being first class in memory cache service, postgres is built with different first-class usage in mind, another one I can think of is resources, I can scale redis and dbms independently as their specific needs change Overall for me this cache in postgres is a bad idea too
- mbreese 3y agoI see this as an issue of scale. HN loves to think about infinite scales where there are millions of simultaneous users of systems. This is rarely the case. Caching in Postgres is for smaller scale applications where the extra complexity of a dedicated memory cache isn’t worth the extra overhead. But at least you bring up some actual limits that should to be considered. DB load: part of the load on a DB is the network connection for the query, but a large part is also finding the data. If you have a complex query, storing a de-normalized form in a cache table would be a lighter load. (Provided that you aren’t limited by the network or number of concurrent connections) I think that whether or not this is a good idea depends highly upon what scale you’re operating at. For high traffic applications, it’s not a good plan, but if you already have a DB setup and you have a lighter load, I could think of worse solutions.
- lnxg33k1 3y agoI mean if you have a light application then maybe you dont even need the cache, at a certain threshold of small you can go ahead with sqlite or access, or excel, of course HN has an issue of scaling, because if we talk about caching then lets talk about situations where talking about caching makes sense,
- macNchz 3y agoCaching can make sense in more situations than "too many users running the same query at once". For basically anything slow that you'd like to make faster, you can weigh the downsides of caching against the downsides of optimizing its performance in other ways. In a startup context, often some (judicious) caching is preferable to spending a bunch of time carefully optimizing some code that's going to change or be thrown out in a month anyway.
- moltar 3y agoWhat if you are removing load from loading data from a network bound third party API which you need to cache locally?