Recap from last time¶
Classic Client <-> Server architecture with peer-to-peer, three-tier variations, ...
An OSI model in 7 layers
An HTTP(S) protocol for the web
What is the role of the server?¶
🥱 Wait and wait and wait ... 🥱
And from time to time 🥳 it must process a request!
There is server and server¶
Attention there are two meanings to server ...
Hardware server¶

It’s the physical or virtual machine connected to the network that will receive data packets but will in no case take care of processing this data
Hardware servers : different kinds¶
Physical server vs virtual server (VPS)
Different solutions: On Premise vs Cloud (OVH, Azure, GCP, AWS, ... )
There is server and server¶
Software server¶
It’s the application (in the software sense) that will take care of
Receive, Process and Respond to HTTP requests (or others for that matter)
Different solutions: Nginx (32.7%), Cloudflare Server (27.2%), Apache (24%), LiteSpeed (15.2%), Node.js (6%), ...
Host multiple HTTP(S) servers on the same physical server?¶
YES 🎯 just share port 80 🤝
Just configure Virtual Hosts at the HTTP server level
virtual hosts¶
Example of nginx config with two different sites on the same physical server


routing between both sites is done based on the Host: Header in the incoming HTTP request
A word about serverless¶
A traditional server spends its time waiting ... 🥱
A serverless is a server that does not wait
The principle is to break down processing into small independent tasks (functions) that will be executed on demand
Advantages¶
No server management
Auto-scalable
Smaller cost for small/medium traffic
Disadvantages/Difficulties¶
Startup time
No fixed cost
Debugging difficulty
Stateless
Do all servers do the same thing?¶
Two applications
Static vs dynamic sites
Static site¶
A static HTTP server only does one thing
read files html, png, jpg, pdf, .... and _send the content to the client
see for example the C++ course site
Dynamic site (basic)¶
The HTTP server will have to work with other services
in order to produce the final result that can be sent to the client
For example: a medium e-commerce site
Dynamic site (advanced)¶
On the other hand, the architecture behind a dynamic site can also be very very complex

For example: a development platform
Free hosting solutions¶
Static sites¶
Netlify
Vercel
Surge
GitHub Pages (we are there!)
readthedocs.io (we were there ;)
GitLab Pages
...
Lots of offers on the market, it’s up to you to choose the one that suits you best
Attention however : Free does not mean without limit
The web server: a need for performance 🚀¶
How to make sure everyone
has a response in a reasonable time? ⏳️
Technical solutions¶
Use of task parallelism processes/threads and/or asynchronous programming