In un sistema, i componenti (servizi, client) comunicano attraverso API e vari protocolli — sincroni (REST, gRPC) e asincroni (messaging/code). Comprendere come i componenti comunicano è fondamentale per progettare sistemi composti da più parti.
Comunicazione sincrona (request/response)
The caller WAITS for a response (blocking):
REST (HTTP) → most common; resources over HTTP (JSON) → simple, ubiquitous, web-friendly
gRPC → high-performance RPC (binary, HTTP/2) → fast, typed; good for internal services
GraphQL → flexible queries (client requests exactly what it needs)
→ for: direct request/response where the caller needs an answer now
