Request Response

Hands-on practice for this lecture. Work through the exercises and quizzes to reinforce what you've learned.

1

Exercise 1 of 1

Request Lifecycle — Serialization Overhead

Pick JSON, XML, or Protobuf and drag the payload size slider to see how serialization overhead changes relative to business logic time across the 8-step request lifecycle.

Request Lifecycle — Serialization Overhead
Text-based, human-readable. Decent parse speed. The practical default.
Payload size10 KB input → 10.0 KB on wire
1 KB100 KB
① Client Serialize
800μs
② Network (client → server)
4.0ms
③ Server Find Boundary
200μs
④ Server Deserialize
1.2ms
⑤ Execute Business Logic
12.0ms
⑥ Server Serialize Response
800μs
⑦ Network (server → client)
4.0ms
⑧ Client Deserialize
1.2ms
Total round-trip
24.2ms
Serialization overhead
4.2ms (17%)
Business logic
12.0ms (50%)

Try XML at 100 KB — the parse overhead alone exceeds business logic time. Protobuf at 100 KB keeps it under 2ms. This is the actual reason REST+JSON displaced SOAP+XML, and why gRPC uses Protobuf.

Practice: Request Response — Interactive Exercises | Durgesh Rai