Book Image

Hands-On RESTful API Design Patterns and Best Practices

By : Anupama Murali, Harihara Subramanian J, Pethuru Raj
Book Image

Hands-On RESTful API Design Patterns and Best Practices

By: Anupama Murali, Harihara Subramanian J, Pethuru Raj

Overview of this book

This book deals with the Representational State Transfer (REST) paradigm, which is an architectural style that allows networked devices to communicate with each other over the internet. With the help of this book, you’ll explore the concepts of service-oriented architecture (SOA), event-driven architecture (EDA), and resource-oriented architecture (ROA). This book covers why there is an insistence for high-quality APIs toward enterprise integration. It also covers how to optimize and explore endpoints for microservices with API gateways and touches upon integrated platforms and Hubs for RESTful APIs. You’ll also understand how application delivery and deployments can be simplified and streamlined in the REST world. The book will help you dig deeper into the distinct contributions of RESTful services for IoT analytics and applications. Besides detailing the API design and development aspects, this book will assist you in designing and developing production-ready, testable, sustainable, and enterprise-grade APIs. By the end of the book, you’ll be empowered with all that you need to create highly flexible APIs for next-generation RESTful services and applications.
Table of Contents (13 chapters)

Best practices for REST-based microservices

In this section, we'll discuss a few best practices that make your MSA developer-friendly, so they can manage and track errors easily:

  • Meaningful names: It's always important to provide a meaningful name in the request header, so if any problem, such as performance degradation, memory wastage, or a spike in user load, occurs, developers and performance engineers can easily understand from which microservice this request was originated and cascaded. It's therefore a best practice to provide the logical name/{service id} in the User-Agent property in the request header, for example, User-Agent:EmployeeSearchService.
  • API management: In the REST-based microservice architecture, one microservice accesses another microservice via an API. The API acts as a facade to other microservices. Therefore, it's mandatory to build...