Microservices in Action
Morgan Bruce, Paulo A. Pereira
  • MEAP began May 2017
  • Publication in August 2018 (estimated)
  • ISBN 9781617294457
  • 475 pages (estimated)
  • printed in black & white

Perfect fit for those who want to move their majestic monolith to a scalable microservice architecture.

Akshat Paul

Microservices in Action is a practical book about building and deploying microservice-based applications. Written for developers and architects with a solid grasp of service-oriented development, it tackles the challenge of putting microservices into production. You'll begin with an in-depth overview of microservice design principles, building on your knowledge of traditional systems. Then, you'll start creating a reliable road to production. You'll explore examples using Kubernetes, Docker, and Google Container Engine as you learn to build clusters and maintain them after deployment. Throughout this rich, experience-driven book, you'll move through real-world use cases including a continuous delivery pipeline, production monitoring, and practical techniques for scaling and maintaining a healthy system.

Table of Contents detailed table of contents

Part 1: The Lay of the Land

1. Designing and Running Microservices

1.1. What is a microservice application?

1.1.1. Scaling through decomposition

1.1.2. Key principles

1.1.3. Why use microservices?

1.2. What makes microservices challenging?

1.2.1. Design challenges

1.2.2. Operational challenges

1.3. Microservice development lifecycle

1.3.1. Designing microservices

1.3.2. Deploying microservices

1.3.3. Observing microservices

1.4. Responsible and “operationally aware” engineering culture

1.5. Summary

2. Microservices at SimpleBank

2.1. What does SimpleBank do?

2.2. Are microservices the right choice?

2.2.1. Risk and inertia in financial software

2.2.2. Reducing friction and delivering sustainable value

2.3. Building a new feature

2.3.1. Identifying microservices: modelling the domain well

2.3.2. Service collaboration

2.3.3. Service choreography

2.4. Exposing services to the world

2.5. Taking your feature to production

2.5.1. Stable and automated deployment

2.5.2. Transparency

2.6. Scaling up microservice development

2.6.1. Technical divergence

2.6.2. Isolation

2.7. What's next?

2.8. Summary

Part 2: Design

3. Architecture of a Microservices Application

3.1. Architecture as a whole

3.1.1. 3-tier architecture

3.1.2. 4-tier architecture

3.2. Aggregation Tier

3.2.1. API Gateways

3.2.2. Backends For Frontends

3.3. Event Backbone: More than just communicating

3.3.1. Reducing the need for orchestration

3.3.2. Events as a way of describing the system

3.3.3. Using events to replay the past

3.4. Benefits of decomposition

3.4.1. Geographically aware deployments

3.4.2. Data Sync: Who owns data?

3.5. Team Organization and Culture

3.5.1. Functional teams

3.5.2. Cross-functional Teams

3.5.3. Team Culture

3.6. Summary

4. Designing New Features

4.1. A new feature for SimpleBank

4.2. Scoping by business capabilities

4.2.1. Capabilities and domain modelling

4.2.2. Creating investment strategies

4.2.3. Nested contexts and services

4.2.4. Challenges and limitations

4.3. Scoping by use case

4.3.1. Placing investment strategy orders

4.3.2. Actions and stores

4.3.3. Orchestration and choreography

4.4. Scoping by volatility

4.5. Technical capabilities

4.5.1. Sending notifications

4.5.2. When to use technical capabilities?

4.6. Dealing with ambiguity

4.6.1. Start with coarse-grained services

4.6.2. Prepare for further decomposition

4.6.3. Retirement and migration

4.7. Service ownership in organizations

4.7.1. Promote an internal open-source model

4.7.2. Evaluate wider impact when faced with contentious decisions

4.8. Summary

5. Distributed and (A)synchronous

5.1. Case Study: Buying and selling shares

5.2. Time for a theorem: CAP

5.2.1. Consistency and Partition tolerance

5.2.2. Availability and Partition tolerance

5.2.3. Does it have to always be AP or CP?

5.3. Communication: Synchronous and Asynchronous

5.3.1. Orchestration and Choreography

5.3.2. Going async: benefits and challenges

5.4. Event-based systems

5.4.1. Event Streams

5.4.2. Event Sourcing and CQRS

5.5. Long running transactions and dealing with failure

5.5.1. Two-phase commit

5.5.2. Sagas

5.6. Summary

6. Designing Reliable Services

6.1. Defining reliability

6.2. What could go wrong?

6.2.1. Sources of failure

6.2.2. Cascading failures

6.3. Designing reliable communication

6.3.1. Retries

6.3.2. Fallbacks

6.3.3. Timeouts and deadlines

6.3.4. Circuit breakers

6.4. Maximizing service reliability

6.4.1. Load balancing and service health

6.4.2. Rate limits

6.4.3. Validating reliability and fault tolerance

6.5. Safety by default

6.5.1. Frameworks

6.5.2. Proxies

6.6. Summary

7. Building a Reusable Microservice Framework

7.1. A microservice chassis

7.2. What is the purpose of microservice chassis?

7.2.1. Reduce risk

7.2.2. Faster bootstrapping

7.3. Designing a chassis

7.3.1. Service discovery

7.3.2. Observability

7.3.3. Balancing and limiting

7.4. Exploring the feature implemented using the chassis

7.5. Wasn’t heterogeneity one of the promises of microservices?

7.6. Summary

Part 3: Deployment

8. Deploying Microservices

8.1. Why is deployment important?

8.1.1. Stability and availability

8.2. A microservice production environment

8.2.1. Features of a microservice production environment

8.2.2. Automation and speed

8.3. Deploying a service, the quick way

8.3.1. Service startup

8.3.2. Provisioning a virtual machine

8.3.3. Run multiple instances of your service

8.3.4. Adding a load balancer

8.3.5. What have we learnt?

8.4. Building service artifacts

8.4.1. What’s in an artifact?

8.4.2. Immutability

8.4.3. Types of service artifacts

8.4.4. Configuration

8.5. Service to host models

8.5.1. Single service to host

8.5.2. Multiple, static services per host

8.5.3. Multiple, scheduled services per host

8.6. Deploying services without downtime

8.6.1. Canaries and rolling deploys on GCE

8.7. Summary

9. Deployment with Containers and Schedulers

9.1. Containerizing a service

9.1.1. Working with images

9.1.2. Building our image

9.1.3. Running containers

9.1.4. Storing an image

9.2. Deploying to a cluster

9.2.1. Designing and running pods

9.2.2. Load balancing

9.2.3. A quick look under the hood

9.2.4. Health checks

9.2.5. Deploying a new version

9.2.6. Rolling back

9.2.7. Connecting multiple services

9.3. Summary

10. Building a Delivery Pipeline for Microservices

10.1. Making deploys “boring”

10.1.1. A deployment pipeline

10.2. Building a pipeline with Jenkins

10.2.1. Configuring a build pipeline

10.2.2. Building our image

10.2.3. Running tests

10.2.4. Publishing artefacts

10.2.5. Deploying to staging

10.2.6. Staging environments

10.2.7. Deploying to production

10.3. Building reusable pipeline steps

10.3.1. Procedural versus declarative build pipelines

10.4. The difference between deployment and releasing

10.4.1. Dark launches

10.4.2. Feature flags

10.5. Summary

Part 4: Monitoring & Observability

11. Building a monitoring system

11.1. A robust monitoring stack

11.1.1. Good monitoring is layered

11.1.2. Golden signals

11.1.3. Types of metrics

11.2. Monitoring SimpleBank with Prometheus and Grafana

11.2.1. Setting up our metric collection infrastructure

11.2.2. Collecting infrastructure metrics — RabbitMQ

11.2.3. Instrumenting SimpleBank’s Place Order

11.2.4. Setting up alerts

11.3. Raising sensible and actionable alerts

11.3.1. Who needs to know when something is wrong?

11.3.2. Symptoms, not causes

11.3.3. Avoiding alert fatigue

11.4. Observing the whole application

11.5. Summary

12. Using Logs and Traces to Understand Behavior

12.1. Understanding behavior across services

12.2. Generating consistent, structured, human-readable logs

12.2.1. Useful information to include in log entries

12.2.2. Structure and readability

12.3. Study: Setting up a logging infrastructure for Simplebank

12.3.1. ELK and Fluentd-based solution

12.3.2. Setting up our logging solution

12.3.3. Configure what logs to collect

12.3.4. Finding a needle in the haystack

12.3.5. Logging the right information

12.4. Tracing interactions between services

12.4.1. Correlating Requests: Traces and Spans

12.4.2. Setting up tracing in our services

12.5. Visualizing traces

12.6. Summary

13. Building Microservice Teams

13.1. Building effective teams

13.1.1. Conway’s Law

13.1.2. Principles for effective teams

13.2. Team models

13.2.1. Grouping by function

13.2.2. Grouping across functions

13.2.3. Setting team boundaries

13.2.4. Infrastructure, platform and product

13.2.5. Who is on-call?

13.2.6. Sharing knowledge

13.3.1. Drivers of change in microservices

13.3.2. The role of architecture

13.3.3. Homogeneity versus technical flexibility

13.3.4. Open-source model

13.3.5. Design review

13.3.6. Living documentation

13.3.7. Answering questions about your application

13.4. Further reading

13.5. Summary

About the Technology

Most enterprise developers are comfortable with writing individual components or services as part of a larger application. In microservice systems, the benefits - and unique challenges - arise from the way these services are organized, deployed, and managed. Production-ready microservice applications rely on cloud platforms like AWS or Google Cloud, container engines like Docker, and orchestration tools like Kubernetes. Microservices change the dev process as well, maximizing the efficiency and independence of small teams. To be successful, developers, team leaders, and architects need to master both the implementation details and the big picture of how microservices work in a production environment.

What's inside

  • Review of microservice architecture
  • Building a delivery pipeline for microservices
  • Monitoring your microservices applications
  • Deploying with containers
  • Written by authors with daily, hands-on experience

About the reader

Readers should be intermediate developers with some knowledge of enterprise application architecture. Familiarity with container systems like Docker and IaaS cloud like AWS, Google Cloud, or DigitalOcean is helpful but not required.

About the authors

Morgan Bruce and Paulo A. Pereira have years of experience building distributed applications, with particular expertise in the high-stakes finance and identity verification industries. They work daily with microservices in a production environment using the tools and techniques presented in this book.


Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
buy
Microservices in Action (combo) added to cart
continue shopping
go to cart

MEAP combo $49.99 pBook + eBook + liveBook
Microservices in Action (eBook) added to cart
continue shopping
go to cart

MEAP eBook $39.99 pdf + ePub + kindle + liveBook

FREE domestic shipping on three or more pBooks

A must have for all people involved in this kind of job.

Antonio Pessolano

An excellent guide for those who have embarked on their microservice journey.

Andy Miles