Understanding the Trade-Offs of Common APIs and Choosing the Correct Solutions
Lukasz Dynowski and Marcin Dulak

#API
#REST
#GraphQL
#gRPC
#IoT
#WebSocket
#Webhooks
✨ رابط برنامهنویسی کاربردی (API) امکان تبادل داده را در سیستمهایی مانند اپلیکیشنهای وب، ریزسرویسها و دستگاههای اینترنت اشیا (IoT) فراهم میکند.
در این کتاب عملی، نویسندگان لوکاش دینوفسکی و مارسین دولاک به توسعهدهندگان و معماران نرمافزار میآموزند که چگونه APIهای REST، GraphQL، gRPC، Webhook، WebSocket و پیامرسان (Messaging API) را طراحی و پیادهسازی کنند.
📡 این کتاب به محبوبترین سبکهای طراحی API از دیدگاه شبکه، برنامه و معماری میپردازد.
در طول مطالعه، یاد میگیرید چگونه نوع مناسب API را برای نیاز اپلیکیشن خود انتخاب کرده و در مسیر طراحی، تصمیمهای فنی درست اتخاذ کنید. همچنین با مزایا و محدودیتهای هر نوع API آشنا میشوید و دانش عملی لازم برای پیادهسازی، ایمنسازی و مستندسازی آنها را به دست میآورید.
An application programming interface (API) enables data exchange in systems such as web applications, microservices, and IoT devices. In this hands-on book, authors Lukasz Dynowski and Marcin Dulak show software developers and architects how to design and implement REST, GraphQL, gRPC, webhooks, WebSocket, messaging APIs, and more.
This book looks at the most popular API styles from a network, application, and architecture perspective. 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.
Table of Contents
Chapter 1. API Concepts
Chapter 2. API Design Patterns
Chapter 3. Network
Chapter 4. Web Protocols
Chapter 5. REST
Chapter 6. GraphQL
Chapter 7. Web Feeds
Chapter 8. gRPC
Chapter 9. Webhooks
Chapter 10. WebSocket
Chapter 11. Messaging
Why We Wrote This Book
Throughout our experience, we’ve worked with various APIs, including REST, Query, RPC, broker-based systems, and more. Every API style has an ecosystem surrounding it: community, working groups, and sometimes internet giants supporting it. For every style, you may read many books to discover API merits; and believe us, it takes time to master just one style. Yet we can no longer afford to stick to one API style. Sure, you could go far with REST APIs, but only to a point.
This book is a response to a gap we noticed in the IT bookshelves. Namely, recent books on APIs don’t provide a detailed overview of various API styles. Moreover, many books about APIs focus on high-level concepts or offer code snippets without providing complete implementations.
The IT industry in the past few years has signaled a need for API skills. In its 2023 “API Trends” report, Gartner mentioned that the top API challenges that organizations face were missing key roles, lack of API standards, lack of skills, and security concerns. In 2024, Gartner predicted that 30% of the increase in demand for APIs will come from AI and large language models (LLMs) by 2026.
This book seeks to address some of the aforementioned API challenges and meet the API needs that the IT industry is lacking.
Who Should Read This Book
This book is written for software developers and architects who want to know the trade-offs and implementation details of various API styles. Completing this book will give you an understanding of various APIs from the architecture, implementation, and network perspective. This book is intended for people who want to do the following:
What’s in This Book
In this book, we’ll design and implement synchronous and asynchronous APIs in various styles: REST API (Chapter 5), Query API with GraphQL (Chapter 6), Web Feeds API with the Atom protocol (Chapter 7), RPC API with the gRPC framework (Chapter 8), callback API with webhooks (Chapter 9), bidirectional API with WebSocket (Chapter 10), and broker-based API with RabbitMQ (Chapter 11).
Each style has its benefits and drawbacks to be aware of as a developer or architect. We’ll cover the trade-offs of each API style in detail. One additional aspect this book covers, often overlooked, is the role of network protocols in network-based APIs.
What’s Not in This Book
This book is not intended for a nontechnical audience. If you fall into this category and you’re looking for answers regarding API leadership, strategy, governance, compliance, and management, then consult APIs: A Strategy Guide by Daniel Jacobson et al. (O’Reilly, 2011) and Continuous API Management by Mehdi Medjaoui et al. (O’Reilly, 2021).
Furthermore, this book doesn’t cover topics like API architecture, platforms, and monetization. To learn more about these topics, consult books like Mastering API Architecture by James Gough et al. (O’Reilly, 2022) and API Management: An Architect’s Guide to Developing and Managing APIs for Your Organization by Brajesh De (Apress, 2017).
About the Author
Lukasz Dynowski is an independent consultant with over 10 years of expertise in IT. He has held numerous positions and responsibilities, including full-stack developer, DevOps engineer, software architect, and many others. Lukasz has a scientific background; he spent several years in academia as a coauthor and contributor to scientific papers. Lukasz won and judged O’Reilly’s Software Architectural Katas and ranks among the top 0.1% developers on Stack Overflow. He is a Docker Captain and the biggest geek you’d ever meet. He is a devoted husband and father to two lovely kids.
Marcin Dulak has over 20 years of experience in IT. He developed quantum modeling algorithms, including porting code to high-performance computing architectures. He acquired expertise in implementing and operating on-premises and cloud infrastructure, focusing most recently on web applications. When at home, he enjoys time with his family and cats.









