Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Given the simple well-known architecture below:

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

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

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

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.

share|improve this answer
    
Thanks for that, very well explained. [accepted & +1] –  A T Jun 5 '12 at 4:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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