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

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

One of the most common questions in tech interviews, and one of the basic pieces of knowledge any tech interested individual needs to understand.

Learning and getting an idea how the web works enhances your work as a software engineer, and levels up the performance of any code you're working on. This concept will be discussed in terms of DNS request, TCP/IP, Load-balancer, Firewall, SSL/HTTPS, Web and Application servers and Database.

It all started with you typing google.com in the search bar, asking in a way “who is this google.com friend?”. The browser will direct you to what it is named as Internet Service Provider (ISP), which in turn directs you to the Domain Name Service (DNS) server requesting the address of google.com.

Simply, a DNS request is sent to the DNS server holding the name of the requested address anytime a client is searching for a resource. Think of the DNS as a phone book that has the list of all addresses you’re looking for, in this case google.com. They send back the google.com address 142.251.37.238 with a process called DNS lookup to the ISP, then back to the browser, however nothing is shown yet.

Notice that the IP Address is a unique address of every device connected to the Internet.

When the browser receives google.com IP address it builds what we call a TCP/IP connection with the intended server. TCP stands for Transmission Control Protocol, and IP stands for Internet Protocol, covering a set of rules related to the data transmission, routing and delivery.

After the connection is established, and before transferring data, a set of traffic control and safety tools are presented.

  • A firewall is a software or hardware tool designed to prevent unauthorized entry to or exit from private networks. It serves as a protective barrier between a secure internal network and a potentially vulnerable network, such as the internet.

  • HTTPS/SSL : As known HTTP is the Hypertext Transfer Protocol used widely in the Internet, hence HTTPS is the secure version of HTTP.?

In HTTPS, the communication protocol undergoes encryption using Secure Sockets Layer (SSL). Therefore, the protocol is commonly denoted as HTTP over SSL. SSL is simply a protocol designed to ensure the privacy of data transmitted between servers and web browsers.

  • A load balancer is a tool that allocates incoming requests among multiple servers to prevent overloading over any single server.

Now back to the process, the request that passed through traffic controls is now received by the web server. In this case, the IP address will be forwarded to Google servers. Google servers will send the HTML, CSS, and JavaScript files for google.com as a response to the browser and google.com window will appear.

However, if there is a need for dynamic content (based on user request) the web server will direct the request to the application server, also to the database server. The application server is related to building dynamic applications and it is usually written by languages such as Java, Python, or Node.js.

Finally, a database is a storage entity. If a database needs to be accessed, the application server sends a request to the database server requesting certain information to be retrieved.

Of course depending on the user request whether a static or dynamic content, the request would be sent to related servers and the response would be received by the browser. In this scenario, the google.com page would appear on the browser screen successfully.

要查看或添加评论,请登录

Eman Bakri的更多文章

  • Bel3arabi App

    Bel3arabi App

    Bel3arabi is a game app to introduce people to different Arabic dialects in a fun interesting manner. The app comes in…

社区洞察

其他会员也浏览了