Given the simple well-known architecture below:

https://yuml.me//diagram/scruffy;/class/[Model (database)]-[View Controller], [View Controller]-[Client]

Where (conceptually) does the caching server(s) sit?

| improve this question | | | | |

Your caching layer sits between Model and View Controller. You should not hit database for needless requests. These requests include in my opinion.

  • Almost all lookup tables. You read city and state list already. Why go to database again.
  • Facts used in almost every page. if you show User's detail every page. Hit to Database once and cache it.
  • Slow queries you can afford to show with some delay. For example you can cache How many orders your customer have and show it without going to database.

Note that Caching does not need to be for database only. For example you may cache messages from mail server, or expensive file parsing operation result also.

Caching is the number one layer which increases speed of application.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.