Workstation topics · System design for builders
The three main parts: front, back and the ledger
🏠The everyday picture
At the Sharma Textiles shop, a customer talks to the counter staff. The counter staff pass the request to the back office, which checks prices and stock in the ledger, then sends the answer back to the counter. The customer never walks into the back office or touches the ledger. Online, the shop works the same way.
📘What it really is
| In the shop | In the app | What it does |
|---|---|---|
| The counter | Frontend (the client): the web page or app on the customer's phone | Shows things and collects what the customer taps or types |
| The back office | Backend (the server): the program running on a server | Applies the rules: prices, stock, who may see what |
| The ledger | Database | Keeps the records: products, customers, orders |
They talk through requests and responses. The phone sends a request ("show me silk sarees"); the server checks the rules, asks the database, and sends a response (the list, as a page or as data).
The most important rule: never trust the counter alone. Anything on the customer's phone can be changed by the customer. Prices, stock and permissions must be checked on the server, even if the page already checked them.
📝A worked example
A customer orders one silk saree:
- Frontend: she taps "Buy". The phone sends "order: silk saree, quantity 1" to the server.
- Backend: checks the saree exists, works out the price itself (it ignores any price the phone sends), and checks there's stock.
- Database: stores the order and reduces the stock by one, both together, so they can't get out of step.
- Backend → frontend: "Order 1042 placed". The phone shows a thank-you page.
🖱️Try it
Draw your own app (or a food-delivery app) as three boxes: frontend, backend, database. Draw arrows for one action, such as "place an order". Under each box, write one thing it must never be trusted to do alone. For the frontend, the answer is always the same: deciding prices or permissions.
✅Quick check
The page shows a saree at ₹4,000. A clever customer edits the page to show ₹40 and pays. What stops this?
Show the answer
The backend works out the price itself from the database and ignores the price the phone sends. That's why rules live on the server.
Where should an order be stored so it's still there tomorrow?
Show the answer
In the database. The frontend forgets when the page is closed, and the server's memory is cleared when it restarts.
🧩Check yourself
Tap an answer to see why every option is right or wrong. There's no score and nothing is saved, so try as often as you like.
