Before understanding backend development in depth, we first need to understand how a backend actually works.
1) how does a Backend actually works?🖥️
-> When a frontend(client) sends a request, it reaches the backend server through an Ip address and port.
The backend then identifies the appropriate endpoint/route for that request and processes it according to the business logic.
If required communicate with the database to read or store data.
Finally, the backend sends a response to the frontend, often in JSON format and the frontend uses that response to display the result to the user.
2) How exactly happens when we enter a URL in the browser?🌐
-> suppose we entered : https://example.com/products
https : protocol(tells browser I want to communicate using https)
example.com : Domain name (which humans can understand)
/products : This tells server which resource you are requesting.
But computer communicate over networks using Ip addresses, not human- friendly domain name. Here DNS comes in.....🕺
DNS (Domain name system) is a phonebook of the internet it converts human-readable domain name (example.com ) to Ip address which computers can understands.
Now how the browser reaches to the server? here TCP walks in...🤷♀️
TCP establish a connection between client(browser) and server
But but...we are using https (the communication needs to be protected right) so TLS comes in
TLS provides : Encryption, server authentication and data integrity
Now browser sends an http request telling the server what it wants
for example : Get/products
After that, request reaches to server where backend identifies a appropriate endpoint and processes the request.
If request needs data, the backend communicates with database to read or modify it.
The backend sends HTTP response back to the browser. The response may contain HTML, JSON, images, or other data depending on the request.
Finally, the browser processes the response and displays the webpage or uses the returned data.
In simple terms:
URL → DNS → IP → Connection → HTTP Request → Backend → Database → Response → Browser
Top comments (0)