Skip to content

Week 1 — Client–Server, DNS, HTTP, TCP/UDP

“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 server

How app.example.com resolves to an IP:

Browser → Recursive resolver → Root nameserver
→ TLD server (.com) → Authoritative nameserver
→ IP returned + cached for TTL duration

Key record types:

RecordPurpose
ADomain → IPv4
AAAADomain → IPv6
CNAMEAlias → another domain
MXMail server
TXTVerification, SPF

TTL controls how long resolvers cache the answer. Low TTL = fast propagation on change, more DNS queries.

Request structure:

GET /api/v1/orders HTTP/1.1
Host: app.example.com
Authorization: Bearer <token>

Status codes that matter:

CodeMeaning
200OK
201Created
301/302Redirect (permanent/temporary)
400Bad request (client error)
401Unauthenticated
403Forbidden
404Not found
429Rate limited
500Server error
503Service unavailable

HTTPS = HTTP + TLS. The TLS handshake adds ~1 RTT latency but encrypts everything in transit.

TCPUDP
Connection3-way handshakeNone
DeliveryGuaranteed, orderedBest effort
OverheadHigherLower
Use caseHTTP, databases, file transferDNS, 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).

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.

  • 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?