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 ...

Get Hands-On RESTful API Design Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.