Microservices in Action
Morgan Bruce, Paulo A. Pereira
  • MEAP began May 2017
  • Publication in October 2018 (estimated)
  • ISBN 9781617294457
  • 392 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

preface

acknowledgments

Paulo

Morgan

about this book

How this book is organized: a roadmap

About the code

Book forum

about the authors

about the cover illustration

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 Who uses microservices?

1.1.4 Why are microservices a good choice?

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 by modeling the domain

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 Quality-controlled and automated deployment

2.5.2 Resilience

2.5.3 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 microservice application

3.1 Architecture as a whole

3.1.1 From monolith to microservices

3.1.2 The role of an architect

3.1.3 Architectural principles

3.1.4 The four tiers of a microservice application

3.2 A microservice platform

3.2.1 Mapping your runtime platform

3.3 Services

3.3.1 Capabilities

3.3.2 Aggregation and higher order services

3.3.3 Critical and noncritical paths

3.4 Communication

3.4.1 When to use synchronous messages

3.4.2 When to use asynchronous messages

3.4.3 Asynchronous communication patterns

3.4.4 Locating other services

3.5 The application boundary

3.5.1 API gateways

3.5.2 Backends for frontends

3.5.3 Consumer-driven gateways

3.6 Clients

3.6.1 Frontend monoliths

3.6.2 Micro-frontends

3.7 Summary

4 Designing new features

4.1 A new feature for SimpleBank

4.2 Scoping by business capabilities

4.2.1 Capabilities and domain modeling

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.8 Summary

5 Transactions and queries in microservices

5.1 Consistent transactions in distributed applications

5.1.1 Why can’t you use distributed transactions?

5.2 Event-based communication

5.2.1 Events and choreography

5.3 Sagas

5.3.1 Choreographed sagas

5.3.2 Orchestrated sagas

5.3.3 Interwoven sagas

5.3.4 Consistency patterns

5.3.5 Event sourcing

5.4 Queries in a distributed world

5.4.1 Storing copies of data

5.4.2 Separating queries and commands

5.4.3 CQRS challenges

5.4.4 Analytics and reporting

5.5 Further reading

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

6.3.4 Circuit breakers

6.3.5 Asynchronous communication

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 Service mesh

6.6 Summary

7 Building a reusable microservice framework

7.1 A microservice chassis

7.2 What’s the purpose of a 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 you learned?

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 your 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 your image

10.2.3 Running tests

10.2.4 Publishing artifacts

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 Techniques for low-impact deployment and feature release

10.4.1 Dark launches

10.4.2 Feature flags

10.5 Summary

Part 4: Observability and ownership

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 your 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.4 Observing the whole application

11.5 Summary

12 Using logs and traces to understand behavior

12.1 Understanding behavior across services

12.1.1 Useful information to include in log entries

12.1.2 Structure and readability

12.2 Setting up a logging infrastructure for SimpleBank

12.2.1 ELK- and Fluentd-based solution

12.2.2 Setting up your logging solution

12.2.3 Configure what logs to collect

12.2.4 Finding a needle in the haystack

12.2.5 Logging the right information

12.3 Tracing interactions between services

12.3.1 Correlating requests: traces and spans

12.3.2 Setting up tracing in your services

12.4 Visualizing traces

12.5 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’s 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

Appendixes

Appendix A: Installing Jenkins on Minikube

A.1 Running Jenkins on Kubernetes

A.1.1 Setting up Helm

A.1.2 Create a namespace and a volume

A.1.3 Installing Jenkins

A.1.4 Configuring RBAC

A.1.5 Testing it all works

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