Web API Design in Java
summary
Compares REST, GraphQL, Server-Sent Events and WebSockets by building a ToDo demo app that implements GraphQL queries, SSE for live events (noting connections drop every few seconds and parallel clients max out around 15–20), and an Atom event feed. Uses OpenAPI and JSON for documentation/payloads, JWT for per-request authorization, Bean Validation to produce fine-grained error codes, and recommends releasing new major versions as separate services; example code is on GitHub and runnable for tests and interviews.
AI-written summary · about
chapters (25)
- 0:00Introduction
- 0:21Business value focus
- 3:12Web API technologies
- 4:59REST architecture
- 6:03GraphQL explained
- 6:45Server-Sent Events basics
- 7:49WebSockets limitations
- 8:53Event-driven architectures
- 10:18Example app demo
- 12:37OpenAPI documentation
- 13:41GraphQL schema exploration
- 15:54REST vs GraphQL flexibility
- 18:00Payload format choices
- 20:07Error handling best practices
- 21:53Error message design
- 22:55HTTP status codes
- 24:41Validation error structures
- 25:46Payload validation techniques
- 28:37JWT tokens security
- 30:19Token-based authentication
- 31:46Protocol security
- 32:06API versioning challenges
- 33:56Versioning strategies
- 35:21API design guidelines
- 36:12Q&A
