Book description
Apply microservices patterns to build resilient and scalable distributed systems
Key Features
- Understand the challenges of building large-scale microservice landscapes
- Build cloud-native production-ready microservices with this comprehensive guide
- Discover how to get the best out of Spring Cloud, Kubernetes, and Istio when used together
Book Description
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.
What you will learn
- Build reactive microservices using Spring Boot
- Develop resilient and scalable microservices using Spring Cloud
- Use OAuth 2.0/OIDC and Spring Security to protect public APIs
- Implement Docker to bridge the gap between development, testing, and production
- Deploy and manage microservices using Kubernetes
- Apply Istio for improved security, observability, and traffic management
Who this book is for
This book is for Java and Spring developers and architects who want to learn how to break up their existing monoliths into microservices and deploy them either on-premises or in the cloud using Kubernetes as a container orchestrator and Istio as a service Mesh. No familiarity with microservices architecture is required to get started with this book.
Table of contents
- Title Page
- Copyright and Credits
- About Packt
- Contributors
- Preface
- Section 1: Getting Started with Microservice Development Using Spring Boot
-
Introduction to Microservices
- Technical requirements
- My way into microservices
- Defining a microservice
- Challenges with microservices
- Design patterns for microservices
- Software enablers
- Other important considerations
- Summary
- Introduction to Spring Boot
-
Creating a Set of Cooperating Microservices
- Technical requirements
- Introducing the microservice landscape
- Generating skeleton microservices
- Adding RESTful APIs
- Adding a composite microservice
- Adding error handling
- Testing APIs manually
- Adding automated microservice tests in isolation
- Adding semi-automated tests of a microservice landscape
- Summary
- Questions
- Deploying Our Microservices Using Docker
- Adding an API Description Using OpenAPI/Swagger
-
Adding Persistence
- Technical requirements
- But first, let's see where we are heading
- Adding a persistence layer to the core microservices
- Writing automated tests that focus on persistence
- Using the persistence layer in the service layer
- Extending the composite service API
- Adding databases to the Docker Compose landscape
- Manual tests of the new APIs and the persistence layer
- Updating the automated tests of the microservice landscape
- Summary
- Questions
-
Developing Reactive Microservices
- Technical requirements
- Choosing between non-blocking synchronous APIs and event-driven asynchronous services
- Developing non-blocking synchronous REST APIs using Spring
- Developing event-driven asynchronous services
- Running manual tests of the reactive microservice landscape
- Running automated tests of the reactive microservice landscape
- Summary
- Questions
- Section 2: Leveraging Spring Cloud to Manage Microservices
-
Introduction to Spring Cloud
- Technical requirements
- The evolution of Spring Cloud
- Using Netflix Eureka as a discovery service
- Using Spring Cloud Gateway as an edge server
- Using Spring Cloud Config for centralized configuration
- Using Resilience4j for improved resilience
- Using Spring Cloud Sleuth and Zipkin for distributed tracing
- Summary
- Questions
- Adding Service Discovery Using Netflix Eureka and Ribbon
- Using Spring Cloud Gateway to Hide Microservices Behind an Edge Server
-
Securing Access to APIs
- Technical requirements
- Introduction to OAuth 2.0 and OpenID Connect
- Securing the system landscape
- Adding an authorization server to our system landscape
- Protecting external communication with HTTPS
- Securing access to the discovery service, Netflix Eureka
- Authenticating and authorizing API access using OAuth 2.0 and OpenID Connect
- Testing with the local authorization server
-
Testing with an OpenID Connect provider – Auth0
- Setting up an account and OAuth 2.0 client in Auth0
- Applying the necessary changes to use Auth0 as an OpenID provider
- Running the test script with Auth0 as the OpenID Connect provider
- Acquiring access tokens using the password grant flow
- Acquiring access tokens using the implicit grant flow
- Acquiring access tokens using the authorization code grant flow
- Calling protected APIs using the Auth0 access tokens
- Getting extra information about the user
- Summary
- Questions
- Centralized Configuration
-
Improving Resilience Using Resilience4j
- Technical requirements
- Introducing the Resilience4j circuit breaker and retry mechanism
- Adding a circuit breaker and retry mechanism to the source code
- Trying out the circuit breaker and retry mechanism
- Summary
- Questions
- Understanding Distributed Tracing
- Section 3: Developing Lightweight Microservices Using Kubernetes
- Introduction to Kubernetes
- Deploying Our Microservices to Kubernetes
- Implementing Kubernetes Features as an Alternative
-
Using a Service Mesh to Improve Observability and Management
- Technical requirements
- Introduction to service mesh using Istio
- Deploying Istio in a Kubernetes cluster
- Creating the service mesh
- Observing the service mesh
- Securing a service mesh
- Ensuring that a service mesh is resilient
- Performing zero-downtime deployments
- Running tests with Docker Compose
- Summary
- Questions
- Centralized Logging with the EFK Stack
-
Monitoring Microservices
- Technical requirements
- Introduction to performance monitoring using Prometheus and Grafana
- Changes in source code for collecting application metrics
- Building and deploying the microservices
- Monitoring microservices using Grafana dashboards
- Setting up alarms in Grafana
- Summary
- Questions
- Other Books You May Enjoy
Product information
- Title: Hands-On Microservices with Spring Boot and Spring Cloud
- Author(s):
- Release date: September 2019
- Publisher(s): Packt Publishing
- ISBN: 9781789613476
You might also like
video
Master Microservices with Spring Boot and Spring Cloud
Beginning with the basics, this course covers the core principles of microservices architecture, contrasting it with …
book
Microservices with Spring Boot and Spring Cloud - Second Edition
Create and deploy production-quality microservices-based applications — New edition updated for the smooth running of Spring, …
video
Building Microservices with Spring Boot, Second Edition
7+ Hours of Video Instruction The term “microservices” has gained significant traction over the last few …
book
Practical Microservices Architectural Patterns: Event-Based Java Microservices with Spring Boot and Spring Cloud
Take your distributed applications to the next level and see what the reference architectures associated with …