3 Designing and managing microservice APIs
This chapter covers
- Types of web APIs, and protocols and their main features
- Defining the application boundaries
- Strategies for decomposing an application into microservices
- Managing APIs using the principles of API governance
- Using documentation-driven development to improve the API development process
We can use a great variety of protocols and technologies to implement our microservices web APIs. It is important that we know and understand what our choices are so that we can make the best decisions for our APIs. In this chapter, we begin by studying the main types of web APIs and protocols that we can use to implement web interfaces for our microservices, and we examine their advantages and constraints.
We also discuss two different techniques that we can use to decompose our system into microservices: decomposition by business capability and decomposition by subdomains. Service decomposition is a fundamental step in the design of our microservices strategy, since it helps us define applications with clear boundaries, well-defined scopes, and explicit responsibilities. A well-designed microservices architecture is essential to reduce the risk of ending up with a distributed monolith instead. We will see how the concepts of Domain Driven Design (DDD) can help us in this process, and what elements we need to take into account when defining the scope of a service.