Book description
A practical, comprehensive, and user-friendly approach to building microservices in Spring
About This Book
Update existing applications to integrate reactive streams released as a part of Spring 5.0
Learn how to use Docker and Mesos to push the boundaries and build successful microservices
Upgrade the capability model to implement scalable microservices
Who This Book Is For
This book is ideal for Spring developers who want to build cloud-ready, Internet-scale applications, and simple RESTful services to meet modern business demands.
What You Will Learn
Familiarize yourself with the microservices architecture and its benefits
Find out how to avoid common challenges and pitfalls while developing microservices
Use Spring Boot and Spring Cloud to develop microservices
Handle logging and monitoring microservices
Leverage Reactive Programming in Spring 5.0 to build modern cloud native applications
Manage internet-scale microservices using Docker, Mesos, and Marathon
Gain insights into the latest inclusion of Reactive Streams in Spring and make applications more resilient and scalable
In Detail
The Spring Framework is an application framework and inversion of the control container for the Java platform. The framework’s core features can be used by any Java application, but there are extensions to build web applications on top of the Java EE platform.
This book will help you implement the microservice architecture in Spring Framework, Spring Boot, and Spring Cloud. Written to the latest specifications of Spring that focuses on Reactive Programming, you’ll be able to build modern, internet-scale Java applications in no time. The book starts off with guidelines to implement responsive microservices at scale. Next, you will understand how Spring Boot is used to deploy serverless autonomous services by removing the need to have a heavyweight application server.
Later, you’ll learn how to go further by deploying your microservices to Docker and managing them with Mesos. By the end of the book, you will have gained more clarity on the implementation of microservices using Spring Framework and will be able to use them in internet-scale deployments through real-world examples.
Style and approach
The book takes a step-by-step approach on developing microservices using Spring Framework, Spring Boot, and a set of Spring Cloud components that will help you scale your applications.
Table of contents
- Preface
-
Demystifying Microservices
- Evolution of microservices
- What are Microservices?
- Microservices - The honeycomb analogy
- Principles of microservices
- Characteristics of microservices
- Microservices examples
-
Microservices benefits
- Supports polyglot architecture
- Enables experimentation and innovation
- Elastically and selectively scalable
- Allows substitution
- Enables to build organic systems
- Helps managing technology debt
- Allowing co-existence of different versions
- Supporting building self-organizing systems
- Supporting event-driven architecture
- Enables DevOps
- Summary
-
Related Architecture Styles and Use Cases
- Service-Oriented Architecture (SOA)
-
Twelve-Factor Apps
- Single code base
- Bundle dependencies
- Externalizing configurations
- Backing services are addressable
- Isolation between build, release, and run
- Stateless, shared nothing processes
- Expose services through port bindings
- Concurrency for scale out
- Disposability, with minimal overhead
- Development, production parity
- Externalizing logs
- Package admin processes
- Serverless computing
- Lambda architecture
- DevOps, Cloud, and Containers
- Reactive microservices
- Microservice use cases
- Microservices early adopters - Is there a common theme?
- Microservice frameworks
- Summary
-
Building Microservices with Spring Boot
- Setting up a development environment
- Spring Boot for building RESTful microservices
- Getting started with Spring Boot
- Developing a Spring Boot microservice
- Developing our first Spring Boot microservice
- HATEOAS-enabled Spring Boot microservice
- Reactive Spring Boot microservices
- Implementing security
- Enabling cross origin for microservices interactions
- Spring Boot actuators for microservices instrumentation
- Documenting microservices
- Putting it all together - Developing a customer registration microservice example
- Summary
-
Applying Microservices Concepts
-
Microservice design guidelines
- Deciding microservice boundaries
- Designing communication styles
- Orchestration of microservices
- How many endpoints - one or many?
- How many microservices per VM - one or multiple?
- Rules engine - shared or embedded?
- Role of BPM and workflows
- Can microservices share a data store?
- Can microservices be headless?
- Deciding transaction boundaries
- Service endpoint design consideration
- Handling shared libraries
- User interfaces in microservices
- Use of API gateways in microservices
- Use of ESB and iPaaS with microservices
- Service versioning considerations
- Design for cross origin
- Handling shared reference data
- Microservices and bulk operations
- Summary
-
Microservice design guidelines
- Microservices Capability Model
-
Microservices Evolution – A Case Study
- Understanding the PSS application
- Death of the monolith
-
Microservices to the rescue - a planned approach for migration
- The business case
- Migration approach
- Identification of microservices' boundaries
- Analyze dependencies
- Prioritizing microservices for migration
- Data synchronization during migration
- Managing reference data
- User interfaces and web applications
- Test strategy
- Building ecosystem capabilities
- Migrate modules only if required
- Internal layering of microservices
- Orchestrating microservices
- Integration with other systems
- Managing shared libraries
- Handling exceptions
- Target implementation
- Potential next steps
- Summary
-
Scale Microservices with Spring Cloud Components
- What is Spring Cloud?
- Spring Cloud releases
- Setting up the environment for the BrownField PSS
-
Spring Cloud Config
- Building microservices with Config Server
- Setting up the Config Server
- Understanding the Config Server URL
- Handling configuration changes
- Spring Cloud Bus for propagating configuration changes
- Setting up high availability for the Config Server
- Monitoring Config Server health
- Config Server for configuration files
- Completing changes to use Config Server
- Eureka for registration and discovery
- Zuul proxy as the API Gateway
- Streams for reactive microservices
- Protecting microservices with Spring Cloud Security
- Summarising the BrownField PSS architecture
- Summary
- Logging and Monitoring Microservices
-
Containerizing Microservices with Docker
- Understanding gaps in the BrownField PSS microservices
- What are containers?
- Difference between VM and containers
- Benefits of containers
- Microservices and containers
- Introduction to Docker
- Deploying microservices into Docker
- Running RabbitMQ on Docker
- Using the Docker registry
- Microservices on Cloud
- Running BrownField services on EC2
- Future of containerization
- Summary
- Scaling Dockerized Microservices with Mesos and Marathon
-
Microservice Development Life Cycle
-
Practice points for microservice development
- Understanding business motivation and value
- Change the mindset from project to product development
- Choosing the right development philosophy
- Using the concept of minimum viable product (MVP)
- Overcoming the legacy hotspot
- Establishing self-organizing teams
- Building the self-service cloud
- Building a microservices ecosystem
- DevOps as a life cycle process
- Value driven planning
- Continuous monitoring and feedback
-
Automating development cycle
- Development
- Integration
-
Testing
- Sanity tests
- Regression testing
- Functional testing
- Acceptance testing
- Performance testing
- Real user flow simulation or Journey testing
- Security testing
- Exploratory testing
- A/B testing, Canary testing, and blue-green deployments
- Other non-functional tests
- Testing in production (TiP)
- Antifragility testing
- Deployment
- Monitoring and feedback
- Configuration management
- Microservices development governance, reference architectures, and libraries
- Summary
-
Practice points for microservice development
Product information
- Title: Spring 5.0 Microservices - Second Edition
- Author(s):
- Release date: July 2017
- Publisher(s): Packt Publishing
- ISBN: 9781787127685
You might also like
book
Beginning Spring Boot 2: Applications and Microservices with the Spring Framework
Learn Spring Boot and how to build Java-based enterprise, web, and microservice applications with it. In …
video
Modern Java Web Applications with Spring Boot 2.x
Building web application has been a challenge for many Java developers because of the complexities of …
book
Modern API Development with Spring and Spring Boot
A developer's guide to designing, testing, and securing production-ready modern APIs with the help of practical …
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 …