
Microservices with Spring Boot and Spring Cloud
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
DESCRIPTION
Microservices has emerged as a powerful solution to build flexible, scalable, and resilient applications. This Book is the go-to-guide to understanding, designing, and implementing microservice architectures using Spring Boot. It takes you on a journey through the intricacies of microservices to create robust and efficient microservice-based applications.
This book helps you to understand the motivations and the entire process behind migrating from monolithic to microservice architectures. It covers essentials like REST basics, advanced topics such as centralized configuration, inter-service communication, Eureka Server, resilience mechanisms, security, and Docker deployment.
Readers will be equipped to effortlessly find and access instances within a microservice architecture without disrupting clients. You will delve into distributed tracing and its importance in monitoring the interactions among microservices. Finally, we will discuss strategies for ensuring the reliability of your microservices architecture.
Whether you're new to microservices or seeking to enhance your existing expertise, this book is your comprehensive guide to navigating the intricacies of modern application development. Embark on your microservices journey today and unlock the potential of Spring Boot in crafting efficient, scalable, and resilient software solutions.
TABLE OF CONTENTS
1. The Foundation
2. Decipher the unintelligible
3. Scale it down
4. Reflective Composition
5. Liaison among services
6. Location Transparency
7. Gateway API Services
8. Observability
9. Reliability
10. Keep It safe
11. Deployment
Appendix 1
Appendix 2
Index
More details
Content
- Cover Page
- Title Page
- Copyright Page
- Dedication Page
- About the Authors
- Technical Reviewers
- Acknowledgement
- Preface
- Errata
- Table of Contents
- 1. The Foundation
- Structure
- Framework: The savior
- Type of application
- Licensing of framework
- Design pattern
- Persistency
- Deployment process
- Scalability
- Learning curve
- Documented
- Community
- Introducing Spring framework
- Spring Boot: The solution
- Quick start
- Using CLI for creating Spring Boot project
- Installing CLI
- Using Spring Initializr
- Using IDE
- Integrating the STS plugin in the Eclipse
- Using STS
- Using Intellij
- Introducing Bootstrapping
- Exploring Runners
- Executing the application
- Working with properties
- Short visit to deploying to the server
- Conclusion
- 2. Decipher The Unintelligible
- Structure
- Basics of Application Development
- Need of a service
- Developing a simple REST service
- REST controller layer
- Updates for handling URL formats in Spring Boot 3.0
- Handling different media types
- Communicating with database
- Exception handling in the REST
- Using try-catch
- Using @ExceptionHandler
- Using @ControllerAdvice
- Writing self-descriptive messages
- Updates in logging
- Conclusion
- 3. Scale it Down
- Structure
- Getting acquainted with microservices
- Motivation to choose microservices
- Reduced code base complexity
- Development time
- Ease in deployment
- Availability
- Scaling
- Reusability
- Flexibility to use the right tool
- Quick development
- Infrastructural cost
- Continuous delivery
- Features of microservices
- Decoupling/flexibility
- Responsibility
- Independently deployable components
- Decentralized
- Resilient
- Migrating from monolithic to microservices
- Decomposing application
- Decompose based on business capabilities per team
- Decompose based on subdomain
- Decomposing the services by Single Responsibility Principle
- Limitations of microservices
- Complexity
- Network traffic
- Monitoring
- Conclusion
- 4. Reflective Composition
- Structure
- Approaching centralized configuration management
- Performing centralized configuration
- Exploring Cloud Config Server
- Selection of backends
- Vault Backend
- JDBC backend
- CredHub backend
- AWS Secrets Manager Backend
- AWS S3 Backend
- AWS Parameter Store Backend
- Composite environment repositories
- File System Backend
- Git Backend
- Locating the properties in GIT
- Configuring the client service to communicate with Config Server
- Internal process of locating the properties
- Using profiles
- Highly available Config Server
- Limitations in using a centralized configuration system
- Conclusion
- 5. Liaison Among Services
- Structure
- Revisiting microservice decomposition
- Shared database
- Database per service
- Saga
- API composition
- Command Query Responsibility Segregation (CQRS)
- Strategizing inter-service communication
- Synchronous communication
- Asynchronous communication
- Using RestTemplate for inter-service communication
- Drawbacks of RestTemplate
- Shifting from RestTemplate to Feign Client
- The working of Feign client
- Asynchronous call-back
- Publishing and subscribing based on the broker
- Polling-based communication
- Using a message broker to exchange message
- Destination binders
- Message
- Bindings
- Exchange
- Queue
- Publisher
- Subscriber
- Sending/consuming messages using functional programming
- Sending the message outside of Spring Cloud Stream context
- The deprecations
- Matching the demands
- Conclusion
- 6. Location Transparency
- Structure
- Revisiting matching demand
- Scalability
- Vertical scaling
- Horizontal scaling
- A quick trip to deployment
- Using RestTemplate as a load-balanced Client
- Locating the service
- Understanding ways of service discovery
- The client-side discovery
- The server-side discovery pattern
- Exploring Service discovery
- Ways of providing service registry
- Zookeeper
- Etcd
- Consul
- The discovery server
- Approaching location transparency using the Eureka discovery server
- Revisiting RestTemplate as load balanced client
- Feign client as load-balanced client
- REST endpoints exposed by Eureka
- Developing highly available Eureka
- Health checkups
- Altering the load balancer algorithm
- Load balancing based on zone
- Weighted load balancing
- Health check-based load balancing
- Request-based sticky session load balancing
- Conclusion
- 7. Gateway API Services
- Structure
- Exploring API server
- Need of API Gateway
- Security
- Logging
- Rate limiting
- Load balancing
- Request routing from a single point of entry
- Backends for frontends
- Route
- Predicate
- Filter
- Setting up gateway API for request routing
- Deep dive into the routing
- The After Route Predicate Factory
- The Before Route Predicate Factory
- The Between Route Predicate Factory
- The Cookie Route Predicate Factory
- The Header Route Predicate Factory
- The Host Route Predicate Factory
- The Method Route Predicate Factory
- The Query Route Predicate Factory
- The RemoteAddr Route Predicate Factory
- The Weight Route Predicate Factory
- The X-Forwarded Remote Addr Route Predicate Factory
- Point by point GatewayFilter factories
- AddRequestHeader GatewayFilter Factory
- AddRequestHeadersIfNotPresent GatewayFilter Factory
- AddRequestParameter GatewayFilter Factory
- AddResponseHeader GatewayFilter Factory
- DedupeResponseHeader GatewayFilter factory
- LocalResponseCache GatewayFilter Factory
- MapRequestHeader GatewayFilter Factory
- ModifyRequestBody GatewayFilter Factory
- ModifyResponsetBody GatewayFilter Factory
- PrefixPath GatewayFilter Factory
- PreserveHostHeader GatewayFilter Factory
- RedirectTo GatewayFilter Factory
- RemoveRequestHeader GatewayFilter Factory
- RemoveJsonAttributeResponseBody GatewayFilter factory
- RemoveRequestParameter GatewayFilter Factory
- RewritePath GatewayFilter Factory
- Introducing global filters
- Ordering GatewayFilter and GlobalFilter
- The ReactiveLoadBalancerClientFilter
- Conclusion
- 8. Observability
- Structure
- Application monitoring
- Importance of application monitoring
- Alerts
- Pinpoints bottlenecks
- Improves stability
- Digging into Actuator
- Customizing predefined endpoint
- Adding custom endpoint
- Deep dive into observability
- Loggers
- Metrics
- Customizing metrics
- Exploring distributed tracing
- Importance of distributed tracing
- Micrometer in brief
- Big picture with Zipkin
- Conclusion
- 9. Reliability
- Structure
- Understanding microservice reliability and its importance
- Reasons for service failures
- Overloaded traffic
- Unavailability of resources
- Deployment strategies
- Unavailability of services
- Approaches to handle failures
- Handling third-party services
- Hardware
- Setting up instances
- Exceptions and their handling
- Circuit breaker design pattern
- Types of circuit breaker
- Resilience4J as a savior
- Circuit breaker
- Failure rate and low call rate thresholds
- Circuit breaker with RestTemplate
- Circuit breaker with FeignClient
- Retry
- Rate limiting
- Bulkhead
- SemaphoreBulkhead
- ThreadPoolBulkhead
- TimeLimiter
- Applying multiple decorators for a single method
- Conclusion
- 10. Keep it Safe
- Structure
- Exposing resources
- Revealing secret
- Revisiting microservice architecture
- Exploring ways of securing microservices
- Issues while using passwords to grant access
- Understanding token-based security and their available options
- Types of tokens
- JWT token
- Digging into OAuth2 token
- OAuth or JWT
- Keycloak
- Setting up Keycloak
- Tokens and Feign Client
- Sending the authorization header within method arguments
- Sending the authorization header using RequestInterceptor
- Using TokenRelay
- Conclusion
- 11. Deployment
- Structure
- Revisiting microservices architecture
- Deployment patterns
- Using orchestrators
- Microservices as a serverless function
- Packaging services
- Packaging as JAR
- Packaging as WAR
- Packaging as Docker image
- Docker image
- Docker registry
- Docker Swarm
- Using Kubernetes to deploy services
- Ingress
- Demonstrating pod and service
- Conclusion
- Appendix 1
- Appendix 2
- Index
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.