Communication & Data Transfer/Communication Foundations

The Application Communication Lens

What lives at L7 vs what Networking already covered — request/response semantics, coupling dimensions, and the interview framing for "how would these two services talk?"

2/5Overview: 30m

Track boundaries — what this reference owns

This track is the application-layer communication guide: protocols, API contracts, and data-movement patterns between processes. It builds on sibling tracks and does not re-teach their material.

Sibling trackThey ownThis track adds
NetworkingTCP/UDP, DNS, TLS, HTTP/1–3 framing, L4/L7 LB, CDN cache headersWhat you put on the wire: REST vs gRPC vs events, resource design, serialization, WebSockets/WebRTC at app level
ConcurrencyThreads, locks, semaphores, deadlocks, atomics, in-process event loopsTimeouts/retries at call sites, API rate limits, bounded outbound connection pools, backpressure between services
Distributed SystemsCAP, replication, consensus, Kafka partitions, delivery semantics, sagas/outbox correctnessChoosing sync vs async integration, webhooks, AsyncAPI contracts, when to use a broker vs HTTP callback
DatabasesB-trees, MVCC, sharding, Parquet/lake storage formatsPresigned upload URLs, export-job APIs, orchestrating landing in object storage — not how S3 or WAL works internally
Data EngineeringSpark/Flink pipelines, CDC implementation, medallion transformsAsync bulk-export API surface, webhook-on-complete after ingest lands — not how the pipeline runs
LLDClass APIs, SOLID, design patterns, rate limiter as an objectHTTP/GraphQL/gRPC as system-level protocols, OpenAPI, pagination — not ParkingLot method signatures
MicroservicesDecomposition, discovery, gateway, mesh, CQRS/ESWire protocols (REST/gRPC) — Communication; consensus — Distributed Systems
ObservabilityLogs, metrics, OTel SDKs, SLOs, samplingtraceparent / gRPC metadata propagation across API hops — not how to build dashboards
SecurityAuthN/AuthZ, OWASP, XSS/CSRF, API hardening, PII, SDLCTLS wire details — Networking; mesh mTLS ops — Microservices
OSProcesses, scheduling, containers, file I/OOnly where it surfaces in comms: FD limits on WebSocket fleets — skim, don't duplicate

Read order: Networking first (required). Concurrency and Databases help for backpressure and bulk-transfer context. Distributed Systems after Topics 1–7 here — messaging depth assumes you already picked how services should talk.

What this topic owns (vs Networking)

Networking covers the wire: TCP reliability, DNS resolution, TLS handshakes, HTTP/1–3 framing, load balancers, CDN caching headers. This track covers what you put on the wire and why — API styles, contracts, serialization, real-time protocols, and moving gigabytes to terabytes.

Senior signal: you can trace a user action from client → API gateway → service mesh → downstream RPC without re-explaining TCP.

Communication styles (memorize the trade-off table)

StyleCouplingDiscoveryTypical latencyFailure visibility
Sync RPC/RESTTight (caller waits)Direct address or service discoveryLow–mediumImmediate to caller
Async messagingLoose (temporal decoupling)Broker/topicHigher (queued)Delayed; needs DLQ
StreamingMediumLong-lived connectionLow for pushConnection state matters
Shared DB/fileVery tight (anti-pattern at scale)Schema couplingVariesHidden, dangerous

REST is an architectural style, not "JSON over HTTP"

Fielding's constraints: client-server, stateless, cacheable, uniform interface (resources identified by URIs, manipulation via representations, hypermedia optional), layered system, code-on-demand (optional).

Interview trap: "RESTful" APIs that are really RPC with HTTP verbs (POST /createUser, GET /getUserById/42). Know when that's fine (pragmatism) vs when resource modeling matters (public APIs, long-lived contracts).

RPC mental model

Remote Procedure Call: client calls getUser(id) as if local. gRPC, Thrift, tRPC are modern RPC. Trade-offs vs REST:

  • Pros: Strong typing, codegen, efficient binary payloads, bidirectional streaming built in.
  • Cons: Browser support weaker (needs gRPC-Web or proxy), harder to cache at CDN, tighter coupling to generated stubs.

Coupling dimensions (staff-level vocabulary)

  1. Temporal — must both sides be up at the same instant?
  2. Location — does caller know callee's host/port?
  3. Schema — can one side evolve without breaking the other?
  4. Semantic — does caller understand callee's domain model?

Loose coupling → async events + schema evolution rules. Tight coupling → sync RPC with versioned protobuf.

Idempotency at the boundary

Networking introduced HTTP idempotency (GET/PUT/DELETE vs POST). At the application layer:

  • Idempotency keys — client sends Idempotency-Key: uuid on POST; server dedupes within TTL.
  • Natural idempotency — PUT with full resource state, DELETE by ID.
  • Retries — only safe with idempotent operations or keys; otherwise duplicate charges, duplicate orders.

Choosing a protocol (decision tree sketch)

Need browser-native + cacheable public API? → REST/JSON (+ OpenAPI) Need typed internal microservice mesh? → gRPC or Connect Need flexible client-driven queries? → GraphQL (+ BFF) Need server push to browser? → WebSocket or SSE Need peer media (video, P2P file)? → WebRTC Need TB-scale bulk move? → Object storage + multipart / physical transfer Need durable async between teams? → Message broker (see Distributed Systems)

Cross-reference: Distributed Systems → Messaging & Streams for Kafka semantics, consumer groups, and exactly-once — not duplicated here. LLD → API & Component Design covers in-process public surfaces; this track covers cross-network contracts.

Further Reading

Hands-On Tasks (Optional)

API design drills and whiteboard exercises — protocol selection, contract design, and bulk-transfer architecture. Assumes Networking and sibling tracks on the hub page (Distributed Systems, Databases, Concurrency, LLD).

  • Pick a communication style for three integrations

    For: (1) mobile app fetching user profile, (2) payment service notifying order service of charge success, (3) analytics ingesting clickstream — specify sync HTTP, async queue, or streaming and justify coupling, latency, and failure modes.

    15m