Chapter 1. Escaping monolithic hell
1.1. The slow march toward monolithic hell
1.1.1. The architecture of the FTGO application
1.2. Why this book is relevant to you
1.3. What you’ll learn in this book
1.4. Microservice architecture to the rescue
1.4.1. Scale cube and microservices
1.4.2. Microservices as a form of modularity
1.4.3. Each service has its own database
1.5. Benefits and drawbacks of the microservice architecture
1.6. The Microservice architecture pattern language
1.6.1. Microservice architecture is not a silver bullet
1.6.2. Patterns and pattern languages
1.6.3. Overview of the Microservice architecture pattern language
1.7. Beyond microservices: Process and organization
1.7.1. Software development and delivery organization
Chapter 2. Decomposition strategies
2.1. What is the microservice architecture exactly?
2.1.1. What is software architecture and why does it matter?
2.1.2. Overview of architectural styles
2.1.3. The microservice architecture is an architectural style
2.2. Defining an application’s microservice architecture
2.2.1. Identifying the system operations
2.2.2. Defining services by applying the Decompose by business capability pattern
2.2.3. Defining services by applying the Decompose by sub-domain pattern
2.2.4. Decomposition guidelines
2.2.5. Obstacles to decomposing an application into services
Chapter 3. Interprocess communication in a microservice architecture
3.1. Overview of interprocess communication in a microservice architecture
3.2. Communicating using the synchronous Remote procedure invocation pattern
3.2.3. Handling partial failure using the Circuit breaker pattern
3.3. Communicating using the Asynchronous messaging pattern
3.3.2. Implementing the interaction styles using messaging
3.3.3. Creating an API specification for a messaging-based service API
3.3.5. Competing receivers and message ordering
3.3.6. Handling duplicate messages
3.4. Using asynchronous messaging to improve availability
Chapter 4. Managing transactions with sagas
4.1. Transaction management in a microservice architecture
4.1.1. The need for distributed transactions in a microservice architecture
4.3. Handling the lack of isolation
4.4. The design of the Order Service and the Create Order Saga
4.4.2. The implementation of the Create Order Saga
Chapter 5. Designing business logic in a microservice architecture
5.1. Business logic organization patterns
5.1.1. Designing business logic using the Transaction script pattern
5.1.2. Designing business logic using the Domain model pattern
5.2. Designing a domain model using the DDD aggregate pattern
5.2.1. The problem with fuzzy boundaries
5.3.1. Why publish change events?
5.3.2. What is a domain event?
5.3.4. Identifying domain events
5.4. Kitchen Service business logic
5.5. Order Service business logic
Chapter 6. Developing business logic with event sourcing
6.1. Developing business logic using event sourcing
6.1.1. The trouble with traditional persistence
6.1.2. Overview of event sourcing
6.1.3. Handling concurrent updates using optimistic locking
6.1.4. Event sourcing and publishing events
6.1.5. Using snapshots to improve performance
6.1.6. Idempotent message processing
6.2. Implementing an event store
6.3. Using sagas and event sourcing together
6.3.1. Implementing choreography-based sagas using event sourcing
6.3.2. Creating an orchestration-based saga
6.3.3. Implementing an event sourcing-based saga participant
Chapter 7. Implementing queries in a microservice architecture
7.1. Querying using the API composition pattern
7.1.1. The findOrder() query operation
7.1.2. Overview of the API composition pattern
7.1.3. Implementing the findOrder() query operation using the API composition pattern
7.1.4. API composition design issues
7.1.5. The benefits and drawbacks of the API composition pattern
7.3.1. Choosing a view datastore
7.4. Implementing a CQRS view with AWS DynamoDB
7.4.1. The OrderHistoryEventHandlers module
Chapter 8. External API patterns
8.1. External API design issues
8.2.1. Overview of the API gateway pattern
8.2.2. Benefits and drawbacks of an API gateway
8.3. Implementing an API gateway
8.3.1. Using an off-the-shelf API gateway product/service
Chapter 9. Testing microservices: Part 1
9.1. Testing strategies for microservice architectures
9.2. Writing unit tests for a service
9.2.1. Developing unit tests for entities
9.2.2. Writing unit tests for value objects
9.2.3. Developing unit tests for sagas
9.2.4. Writing unit tests for domain services
Chapter 10. Testing microservices: Part 2
10.1. Writing integration tests
10.1.1. Persistence integration tests
10.1.2. Integration testing REST-based request/response style interactions
10.1.3. Integration testing publish/subscribe-style interactions
10.1.4. Integration contract tests for asynchronous request/response interactions
10.2. Developing component tests
10.2.1. Defining acceptance tests
10.2.2. Writing acceptance tests using Gherkin
10.3. Writing end-to-end tests
10.3.1. Designing end-to-end tests
Chapter 11. Developing production-ready services
11.1. Developing secure services
11.1.1. Overview of security in a traditional monolithic application
11.1.2. Implementing security in a microservice architecture
11.2. Designing configurable services
11.3. Designing observable services
11.3.1. Using the Health check API pattern
11.3.2. Applying the Log aggregation pattern
11.3.3. Using the Distributed tracing pattern
11.3.4. Applying the Application metrics pattern
11.4. Developing services using the Microservice chassis pattern
Chapter 12. Deploying microservices
12.1. Deploying services using the Language-specific packaging format pattern
12.1.1. Benefits of the Service as a language-specific package pattern
12.1.2. Drawbacks of the Service as a language-specific package pattern
12.2. Deploying services using the Service as a virtual machine pattern
12.3. Deploying services using the Service as a container pattern
12.3.1. Deploying services using Docker
12.4. Deploying the FTGO application with Kubernetes
12.4.1. Overview of Kubernetes
12.4.2. Deploying the Restaurant service on Kubernetes
12.4.3. Deploying the API gateway
12.4.4. Zero-downtime deployments
12.4.5. Using a service mesh to separate deployment from release
12.5. Deploying services using the Serverless deployment pattern
12.5.1. Overview of serverless deployment with AWS Lambda
12.5.2. Developing a lambda function
12.5.3. Invoking lambda functions
12.6. Deploying a RESTful service using AWS Lambda and AWS Gateway
12.6.1. The design of the AWS Lambda version of Restaurant Service
12.6.2. Packaging the service as ZIP file
12.6.3. Deploying lambda functions using the Serverless framework
Chapter 13. Refactoring to microservices
13.1. Overview of refactoring to microservices
13.2. Strategies for refactoring a monolith to microservices
13.2.1. Implement new features as services
13.3. Designing how the service and the monolith collaborate
13.3.1. Designing the integration glue
13.3.2. Maintaining data consistency across a service and a monolith
13.4. Implementing a new feature as a service: handling misdelivered orders
13.4.1. The design of Delayed Delivery Service
13.4.2. Designing the integration glue for Delayed Delivery Service
13.5. Breaking apart the monolith: extracting delivery management
13.5.1. Overview of existing delivery management functionality
13.5.2. Overview of Delivery Service
13.5.3. Designing the Delivery Service domain model
13.5.4. The design of the Delivery Service integration glue
13.5.5. Changing the FTGO monolith to interact with Delivery Service
Application architecture patterns
Reliable communications patterns
Transactional messaging patterns
Business logic design patterns