An API is a contract: what a caller can ask for, what it must send, and what it gets back. REST, gRPC and GraphQL are three popular styles for writing that contract. People argue about them as if one must win. In practice, many companies use all three, each in the place where it fits.
This lesson takes one real Tiffin screen, builds it three ways, and then gives you a simple way to choose.
Quick recap. Module 2 ("Designing the API") designed Tiffin's first REST API: resources like /orders/812, HTTP methods, status codes. Module 11 ("How services talk") looked at services calling each other. This lesson compares the three main styles side by side. It also leans on the HTTP/2 lesson earlier in this module.
One screen, three ways
The order tracking screen in the Tiffin app shows:
- the order's status and items,
- the restaurant's name and phone number,
- the rider's name and current location.
That data lives in three places: orders, restaurants and riders. Let's see how each style fetches it.