What goes behind the website?

Published on 2023-01-29

Could be Interesting! WebTech

(Source: internetlivestats) As of 2022, there are ~1.8 billions websites (unique domain names). 17% of all websites, that is, ~300 million are active. The rest are parked domains or similar. Talk about CONSUME! But do you know what goes behind a website? Reading Time: ~7 mins

Web server

Every Website sits on a computer known as a Web server. A Web Server is a server (it is a computing device with an operating system such as Windows, Linux, MacOS, etc.) that stores the website components such as HTML (Hyper text markup language) files, images, styling sheet, etc. In addition to storing the website components, Web server also must have a HTTP (Hypertext Transfer Protocol) Software that understands URLs (web addresses) and the protocol your browser uses to view the web pages.

Note: A Protocol is a set of rules for communication between the two computers. HTTP is a textual (human readable), stateless (does not remember/store any information) protocol.

In layman's view: (Edge Devices) Internet Browser < ---- HTTP Request & Response -- > Web Server (Website files + HTTP Software)

Application server

Application Server stores the logical aspects of the website. It is also known as a back-end server because it sits behind the web server which is client facing and thus, known as front-end server.

For example, in an e-commerce website, adding items to the cart is the logical flow and it is handled by Application Server to compute the cart value. If your website is developed with Java, Application Server would need to have a Java Run Time Environment. If it is developed with Python, it would need to have Python Environment. Depending on the programming languages, the runtime engine installed in the Application Server would be different. But programming languages and frameworks is another story for another time. Just know that, regardless of your back-end language, the front-end components of a web application are the same (HTML files, images, css, JS, etc.)

Database server

Finally, we have Database Server where a database engine sits. This is where all the websites data such as users and products are stored. There are different types of database engines such as MySQL, Oracle, etc. For simplicity, we won't go there yet. 😉

Simplified Deployment Diagram

In a nutshell, it goes like this:

Web App Arechitecturel!

This is a very simplified data flow. In reality, there can be multiple database servers, application servers, web servers providing the same service for fault-tolerance purpose. For instance, if your web server is down for unforeseen reason, you would want to have a second web server to entertain your users.

Deployment Consideration

Depending on the size of your traffic (number of users), you would want to scale up or scale down your website architecture.

There are two options: - Horizontal Scaling where you add more computing devices (more web servers, more application servers, etc.) - Vertical Scaling where you power up your existing infrastructure such as increasing memory and/or processors of your servers

Can't we have one server providing all the services?

Yes! We can have one server which has all 3 software (HTTP, Runtime Environment, Database Engine). It is all in one solution and it typically works for small deployment but doesn't scale well as your user base grows.

Normally, we would see a server providing both Front-end (Web) and Back-end (Application) while database sits in another server.

What about Serverless Solutions?

It could be tedious to manage the servers, especially so when you are serving the wider audience. Therefore, Cloud Computing Providers such as Amazon Web Service, Microsoft Azure, Google Cloud, Cloudflare and more offer serverless solutons where developers can just focus on the creating the application without the worry of provisioning, upgrading and maintaining the servers as well as handling of through-puts and latency. Serverless Computing does not mean there is not a server (computing device) where all the necessary and dependencies files (software + code files + assets such as image) are hosted. It just means developers do not have to deal with managing the servers. The hard part is lifted by Cloud Computing Providers. Serverless Computing is just a term marketers and sales people invented to attract the crowd.

Sweet! That's the gist of what goes behind the website you are viewing. Can you guess how this website is packaged (which web server software, back-end language, database engine)?