A
A
Anton Medvedev2015-02-14 15:37:21
symfony
Anton Medvedev, 2015-02-14 15:37:21

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:

  • Where to store the client's cache?
  • Where to store the file cache app/сache? Separately for each client app/сache/clientN?
  • Where to store the HTTP cache? On the application servers or balance node?
    What if each client has its own domain?
  • Where to store the cache of requests/results to the database? To an in-memory DB server (Redis/Riak/Memcached)?

66471d5046d345ea9d40cae728163088.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tzlom, 2015-02-19
@Elfet

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 question

Ask a Question

731 491 924 answers to any question