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!
Serveur et serveur deux choses différentes¶
Attention there are two meanings to server ...
Le serveur hardware¶

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
Le serveur hardware : différents types¶
Physical server vs virtual server (VPS)
Different solutions: On Premise vs Cloud (OVH, Azure, GCP, AWS, ... )
Serveur et serveur deux choses différentes¶
The “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 (33%), Apache (27%), LiteSpeed (15%), Node.js(4%), IIS (4%), ...
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


the “routing” between the two sites is done based on the Host: Header of the 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
No fixed cost
Scalable
Disadvantages/Difficulties¶
Startup time
Usage cost
Debugging difficulty
Stateless
Lower cost for providers because they can optimize resource usage
Do all servers do the same thing?¶
Two applications
Static vs dynamic sites
Static site¶
The 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