Week 1 — Client–Server, DNS, HTTP, TCP/UDP
Client–Server Model
Section titled “Client–Server Model”“Client” and “server” are roles, not fixed machines. An Odoo instance simultaneously serves browsers (server role) while acting as a client to PostgreSQL.
Browser → Nginx (L7 LB) → Odoo (app server) → PostgreSQL client server/client server/client serverHow app.example.com resolves to an IP:
Browser → Recursive resolver → Root nameserver → TLD server (.com) → Authoritative nameserver → IP returned + cached for TTL durationKey record types:
| Record | Purpose |
|---|---|
| A | Domain → IPv4 |
| AAAA | Domain → IPv6 |
| CNAME | Alias → another domain |
| MX | Mail server |
| TXT | Verification, SPF |
TTL controls how long resolvers cache the answer. Low TTL = fast propagation on change, more DNS queries.
HTTP/HTTPS
Section titled “HTTP/HTTPS”Request structure:
GET /api/v1/orders HTTP/1.1Host: app.example.comAuthorization: Bearer <token>Status codes that matter:
| Code | Meaning |
|---|---|
| 200 | OK |
| 201 | Created |
| 301/302 | Redirect (permanent/temporary) |
| 400 | Bad request (client error) |
| 401 | Unauthenticated |
| 403 | Forbidden |
| 404 | Not found |
| 429 | Rate limited |
| 500 | Server error |
| 503 | Service unavailable |
HTTPS = HTTP + TLS. The TLS handshake adds ~1 RTT latency but encrypts everything in transit.
TCP vs UDP
Section titled “TCP vs UDP”| TCP | UDP | |
|---|---|---|
| Connection | 3-way handshake | None |
| Delivery | Guaranteed, ordered | Best effort |
| Overhead | Higher | Lower |
| Use case | HTTP, databases, file transfer | DNS, video streaming, gaming |
When to use UDP: When losing a packet is better than waiting for retransmission (e.g. live video — a dropped frame is better than a 2-second freeze).
Practice
Section titled “Practice”Draw the full request journey for: browser opens app.yourcompany.com/web → sees the Odoo login page.
Label every hop: DNS resolution, TCP handshake, TLS, HTTP request, app server processing, DB query, response.
Self-check
Section titled “Self-check”- What happens if the DNS TTL is set to 0?
- Why can’t you just scale the app server horizontally without thinking about session state?
- What does a 502 Bad Gateway mean vs a 503 Service Unavailable?