To summarize:
- DNS is used to find the ip address of a server from the domain.
Ther are also other components that helps a website run smoothly.
Load Balancers
- used when a website traffic is high or the website need to be high available.
- A load balancer receives the request and forward to one of the many servers behind it.
- It uses different algorithm to help it decide which server is best to deal with the request.
- example are round-robin (give request to servers in an order). or Weighted which checks how many request a server is dealing at the time.
- They also periodically check the servers are running correctly. this is called health check.
- If a server doesn't respond appropriately or doesn't respond, the load balancer will stop sending traffic until it responds appropriately again.
CDN (Content Delivery Networks)
- used to cut down the traffic.
- websites are hosted on thousands of servers all over the world.
- CDN choose the nearest physically located server.
Databases
- Website stores information on databases.
- webservers communicate with databases and collect and store the data.
- They use querying to collect data.
WAF (Web Application Firewall)
- sits between the web request and web server.
- protects the server from hacking or denial of service attacks.
- It analyses web request and confirm it is from a real user.
- Only allows certain amount of IP per second.
How Web servers work?
What is a webserver?
- is a software that listens for requests and utilizes the HTTP protocol to deliver web contents to it’s clients.
- The most common such software is Apache, Nginx, IIS and NodeJS.
- A webserver delivers files from its root directory
- for example /var/www/html/picture.png from it’s local hard drive.
Virtual Hosts
- Web servers can host multiple website with different domai names. They use virtual hosts for this purpose.
- Virtual Host are just text based configurations.
- Virtual Host have mapped their root directory in different locations of the hardware.
- For example, one.com being mapped to /var/www/website_one, and two.com being mapped to /var/www/website_two
- There is no limit to the number of website that you can host on the server.
Static Vs Dynamic Content
- Static Contents are that never changes.
- Common examples are pictures , JavaScript ,CSS and can also include HTML.
- Furthermore, these are files that are directly served from the webserver with no changes made to them
- Dynamic Content on the other hand are the content that could change with each request.
- example would be a search page which changes content based on the search text.
- These changes to what you end up seeing are done in what is called the Backend with the use of programming and scripting languages
Scripting and Backend Languages
- Some examples include PHP, Python, Ruby, NodeJS, Perl and Many more.
- The client doesn’t see any backend content when inspecting a page.