Restful Web API Patterns and Practices Cookbook

Book description

Many organizations today orchestrate and maintain apps that rely on other people's services. Software designers, developers, and architects in those companies often work to coordinate and maintain apps based on existing microservices, including third-party services that run outside their ecosystem. This cookbook provides proven recipes to help you get those many disparate parts to work together in your network.

Author Mike Amundsen provides step-by-step solutions for finding, connecting, and maintaining applications designed and built by people outside the organization. Whether you're working on human-centric mobile apps or creating high-powered machine-to-machine solutions, this guide shows you the rules, routines, commands, and protocols--the glue--that integrates individual microservices so they can function together in a safe, scalable, and reliable way.

  • Design and build individual microservices that can successfully interact on the open web
  • Increase interoperability by designing services that share a common understanding
  • Build client applications that can adapt to evolving services without breaking
  • Create resilient and reliable microservices that support peer-to-peer interactions on the web
  • Use web-based service registries to support runtime "find-and-bind" operations that manage external dependencies in real time
  • Implement stable workflows to accomplish complex, multiservice tasks consistently

Publisher resources

View/Submit Errata

Table of contents

  1. Preface
    1. About This Book
    2. Conventions Used in This Book
    3. Using Code Examples
    4. O’Reilly Online Learning
    5. How to Contact Us
  2. Acknowledgements
  3. Understanding RESTful Hypermedia
  4. 1. Introducing RESTful Web Microservices
    1. 1.1. What Are RESTful Web Microservices?
    2. Why Hypermedia?
    3. Shared Principles for Scalable Services on the Web
  5. Hypermedia Pattern Catalog
  6. 2. Hypermedia Design Patterns
    1. 2.1. Designing Building Block Interfaces (XXX)
    2. 2.2. Creating Interoperability with Registered Media Types
    3. 2.3. Ensuring Future Compatibility with Structured Media Types (SMTs)
    4. 2.4. Sharing Domain Specifics Via Published Vocabularies
    5. 2.5. Describing Problem Spaces with Semantic Profiles
    6. 2.6. Expressing Domain Actions at Run-time with Embedded Hypermedia
    7. 2.7. Designing Consistent Data Writes with Idempotent Actions
  7. 3. Hypermedia Client Patterns
    1. 3.1. Limiting the use of Hard-Coded URLs
    2. 3.2. Code Clients to be HTTP-Aware
    3. 3.3. Coding More Resilient Clients With Message-Centric Implementations
    4. 3.4. Coding Effective Clients to Understand Registered Vocabulary Profiles
    5. 3.5. Negotiate for Profile Support at Runtime
    6. 3.6. Managing Representation Formats At Runtime
    7. 3.7. Using Schema Documents as a Source of Message Metadata
    8. 3.8. Every Important Element Within a Response Needs an Identitifer
    9. 3.9. Relying on Hypermedia Controls In the Response
    10. 3.10. Supporting Links and Forms for Non-Hypermedia Services
    11. 3.11. Validating Data Properties At Runtime
    12. 3.12. Using Document Schemas to Validate Outgoing Messages
    13. 3.13. Using Document Queries to Validate Incoming Messages
    14. 3.14. Validating Incoming Data
    15. 3.15. Maintaining Your Own State
    16. 3.16. Having A Goal In Mind
  8. 4. Hypermedia Service Patterns
    1. Supporting Stability and Modifiability with Hypermedia Services
    2. 4.1. Publishing at Least One Stable URL
    3. 4.2. Preventing Internal Model Leaks
    4. 4.3. Converting Internal Models to External Messages
    5. 4.4. Expressing Internal Functions as External Actions
    6. 4.5. Advertising Support for Client Preferences for Responses
    7. 4.6. Supporting HTTP Content Negotiation
    8. 4.7. Publishing Complete Vocabularies for Machine Clients
    9. 4.8. Supporting Shared Vocabularies in Standard Formats
    10. 4.9. Publishing Service Definition Documents
    11. 4.10. Publishing API Metadata
    12. 4.11. Supporting Service Health Monitoring
    13. 4.12. Standardizing Error Reporting
    14. 4.13. Increasing Throughput with Client-Supplied Identifiers
    15. 4.14. Improving Reliability with Idempotent Create
    16. 4.15. Supporting Interoperability with Service-to-Service State Transfers
    17. 4.16. Providing Runtime Fallbacks for Dependent Services
    18. 4.17. Using Semantic Proxies to Access Non-Compliant Services
  9. 5. Distributed Data Patterns
    1. Supporting Distributed Data
    2. 5.1. Hiding Data Technology
    3. 5.2. Making All Changes Idempotent
    4. 5.3. Hide Data Relationships for External Actions
    5. 5.4. Leveraging HTTP URLs to Support “Contains” and “And” Queries
    6. 5.5. Returning Metadata for Query Responses
    7. 5.6. Returning HTTP 200 vs. HTTP 400 for Data-Centric Queries
    8. 5.7. Using Media Types for Data Queries
    9. 5.8. Using Pass-Through Proxies for Data Exchange
    10. 5.9. Ignore Unknown Data Fields
    11. 5.10. Improving Performance with Caching Directives
    12. 5.11. Modifying Data Models In Production
    13. 5.12. Extending Remote Data Stores
    14. 5.13. Limiting Large Scale Responses
  10. About the Author

Product information

  • Title: Restful Web API Patterns and Practices Cookbook
  • Author(s): Mike Amundsen
  • Release date: October 2022
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098106744