Book Image

Hands-On Microservices with Spring Boot and Spring Cloud

By : Magnus Larsson
Book Image

Hands-On Microservices with Spring Boot and Spring Cloud

By: Magnus Larsson

Overview of this book

Microservices architecture allows developers to build and maintain applications with ease, and enterprises are rapidly adopting it to build software using Spring Boot as their default framework. With this book, you’ll learn how to efficiently build and deploy microservices using Spring Boot. This microservices book will take you through tried and tested approaches to building distributed systems and implementing microservices architecture in your organization. Starting with a set of simple cooperating microservices developed using Spring Boot, you’ll learn how you can add functionalities such as persistence, make your microservices reactive, and describe their APIs using Swagger/OpenAPI. As you advance, you’ll understand how to add different services from Spring Cloud to your microservice system. The book also demonstrates how to deploy your microservices using Kubernetes and manage them with Istio for improved security and traffic management. Finally, you’ll explore centralized log management using the EFK stack and monitor microservices using Prometheus and Grafana. By the end of this book, you’ll be able to build microservices that are scalable and robust using Spring Boot and Spring Cloud.
Table of Contents (26 chapters)
Title Page

Software enablers

As we've already mentioned, we have a number of very good open-source tools that can help us both meet our expectations of microservices and, most importantly, handle the new challenges that come with them:

  • Spring Boot
  • Spring Cloud/Netflix OSS
  • Docker
  • Kubernetes
  •  Istio (a service mesh)

The following table maps the design patterns we will need to handle these challenges, along with the corresponding open-source tool that implements the design pattern:

Design Pattern Spring Boot Spring Cloud Kubernetes Istio

Service discovery

Netflix Eureka and Netflix Ribbon Kubernetes kube-proxy and service resources

Edge server

Spring Cloud and Spring Security OAuth Kubernetes Ingress controller Istio ingress gateway

Reactive microservices

Spring Reactor and Spring WebFlux

Central configuration

Spring Config Server Kubernetes ConfigMaps and Secrets

Centralized log analysis

Elasticsearch, Fluentd, and Kibana
Note: Actually not part of Kubernetes
but can easily be deployed and configured together with Kubernetes

Distributed tracing

Spring Cloud Sleuth and Zipkin Jaeger

Circuit Breaker

Resilience4j Outlier detection

Control loop

Kubernetes controller manager
Centralized monitoring and alarms Grafana and Prometheus
Note: Actually not part of Kubernetes
but can easily be deployed and configured  together with Kubernetes
Kiali, Grafana, and Prometheus

 

Please note that Spring Cloud, Kubernetes, and Istio can be used to implement some design patterns, such as service discovery, edge server, and central configuration. We will discuss the pros and cons of using these alternatives later in this book.

Now, let's look at some other important things that we need to take into consideration.