Chapter 2. Building microservices with Spring Boot

 

This chapter covers

  • Learning the key characteristics of a microservice
  • Understanding how microservices fit into a cloud architecture
  • Decomposing a business domain into a set of microservices
  • Implementing a simple microservice using Spring Boot
  • Understanding the perspectives for building microservice-based applications
  • Learning when not to use microservices

The history of software development is littered with the tales of large development projects that after an investment of millions of dollars and hundreds of thousands of software developer hours, and with many of the best and brightest minds in the industry working on them, somehow never managed to deliver anything of value to their customers and literally collapsed under their own complexity and weight.

These mammoth projects tended to follow large, traditional waterfall development methodologies that insisted that all the application’s requirements and design be defined at the beginning of the project. So much emphasis was placed on getting all the specifications for the software “correct” that there was little leeway to meet new business requirements, or refactor and learn from mistakes made in the early stages of development.

2.1. The architect’s story: designing the microservice architecture

2.1.1. Decomposing the business problem

2.1.2. Establishing service granularity

2.1.3. Talking to one another: service interfaces

2.2. When not to use microservices

2.2.1. Complexity of building distributed systems

2.2.2. Server sprawl

2.2.3. Type of application

2.2.4. Data transformations and consistency

2.3. The developer’s tale: building a microservice with Spring Boot and Java

2.3.1. Getting started with the skeleton project

2.3.2. Booting your Spring Boot application: writing the Bootstrap class

2.3.3. Building the doorway into the microservice: the Spring Boot controller

2.4. The DevOps story: building for the rigors of runtime

2.4.1. Service assembly: packaging and deploying your microservices

2.4.2. Service bootstrapping: managing configuration of your microservices

2.4.3. Service registration and discovery: how clients communicate with - your microservices

2.4.4. Communicating a microservice’s health

2.5. Pulling the perspectives together

2.6. Summary