BeCuriouzBeCuriouz

Learn something new every day

✍️ Blogs
πŸ—οΈ

The 3-tier architecture behind almost every web app

πŸ’‘ Most web apps are three layers β€” browser, app server, database β€” each with one job, talking through a request/response cycle.

Almost every web app you use is built on the same three-layer skeleton. Once you can see it, debugging, scaling β€” and system-design interviews β€” get dramatically easier, because you can place any problem in one of three boxes.

The browser (the client) renders the interface and sends requests β€” it holds no data of its own. The app server is where the logic lives: it receives each request, decides what to do, talks to the database, and assembles a response. The database is the system of record β€” it stores data and returns exactly the rows asked for, nothing more.

Why split it into three? Separation of concerns. Each layer scales, deploys, and fails independently: you can put a CDN in front of the browser tier, run ten copies of the app server behind a load balancer, and keep one source of truth in the database β€” without any layer knowing how the others are built.