0PricingLogin
PHP Academy · Lesson

Service Communication: REST and gRPC

Connect services synchronously and efficiently.

REST and gRPC

Services need to talk synchronously: a request goes out, an answer comes back. The two dominant choices are REST over HTTP/JSON and gRPC over HTTP/2 + Protobuf. They optimize for different things — REST for reach and human-friendliness, gRPC for speed and strict contracts.

This lesson shows both from a PHP perspective and when to pick each.

REST: the Lingua Franca

REST models resources behind URLs and uses HTTP verbs and status codes for semantics. Its strengths: universal tooling, cacheability, debuggability with curl, and zero special client needs. Its weaknesses: verbose JSON, no enforced schema, and request/response only.

For public APIs and browser-facing endpoints, REST is almost always right.

All lessons in this course

  1. From Monolith to Microservices
  2. Service Communication: REST and gRPC
  3. API Gateways and Service Discovery
  4. Resilience: Circuit Breakers and Retries
← Back to PHP Academy