Restful Web API Patterns and Practices Cookbook
by Mike Amundsen
Copyright 2022 Amundsen.com, Inc. All rights reserved.
Printed in the United States of America.
Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com .
- Acquisitions Editor: Melissa Duffield
- Development Editor: Angela Rufino
- Production Editor: Katherine Tozer
- Interior Designer: David Futato
- Cover Designer: Karen Montgomery
- Illustrator: Kate Dullea
Revision History for the Early Release
- 2021-06-23: First Release
- 2021-10-15: Second Release
- 2021-12-16: Third Release
- 2022-04-08: Fourth Release
- 2022-06-21: Fifth Release
See http://oreilly.com/catalog/errata.csp?isbn=9781098106744 for release details.
The OReilly logo is a registered trademark of OReilly Media, Inc. Restful Web API Patterns and Practices Cookbook, the cover image, and related trade dress are trademarks of OReilly Media, Inc.
The views expressed in this work are those of the author, and do not represent the publishers views. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
978-1-098-10667-6
Preface
A Note for Early Release Readers
With Early Release ebooks, you get books in their earliest formthe authors raw and unedited content as they writeso you can take advantage of these technologies long before the official release of these titles.
This will be the preface of the final book. Please note that the GitHub repo will be made active later on.
If you have comments about how we might improve the content and/or examples in this book, or if you notice missing material within this chapter, please reach out to the author at .
Welcome to the world of RESTful Web API Patterns and Practices Cookbook
Thats quite a monikerone worth explaining and exploring. And thats what well be doing in this preface. I will tell you now that Im going to break the rules a bit and include a substantial amount of pertinent text in the front matter of this book (front matter is all these pages with roman numerals as page numbers). Ill save the details for the next section (). So, before we dig into the details, lets first take care of some housekeeping.
About This Book
The goal of this book is to enable software designers, architects, developers, and maintainers to build microservices that take advantage of the strengths of the web while lowering the costs and risks of creating reliable high-level services that hold dependencies on other APIs and services reachable only over the network.
To do that, Ive gathered together a collection of more than 70 recipes and patterns that Ive learned and used over the several decades Ive spent helping clients design, build, and deploy successful business services on the open web. I suspect readers will be familiar with at least some of the recipes youll find herepossibly by other names or in different forms. I also hope that readers will find novel approaches to similar problems.
Note
Over the years, Ive found that the challenges of software design rarely change. The solutions to those problems change frequently based on technology advances and fashion trends. Well focus on the challenges in this book and Ill leave the up-to-date technology and fashion choices to the reader.
Since this is a pattern book, there wont be much runnable code here. There will, however, be lots of diagrams, code snippets, and network message examples along with explanations identifying the problem. The challenges and the discussion will always be technology and platform agnostic. The recipes here are presented in a way that youll be able to translate them into code and components that will work within your target environment.
Who Should Read This Book
The primary audience for the book are the people tasked with planning, architecting, and implementing microservices. For some, that will mean focusing on creating enterprise-wide service producers and consumers. For others, it will mean building services that can live on the open web and run in a scalable and reliable way for consumers across the globe.
Whether you are hosting your solutions locally on your own hardware or creating software that will run in the cloud, the recipes here will help you understand the challenge and will offer a set of techniques for anticipating problems and building in recovery to handle cases where the unanticipated occurs.
Whats Covered
Since the book is meant to be useful to a wide audience, Ive divided it into chapters focused on related topics. Each chapter also starts with general prose laying out the common challenges for each topic as well as general concepts you can use as a guide throughout the chapter. This initial introduction to the topic is then followed by a set of individual, self-contained recipes that you can use to meet particular challenges as you design, build, and deploy your microservices.
Below is a quick listing of the chapters and what they cover.
Part 1 : Thinking in Hypermedia
The opening chapters ( and [Link to Come]) describe the foundation that underpins all the recipes in the book. They are a mix of history, philosophy, and pragmatic thinking. These are the ideas and principles that animate all the recipes in the book and reflect the lessons Ive learned over the years of designing, building, and supporting network software applications running on the web.
: Introducing RESTful Web Microservices
This is a general overview of the rationale and history behind the selected recipes in this book. It includes 1) a section answering the question what are RESTful Web Microservices (RWMs), 2) why hypermedia plays such an important role in the creation of RWMs, and 3) some base-level shared principles that guide the selection and explanation of the recipes in this book. This chapter sets the table for all the material that follows.
[Link to Come] : Thinking and Designing in Hypermedia
This chapter explors the background of hypermedia-driven distributed systems that form the foundation for web applications. Each of the recipe collections covered in Volume II (design, clients, services, data, and workflow) are explored with a mix of history, philosphy and pragmatic thinking. Reading this chapter will help you understand some of the key design ideas and technical basis for all the patterns and practices outlined in the rest of the book.
Part 2 : Pattern and Recipe Catalog