“There’s this analogy I use a lot when talking about code to beginners: web applications are just like restaurants. You have the front of the restaurant and you have the kitchen, so that’s like the front-end and the back-end. Data and databases — you can think of that as the fridge or your pantry. So what happens when someone orders food is they make a request, it goes to the kitchen, they get the food from the pantry, it goes through the kitchen again, and back out to the front. That may not be the most efficient thing to do if you just want water. You’re not going to want it in the pantry, you’re going to want it near the front where everyone is. That’s similar to what cacheing is when you’re talking about web applications. Instead of going all the way to the database through the back-end, what you end up doing is you have things sitting very close to the front."
Jon Chan is a web developer at Stack Exchange and founder of Bento, a guided tour through the best free web development tutorials, including videos, interactive classes, and reading material. He’s also a quasi-celebrity in Poland.
https://blog.rememberlenny.com/2014/07/08/hackersofny-theres-this-analogy-i-use-a-lot/