![Microservices in Action](http://img.images-bn.com/static/redesign/srcs/images/grey-box.png?v11.9.4)
![Microservices in Action](http://img.images-bn.com/static/redesign/srcs/images/grey-box.png?v11.9.4)
Paperback(1st Edition)
-
PICK UP IN STORECheck Availability at Nearby Stores
Available within 2 business hours
Related collections and offers
Overview
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.
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
About the Technology
Invest your time in designing great applications, improving infrastructure, and making the most out of your dev teams. Microservices are easier to write, scale, and maintain than traditional enterprise applications because they're built as a system of independent components. Master a few important new patterns and processes, and you'll be ready to develop, deploy, and run production-quality microservices.
About the Book
Microservices in Action teaches you how to write and maintain microservice-based applications. Created with day-to-day development in mind, this informative guide immerses you in real-world use cases from design to deployment. You'll discover how microservices enable an efficient continuous delivery pipeline, and explore examples using Kubernetes, Docker, and Google Container Engine.
What's inside
- An overview of microservice architecture
- Building a delivery pipeline
- Best practices for designing multi-service transactions and queries
- Deploying with containers
- Monitoring your microservices
About the Reader
Written for intermediate developers familiar with enterprise architecture and cloud platforms like AWS and GCP.
About the Author
Morgan Bruce and Paulo A. Pereira are experienced engineering leaders. They work daily with microservices in a production environment, using the techniques detailed in this book.
Table of Contents
- Designing and running microservices
- Microservices at SimpleBank
- Architecture of a microservice application
- Designing new features
- Transactions and queries in microservices
- Designing reliable services
- Building a reusable microservice framework
- Deploying microservices
- Deployment with containers and schedulers
- Building a delivery pipeline for microservices
- Building a monitoring system
- Using logs and traces to understand behavior
- Building microservice teams
Product Details
ISBN-13: | 9781617294457 |
---|---|
Publisher: | Manning |
Publication date: | 11/05/2018 |
Edition description: | 1st Edition |
Pages: | 392 |
Product dimensions: | 7.30(w) x 9.20(h) x 1.00(d) |
About the Author
Paulo A. Pereira is a software developer and engineering director at Onfido. He works daily with microservices in a production environment using the tools and techniques presented in this book.
Table of Contents
Preface xv
Acknowledgments xvii
About this book xix
About the authors xxii
About the cover illustration xxiii
Part 1 The Lay of the Land 1
1 Designing and running microservices 3
1.1 What is a microservice application? 4
Scaling through decomposition 6
Key principles 7
Who uses microservices? 10
Why are microservices a good choice? 12
1.2 What makes microservices challenging? 14
Design challenges 14
Operational challenges 17
1.3 Microservice development lifecycle 18
Designing microservices 19
Deploying microservices 21
Observing microservices 24
1.4 Responsible and operationally aware engineering culture 26
2 Microservices at SimpleBank 28
2.1 What does SimpleBank do? 29
2.2 Are microservices the right choice? 30
Risk and inertia in financial software 31
Reducing friction and delivering sustainable value 31
2.3 Building a new feature 32
Identifying microservices by modeling the domain 33
Service collaboration 36
Service choreography 37
2.4 Exposing services to the world 39
2.5 Taking your feature to production 40
Quality-controlled and automated deployment 42
Resilience 43
Transparency 43
2.6 Scaling up microservice development 45
Technical divergence 45
Isolation 46
2.7 What's next? 47
Part 2 Design 49
3 Architecture of a microservice application 51
3.1 Architecture as a whole 52
From monolith to microservices 52
The role of an architect 54
Architectural principles 54
The four tiers of a microservice application 55
3.2 A microservice platform 56
Mapping your runtime platform 57
3.3 Services 58
Capabilities 58
Aggregation and, higher order services 59
Critical and noncritical paths 60
3.4 Communication 60
When to use synchronous messages 61
When to use asynchronous messages 62
Asynchronous communication patterns 63
Locating other services 65
3.5 The application boundary 66
API gateways 68
Backends for frontends 69
Consumer-driven gateways 70
3.6 Clients 71
Frontend monoliths 71
Micro-frontends 72
4 Designing new features 75
4.1 A new feature for SimpleBank 76
4.2 Scoping by business capabilities 78
Capabilities and domain modeling 78
Creating investment strategies 79
Nested contexts and services 86
Challenges and limitations 87
4.3 Scoping by use case 87
Placing investment strategy orders 88
Actions and stores 92
Orchestration and choreography 94
4.4 Scoping by volatility 94
4.5 Technical capabilities 96
Sending notifications 96
When to use technical capabilities 98
4.6 Dealing with ambiguity 99
Start with coarse-grained services 99
Prepare for further decomposition 100
Retirement and migration 100
4.7 Service ownership in organizations 103
5 Transactions and queries in microservices 105
5.1 Consistent transactions in distributed applications 106
Why can't you use distributed transactions? 107
5.2 Event-based communication 108
Events and choreography 109
5.3 Sagas 111
Choreographed sagas 112
Orchestrated sagas 115
Interwoven sagas 117
Consistency patterns 118
Event sourcing 119
5.4 Queries in a distributed world 120
Storing copies of data 122
Separating queries and commands 123
CQRS challenges 125
Analytics and reporting 127
5.5 Further reading 128
6 Designing reliable services 129
6.1 Defining reliability 130
6.2 What could go wrong? 132
Sources of failure 133
Cascading failures 136
6.3 Designing reliable communication 139
Retries 140
Fallbacks 143
Timeouts 145
Circuit breakers 146
Asynchronous communication 149
6.4 Maximizing service reliability 150
Load balancing and service health 150
Rate limits 152
Validating reliability and fault tolerance 152
6.5 Safety by default 156
Frameworks 156
Service mesh 157
7 Building a reusable microservice framework 159
7.1 A microservice chassis 160
7.2 What's the purpose of a microservice chassis? 163
Reduced risk 164
Faster bootstrapping 164
7.3 Designing a chassis 165
Service discovery 167
Observability 171
Balancing and limiting 177
7.4 Exploring the feature implemented using the chassis 180
7.5 Wasn't heterogeneity one of the promises of microservices? 182
Part 2 Deployment 185
8 Deploying microservices 187
8.1 Why is deployment important? 188
Stability and availability 189
8.2 A microservice production environment 189
Features of a microservice production environment 190
Automation and speed 191
8.3 Deploying a service, the quick way 191
Service startup 192
Provisioning a virtual machine 192
Run multiple instances of your service 194
Adding a load balancer 196
What have you learned? 198
8.4 Building service artifacts 199
What's in an artifact? 200
Immutability 201
Types of service artifacts 202
Configuration 206
8.5 Service to host models 207
Singh service to host 207
Multiple static services per host 208
Multiple scheduled services per host 209
8.6 Deploying services without downtime 210
Canaries and rolling deploys on GCE 211
9 Deployment with containers and schedulers 214
9.1 Containerizing a service 215
Working with images 216
Building your image 218
Running containers 220
Storing an image 223
9.2 Deploying to a cluster 224
Designing and running pods 226
Load balancing 228
A quick, look under the hood 230
Health checks 233
Deploying a new version 235
Rolling back 241
Connecting multiple services 241
10 Building a delivery pipeline for microservices 243
10.1 Making deploys boring 244
A deployment pipeline 244
10.2 Building a pipeline with Jenkins 246
Configuring a build pipeline 247
Building your image 251
Running tests 252
Publishing artifacts 254
Deploying to staging 255
Staging environments 258
Deploying to production 259
10.3 Building reusable pipeline steps 262
Procedural versus declarative build pipelines 263
10.4 Techniques for low-impact deployment and feature release 264
Dark launches 264
Feature flags 265
Part 4 Observability and Ownership 267
11 Building a monitoring system 269
11.1 A robust monitoring stack 270
Good monitoring is layered 270
Golden signals 272
Types of metrics 273
Recommended practices 274
11.2 Monitoring SimpleBank with Prometheus and Grafana 275
Setting up your metric collection infrastructure 276
Collecting infrastructure metrics-RabbitMQ 282
Instrumenting Simple-Bank's place order 285
Setting up alerts 287
11.3 Raising sensible and actionable alerts 291
Who needs to know when something is wrong? 292
Symptoms, not causes 292
11.4 Observing the whole application 293
12 Using logs and traces to understand behavior 296
12.1 Understanding behavior across services 297
12.2 Generating consistent, structured, human-readable logs 300
Useful information to include in log entries 300
Structure and readability 301
12.3 Setting up a logging infrastructure for SimpleBank 303
ELK-and Fluentd-based solution 304
Setting up your logging solution 306
Configure what logs to collect 308
Finding a needle in the haystack 311
Logging the right information 313
12.4 Tracing interactions between services 313
Correlating requests: traces and spans 314
Setting up tracing in your services 315
12.5 Visualizing traces 320
13 Building microservice teams 325
13.1 Building effective teams 326
Conway's Law 327
Principles for effective teams 328
13.2 Team models 330
Grouping by function 330
Grouping across functions 332
Setting team boundaries 334
Infrastructure, platform, and product 335
Who's on-call? 337
Sharing knowledge 338
13.3 Recommended practices for microservice teams 340
Drivers of change in microservices 340
The role of architecture 341
Homogeneity versus technical flexibility 343
Open source model 343
Design review 345
Living documentation 346
Answering questions about your application 347
13.4 Further reading 347
Appendix Installing Jenkins on Minikube 349
Index 357