What happens when you type google.com in your browser and press Enter?

So you pick up your smartphone or computer and type google.com in your browser and voila the homepage appears almost as soon as you press the Enter key and everyone's happy. But have you ever wondered what goes on between the term interval of pressing the Enter key and receiving the homepage? Have you ever had the feeling that something's going on under the hood? If you have, then you're right. I'm sure some of you think it's magic. No worries though; I'll be addressing the key components involved in this process and how they work hand in hand to deliver your favorite website to your browser. Could be any site but we're using google as a reference here.

DNS Request: As soon as you click the enter key, the first action that happens is translating the hostnames; e.g google.com into IP addresses. Humans understand hostnames (since it's English). However computers don't. See why the translation becomes necessary? Towards this end, your browser sends a Domain Name System (DNS) request to to the DNS server which in turn responds with the IP address of one of Google servers. TCP/IP: Ok your browser now has the relevant IP address, what's next? Well knowing the IP alone obviously won't be enough, it actually has to connect with the server to communicate with it. It does this via the Transmission Control Protocol (TCP). TCP is simply a protocol that establishes a secure, ordered and error-checked connection with the server. It does this via a three-way handshake where the client sends a SYN packet (just a synchronization packet) to the server which then responds with a SYN-ACK packet; simply an acknowledgement that it receive the SYN packet and the client sends back an ACK packet to inform the server that it's message was well received. See why it's a THREE-way handshake? Firewall: Since the connection had been established, it's necessary to control incoming traffic. The server does this via a firewall. Traffic recognized and allowed by the firewall are welcomed otherwise it's goodbye stranger and the server sends an error message to the browser. HTTPS/SSL: Now your browser has to initiate a secure connection via HTTPS. I'm sure you've encountered both http and https sites. Well the later is a secure version of the former. HTTPS stands for HyperText Transfer Protocol Secure and it encrypts transmitted data between the browser and the server. It does this by establishing a secure browser-server connection via a Secure Socket Layer (SSL) handshake. The server sends it's SSL certificate to the browser which then checks if the certificate is valid and from a bonafide Certificate Authority. On complete verification, the browser and server then agree on a shared encryption key which is used for the rest of the session. Load Balancer: Ever wondered how great Google is able to handle millions of request with little or no lag and without crashing. Well she does this via division of labour or division of load rather. Yes, she has servers in different data centers around the world and distributes incoming traffic amongst these servers. The Load Balancer is the technology responsible for making this distribution. It sends each request to one of the servers that's free and available. Web Server: Once the server receives a request, the request is first handled by the web server. The web server is responsible for serving static content to the browser in the form of HTML/CSS and JavaScript files. Application Server: The web server is all good for static content but it reaches its limit when dynamic content is required by the website. No worries though, this is just what the application server is meant for. It processes those requests from the web server and serves dynamic content depending on user input, database queries and other dynamic triggers. Google's homepage is static though so we would not be needing this service. Database: Finally, if the website needs access to stored data e.g user passwords, the web server might also need to communicate to the database. A database is simply a collection of organized data that can be queried and modified via software programs. Again this is kinda unnecessary to get the homepage alone but for service ls like Google Drive and Maps where access to relevant data is needed, it becomes significantly. Overall, there are a series of steps and infrastructures involved between entering a website and getting your desired result ranging from DNS requests, TCP/IP, Firewall, HTTPS/SSL, Load Balancers, Web Servers, Application Servers amd Databases. Know this and know peace. Kidding, however knowing this would help you appreciate the complexity of modern web development and the infrastructures employed in this process.