Typorithm · medium

REST, gRPC & GraphQL

api-stylessystem-designrestgrpcgraphql
Saved on this device
Full lesson · 8 learning steps Open any exercise for focused practice
1

Step 1 of 8 · intro card

Learn REST, gRPC & GraphQL

0%

Communication

REST models resources with HTTP verbs, gRPC uses binary protobuf for fast service-to-service calls, and GraphQL lets the client shape the response to avoid over-fetching. Good APIs add versioning for backward compatibility and idempotency so retries are safe.

REST is the default style for public HTTP APIs: it models the world as resources at URLs and uses HTTP verbs (GET, POST, PUT, DELETE) plus status codes. It is simple, cacheable, and human-readable.

gRPC encodes calls as binary protobuf over HTTP/2. It is compact and fast, with generated client stubs and streaming, which makes it a strong fit for internal service-to-service communication where both sides share a schema.

GraphQL exposes a single endpoint where the client writes a query that shapes the exact fields it needs in one round trip, avoiding over-fetching. Across all styles, versioning keeps older clients working and idempotency makes retries safe after a timeout.

01

REST: resources + HTTP verbs, simple and cacheable.

02

gRPC: binary protobuf over HTTP/2, fast for internal calls.

03

GraphQL: client-shaped queries avoid over-fetching.

api:
  rest: resource-http-verbs
  grpc: binary-protobuf-fast
  graphql: client-shaped-query
  versioning: backward-compat
  idempotency: safe-retries

Read the implementation

Connect each part of the code to the concept before you type.

1. REST

REST models the system as resources addressed by URLs and acted on with HTTP verbs like GET, POST, PUT, and DELETE.

rest: resource-http-verbs

2. gRPC

gRPC serializes calls as compact binary protobuf over HTTP/2, making it fast and efficient for service-to-service traffic.

grpc: binary-protobuf-fast

3. GraphQL

GraphQL lets the client send one query that shapes the exact fields it wants, avoiding over-fetching and under-fetching.

graphql: client-shaped-query

4. Versioning

Versioning lets an API evolve while keeping older clients working, preserving backward compatibility.

versioning: backward-compat

5. Idempotency

An idempotent endpoint produces the same result no matter how many times it is called, so retries are safe.

idempotency: safe-retries

A complete learning loop

01

Understand

Read the concept map and follow the code breakdown.

02

Reconstruct

Type the implementation, repair mistakes and work through every recall exercise.

03

Verify

Use the final check without hints; revisit weak concepts in short practice sessions.

REST, gRPC & GraphQL: Lesson & Practice · Typorithm | ApplyDjinn