3 Building microservices with Spring Boot

 

This chapter covers

  • Understanding how microservices fit into a cloud architecture
  • Decomposing a business domain into a set of microservices
  • Understanding the perspectives for building microservice apps
  • Learning when not to use microservices
  • Implementing a microservice

To successfully design and build microservices, you need to approach them as if you’re a police detective interviewing witnesses to a crime. Although each witness sees the same event, their interpretation of the crime is shaped by their background, what’s important to them (for example, what motivates them), and what environmental pressures were brought to bear at the moment they witnessed the event. Witnesses each have their own perspective (and bias) on what they consider essential.

Like successful police detectives trying to get to the truth, the journey to build a successful microservice architecture involves incorporating the perspectives of multiple individuals within your software development organization. Because it takes more than technical people to deliver an entire application, we believe that the foundation for successful microservice development starts with the perspectives of three critical roles:

3.1 The architect’s story: Designing the microservice architecture

3.1.1 Decomposing the business problem

3.1.2 Establishing service granularity

3.1.3 Defining the service interfaces

3.2 When not to use microservices

3.2.1 Complexity when building distributed systems

3.2.2 Server or container sprawl

3.2.3 Application type

3.2.4 Data transactions and consistency

3.3 The developer’s tale: Building a microservice with Spring Boot and Java

3.3.1 Building the doorway into the microservice: The Spring Boot controller

3.3.2 Adding internationalization into the licensing service

3.3.3 Implementing Spring HATEOAS to display related links

3.4 The DevOps story: Building for the rigors of runtime

3.4.1 Service assembly: Packaging and deploying your microservices

3.4.2 Service bootstrapping: Managing configuration of your microservices

Summary