Answer the question
In order to leave comments, you need to log in
Where to store the cache in a SaaS application?
I am developing a SaaS application in Symfony2. The system is simple: a balancer, several application servers, and several database servers.
Each application server has a complete copy of the application, the differences are only in the parameters.
There are several questions:
app/сache
? Separately for each client app/сache/clientN
?Answer the question
In order to leave comments, you need to log in
Client cache
Generally depends on the balancer, the general rule is to cache as close as possible to the service that uses it.
THOSE. if you have an application server on the principle of one client one server, then it makes sense to raise cache services to each server in its own way (it is not necessary to start a machine for this), this will give you horizontal scaling.
HTTP cache - is it necessary? and again it depends on the applications and the number of hits, if there is a lot of static the same for everyone and it’s hard to give it away - stick it between the balancer (it’s hard to give it away, let the cache balance too) and the service (and it will fill
the cache ) for the service and how it works, maybe not needed at all, maybe the HTTP cache is enough.
Store the database cache in the database (KO in action)
In general, first I recommend profiling the number of cache hits and volumes, caching is not a silver bullet, sometimes it’s better to tweak the business logic than to put caching at every point, the best candidate for a cache is what it is: accessed often, using the same keys, it weighs not much, changes rarely, and is difficult to calculate.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question