Part-2 of Backend from first Principles
π§ What is a Backend? (Systems-first view)
At its core, a backend is a computer listening on open ports (80/443) for requests via HTTP, WebSockets, gRPC, etc., and serving or accepting data.
But to really understand backend engineering, you need to see the full flow, not just code π
π Request journey
Browser β DNS β Public IP β Firewall β Reverse Proxy (Nginx) β App Server
Each layer matters:
β DNS maps domain β IP
β Firewalls decide which ports are reachable
β Reverse proxies handle SSL, routing & redirection
β App server processes the request
Same app works on:
β localhost during development
β Real domains in production via DNS Nginx
π¦ Why do we even need a backend?
Think of liking a post on Instagram:
β Your app sends a request
β Server identifies the user
β Persists the action in a database
β Triggers a notification to the other user
All of this happens between your click and the notification.
If you strip backend down to one word, itβs this:
π DATA
Fetching it, receiving it, persisting it, and acting on it.
π€ Why not do everything on the frontend then?
Because frontend works very differently.
π₯οΈ Frontend reality
β Browser first fetches the HTML
β Then loads JavaScript, CSS, fonts, and images
β Browser executes the JavaScript (browser = runtime)
β All logic runs on the userβs device
π Browser limitations (by design)
β Sandboxed environment
β No file system access
β No environment variables
β Strict CORS rules
β Limited compute power
These restrictions exist because browsers execute remote code β without isolation, security would be impossible.
βοΈ Why backend logic canβt live in frontend
β Backends need access to filesystem and secrets
β Backends must call many external services (no CORS restrictions)
β Heavy business logic needs stable, scalable compute
β Clients can be low-end devices, while servers can scale CPU and RAM
β
Final takeaway
β Frontend = UI interactions
β Backend = centralized system managing data, security, state, and scale
Understanding this flow is the right starting point before learning backend principles deeply.
#Backend #LearningInPublic