Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Lukasz Dynowski, Marcin Dulak

Rating No ratings yet

When developing a service, whether it’s a web service or a microservice, an application programming interface (API) is essential for facilitating data exchange. In this hands-on book, authors Lukasz Dynowski and Marcin Dulak show software developers, engineers, and architects how to design and implement APIs for specific use cases—including RESTful APIs, GraphQL APIs, WebSocket APIs, webhook APIs, gRPC APIs, and messaging protocols. You’ll learn how to determine the appropriate type of API for your application use case and how to tackle design decisions along the way. You’ll also learn the trade-offs between various APIs and acquire practical knowledge of how to implement them. Explore the origins and evolution of API styles Learn the core network protocols that various APIs use Determine which encoding to use for your API Select an appropriate API style Understand the trade-offs of each API style Learn how to implement, secure, and document various API styles Inspect network packets exchanged between APIs

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A practical field guide for developers, engineers, and architects who must choose between REST, GraphQL, WebSocket, webhook, gRPC, and messaging APIs—and then implement, secure, and document the right one. It teaches the trade-offs behind each style rather than pushing a single favorite. 【Book Arc】 - **Opening (~0%–15%)**: Frames what an API actually is, why network-based APIs matter, and how they evolved. Introduces access types (private, public, partner) and transmission modes (simplex, half-duplex, full-duplex) as shared vocabulary. - **Early (~15%–35%)**: Moves into API concepts and lifecycle—functional vs. nonfunctional requirements, the SDLC, Agile testing quadrants, governance, and deprecation/sunset signaling. This stage answers "how do we decide what to build and when to retire it?" - **Middle (~35%–55%)**: Covers API design patterns: resource-oriented vs. intent-oriented (declarative vs. imperative) styles, naming, versioning schemes (semantic, calendar, hash), encoding choices, filtering, and resilience patterns like retry storms, circuit breakers, and exponential back-off. - **Late (~55%–85%)**: Applies these foundations to concrete API styles—REST, GraphQL, WebSocket, webhook, gRPC, and messaging protocols—comparing their trade-offs, security models, and documentation needs. (Excerpts do not cover the detailed chapter contents here.) - **Ending (~85%–100%)**: Consolidates implementation, security, and packet-inspection practice, helping readers match a style to a real use case. (Excerpts do not cover the closing chapters in detail.) 【Key Takeaways】 - **APIs are interaction points, not just code** (Opening): The book defines an API as a boundary that hides system complexity and separates behavior from implementation—useful framing before comparing styles. - **Requirements drive style choice** (Early): Functional requirements capture what the system does; nonfunctional requirements capture quality attributes like latency and security. The right API style follows from these, not from fashion. - **Resource-oriented vs. intent-oriented is a core design fork** (Middle): REST's limited HTTP verbs bring predictability but struggle with custom actions; intent-oriented APIs (e.g., Stripe's Payment Intents) gain flexibility at the cost of endpoint sprawl. - **Versioning is a communication problem** (Middle): Semantic, calendar, and hash versioning each compress many changes into one label; changelogs, feeds, and metadata sections help users adapt. - **Encoding overhead compounds at scale** (Middle): Data transfer costs that are invisible at megabytes become significant at gigabytes, making encoding a real design decision. - **Resilience patterns prevent self-inflicted outages** (Middle): Thundering herd and retry storms can prolong downtime; cutoffs, circuit breakers, jitter, timeouts, exponential back-off, and Retry-After headers are the countermeasures. - **Security follows least privilege** (Middle): Authentication verifies identity, authorization grants access, and clients should receive only the minimum permissions needed. - **Deprecation needs a timeline and a channel** (Early): Sunset and Deprecation headers, plus documentation links, give consumers months of warning before retirement. 【Reading Tips】 - Deep-read the early lifecycle and requirements chapters if you are choosing an API style for a new service; skim the history if you already know it. - Treat the design-patterns chapter as a reference—bookmark the versioning, filtering, and retry sections for reuse during architecture reviews. - Pay close attention to the resource-oriented vs. intent-oriented distinction; it is the clearest lens the book offers for evaluating REST versus gRPC and GraphQL. - Use the hands-on network labs (TCP echo, packet inspection) to build intuition for what actually travels over the wire, even if you work at a higher abstraction. - When reading style-specific chapters, keep a checklist: encoding, security, documentation, and failure behavior. 【Coverage Limits】 The excerpts cover the book's conceptual foundations, lifecycle, and design patterns well, but the detailed treatment of individual API styles (REST, GraphQL, WebSocket, webhook, gRPC, messaging) and the closing implementation chapters are only partially represented here.
Excerpt 1
42 Evolving APIs 45 API Versioning 47 Encoding 50 Filtering 57 Counting and Sorting 58 Pagination 59 Long-Running Tasks 62 Request Deduplication 63 Request R...
View in text
Excerpt 2
ly one direction at a time: from the sender to the receiver. An example of a device that uses half-duplex mode is a walkie-talkie. When communicating using a...
View in text
Excerpt 3
te isn’t the only significant piece of information to share. You could enrich the deprecation message with contact information, a migration guide, and, if an...
View in text
Excerpt 4
ceed, retries should be paused for a certain amount of time. Instead of helping, a retry storm can prolong the outage. To tem‐ porarily pause retries, you ca...
View in text
Excerpt 5
the OSI network layer. Note that this route and the gateway are automatically configured by Docker. This line shows that the network packets destined for the...
View in text
Excerpt 6
ers and body. The execution flow of commands for this exer‐ cise is given in Example 4-5. An HTTP/1.0 or HTTP/1.1 message consists of a start-line fol‐ lowed...
View in text
Excerpt 7
stination IP address, destination port), QUIC uses a set of encrypted connection IDs that are generated and exchanged during the hand‐ shake. During the conn...
View in text
Excerpt 8
e Roy Fielding’s post “REST APIs Must Be Hypertext-Driven”. 16 See common challenges and limitations of HATEOAS. 162 | Chapter 5
View in text
Tags
AI categories
BackendSoftwareWeb Technology
ISBN: 1098153995
Publisher: O'Reilly Media
Publish Year: 2025
Language: English
Pages: 415
File Format: PDF
File Size: 16.0 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…