Muutke küpsiste eelistusi

Building Microservices: Designing Fine-Grained Systems 2nd edition [Pehme köide]

4.21/5 (5042 hinnangut Goodreads-ist)
  • Formaat: Paperback / softback, 612 pages, kõrgus x laius: 233x178 mm
  • Ilmumisaeg: 30-Sep-2021
  • Kirjastus: O'Reilly Media
  • ISBN-10: 1492034029
  • ISBN-13: 9781492034025
Teised raamatud teemal:
  • Pehme köide
  • Hind: 75,81 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Tavahind: 89,19 €
  • Säästad 15%
  • Raamatu kohalejõudmiseks kirjastusest kulub orienteeruvalt 2-4 nädalat
  • Kogus:
  • Lisa ostukorvi
  • Tasuta tarne
  • Tellimisaeg 2-4 nädalat
  • Lisa soovinimekirja
  • Formaat: Paperback / softback, 612 pages, kõrgus x laius: 233x178 mm
  • Ilmumisaeg: 30-Sep-2021
  • Kirjastus: O'Reilly Media
  • ISBN-10: 1492034029
  • ISBN-13: 9781492034025
Teised raamatud teemal:

Distributed systems have become more fine-grained in the past 10 years, shifting from code-heavy monolithic applications to smaller, self-contained microservices. But developing these systems brings its own set of headaches. With lots of examples and practical advice, the second edition of this practical book takes a holistic view of the topics that system architects and administrators must consider when building, managing, and evolving microservice architectures.

Microservice technologies are moving quickly, and this revised edition gets you up to date with a new chapter on serverless and cloud-native applications, expanded coverage of user interfaces, more hands-on code examples, and other additions throughout the book.

Author Sam Newman provides you with a firm grounding in the concepts while diving into current solutions for modeling, integrating, testing, deploying, and monitoring your own autonomous services. You’ll follow a fictional company throughout the book to learn how building a microservice architecture affects a single domain.

Preface xvii
Part I Foundation
1 What Are Microservices?
3(32)
Microservices at a Glance
3(3)
Key Concepts of Microservices
6(1)
Independent Deployability
6(1)
Modeled Around a Business Domain
7(1)
Owning Their Own State
8(1)
Size
9(1)
Flexibility
10(1)
Alignment of Architecture and Organization
10(4)
The Monolith
14(1)
The Single-Process Monolith
15(1)
The Modular Monolith
16(1)
The Distributed Monolith
17(1)
Monoliths and Delivery Contention
17(1)
Advantages of Monoliths
18(1)
Enabling Technology
18(1)
Log Aggregation and Distributed Tracing
19(1)
Containers and Kubernetes
20(1)
Streaming
21(1)
Public Cloud and Serverless
21(1)
Advantages of Microservices
22(1)
Technology Heterogeneity
22(1)
Robustness
23(1)
Scaling
24(1)
Ease of Deployment
25(1)
Organizational Alignment
25(1)
Composability
26(1)
Microservice Pain Points
26(1)
Developer Experience
26(1)
Technology Overload
27(1)
Cost
28(1)
Reporting
28(1)
Monitoring and Troubleshooting
29(1)
Security
29(1)
Testing
30(1)
Latency
30(1)
Data Consistency
31(1)
Should I Use Microservices?
31(1)
Whom They Might Not Work For
31(2)
Where They Work Well
33(1)
Summary
34(1)
2 How to Model Microservices
35(36)
Introducing MusicCorp
35(1)
What Makes a Good Microservice Boundary?
36(1)
Information Hiding
36(2)
Cohesion
38(1)
Coupling
38(1)
The Interplay of Coupling and Cohesion
39(1)
Types of Coupling
39(2)
Domain Coupling
41(2)
Pass-Through Coupling
43(3)
Common Coupling
46(3)
Content Coupling
49(2)
Just Enough Domain-Driven Design
51(1)
Ubiquitous Language
52(1)
Aggregate
53(3)
Bounded Context
56(2)
Mapping Aggregates and Bounded Contexts to Microservices
58(1)
Event Storming
59(2)
The Case for Domain-Driven Design for Microservices
61(1)
Alternatives to Business Domain Boundaries
62(1)
Volatility
62(2)
Data
64(1)
Technology
65(1)
Organizational
66(2)
Mixing Models and Exceptions
68(1)
Summary
69(2)
3 Splitting the Monolith
71(18)
Have a Goal
71(1)
Incremental Migration
72(1)
The Monolith Is Rarely the Enemy
73(1)
The Dangers of Premature Decomposition
73(1)
What to Split First?
74(2)
Decomposition by Layer
76(1)
Code First
77(1)
Data First
78(1)
Useful Decompositional Patterns
79(1)
Strangler Fig Pattern
79(1)
Parallel Run
80(1)
Feature Toggle
80(1)
Data Decomposition Concerns
81(1)
Performance
81(3)
Data Integrity
84(1)
Transactions
84(1)
Tooling
85(1)
Reporting Database
85(1)
Summary
86(3)
4 Microservice Communication Styles
89(32)
From In-Process to Inter-Process
89(1)
Performance
90(1)
Changing Interfaces
91(1)
Error Handling
91(2)
Technology for Inter-Process Communication: So Many Choices
93(1)
Styles of Microservice Communication
93(2)
Mix and Match
95(1)
Pattern: Synchronous Blocking
95(1)
Advantages
96(1)
Disadvantages
96(1)
Where to Use It
96(2)
Pattern: Asynchronous Nonblocking
98(1)
Advantages
99(1)
Disadvantages
100(1)
Where to Use It
101(1)
Pattern: Communication Through Common Data
101(1)
Implementation
102(1)
Advantages
103(1)
Disadvantages
103(1)
Where to Use It
104(1)
Pattern: Request-Response Communication
104(2)
Implementation: Synchronous Versus Asynchronous
106(2)
Where to Use It
108(1)
Pattern: Event-Driven Communication
108(2)
Implementation
110(1)
What's in an Event?
111(4)
Where to Use It
115(1)
Proceed with Caution
116(1)
Summary
117(4)
Part II Implementation
5 Implementing Microservice Communication
121(54)
Looking for the Ideal Technology
121(1)
Make Backward Compatibility Easy
121(1)
Make Your Interface Explicit
122(1)
Keep Your APIs Technology Agnostic
122(1)
Make Your Service Simple for Consumers
122(1)
Hide Internal Implementation Detail
123(1)
Technology Choices
123(1)
Remote Procedure Calls
123(4)
REST
127(6)
GraphQL
133(2)
Message Brokers
135(5)
Serialization Formats
140(1)
Textual Formats
140(1)
Binary Formats
141(1)
Schemas
141(1)
Structural Versus Semantic Contract Breakages
142(1)
Should You Use Schemas?
143(1)
Handling Change Between Microservices
144(1)
Avoiding Breaking Changes
144(1)
Expansion Changes
145(1)
Tolerant Reader
145(1)
Right Technology
146(1)
Explicit Interface
146(2)
Catch Accidental Breaking Changes Early
148(1)
Managing Breaking Changes
149(1)
Lockstep Deployment
149(1)
Coexist Incompatible Microservice Versions
149(1)
Emulate the Old Interface
150(2)
Which Approach Do I Prefer?
152(1)
The Social Contract
152(1)
Tracking Usage
153(1)
Extreme Measures
154(1)
DRY and the Perils of Code Reuse in a Microservice World
154(1)
Sharing Code via Libraries
155(2)
Service Discovery
157(1)
Domain Name System (DNS)
157(2)
Dynamic Service Registries
159(2)
Don't Forget the Humans!
161(1)
Service Meshes and API Gateways
162(1)
API Gateways
163(3)
Service Meshes
166(3)
What About Other Protocols?
169(1)
Documenting Services
169(1)
Explicit Schemas
169(1)
The Self-Describing System
170(3)
Summary
173(2)
6 Workflow
175(22)
Database Transactions
175(1)
ACID Transactions
176(1)
Still ACID, but Lacking Atomicity?
177(2)
Distributed Transactions---Two-Phase Commits
179(2)
Distributed Transactions---Just Say No
181(1)
Sagas
182(2)
Saga Failure Modes
184(5)
Implementing Sagas
189(6)
Sagas Versus Distributed Transactions
195(1)
Summary
196(1)
7 Build
197(22)
A Brief Introduction to Continuous Integration
197(1)
Are You Really Doing CI?
198(1)
Branching Models
199(2)
Build Pipelines and Continuous Delivery
201(2)
Tooling
203(1)
Trade-Offs and Environments
203(1)
Artifact Creation
204(1)
Mapping Source Code and Builds to Microservices
205(1)
One Giant Repo, One Giant Build
205(2)
Pattern: One Repository per Microservice (aka Multirepo)
207(3)
Pattern: Monorepo
210(7)
Which Approach Would I Use?
217(1)
Summary
217(2)
8 Deployment
219(56)
From Logical to Physical
219(1)
Multiple Instances
220(2)
The Database
222(3)
Environments
225(3)
Principles of Microservice Deployment
228(1)
Isolated Execution
228(3)
Focus on Automation
231(1)
Infrastructure as Code (IAC)
232(1)
Zero-Downtime Deployment
233(1)
Desired State Management
234(3)
Deployment Options
237(1)
Physical Machines
238(1)
Virtual Machines
239(2)
Containers
241(6)
Application Containers
247(1)
Platform as a Service (PaaS)
248(1)
Function as a Service (FaaS)
249(8)
Which Deployment Option Is Right for You?
257(2)
Kubernetes and Container Orchestration
259(1)
The Case for Container Orchestration
259(1)
A Simplified View of Kubernetes Concepts
260(2)
Multitenancy and Federation
262(3)
The Cloud Native Computing Federation
265(1)
Platforms and Portability
265(1)
Helm, Operators, and CRDs, Oh My!
266(1)
And Knative
267(1)
The Future
268(1)
Should You Use It?
268(1)
Progressive Delivery
269(1)
Separating Deployment from Release
270(1)
On to Progressive Delivery
270(1)
Feature Toggles
271(1)
Canary Release
271(1)
Parallel Run
272(1)
Summary
273(2)
9 Testing
275(30)
Types of Tests
276(2)
Test Scope
278(1)
Unit Tests
279(1)
Service Tests
280(1)
End-to-End Tests
281(1)
Trade-Offs
282(1)
Implementing Service Tests
283(1)
Mocking or Stubbing
283(1)
A Smarter Stub Service
284(1)
Implementing (Those Tricky) End-to-End Tests
285(1)
Flaky and Brittle Tests
286(1)
Who Writes These End-to-End Tests?
287(2)
How Long Should End-to-End Tests Run?
289(1)
The Great Pile-Up
290(1)
The Metaversion
291(1)
Lack of Independent Testability
291(1)
Should You Avoid End-to-End Tests?
292(1)
Contract Tests and Consumer-Driven Contracts (CDCs)
292(3)
The Final Word
295(1)
Developer Experience
296(1)
From Preproduction to In-Production Testing
297(1)
Types of In-Production Testing
298(1)
Making Testing in Production Safe
298(1)
Mean Time to Repair over Mean Time Between Failures?
299(1)
Cross-Functional Testing
300(1)
Performance Tests
301(1)
Robustness Tests
302(1)
Summary
303(2)
10 From Monitoring to Observability
305(40)
Disruption, Panic, and Confusion
305(1)
Single Microservice, Single Server
306(1)
Single Microservice, Multiple Servers
307(1)
Multiple Services, Multiple Servers
308(1)
Observability Versus Monitoring
309(1)
The Pillars of Observability? Not So Fast
310(1)
Building Blocks for Observability
311(1)
Log Aggregation
312(9)
Metrics Aggregation
321(3)
Distributed Tracing
324(3)
Are We Doing OK?
327(2)
Alerting
329(4)
Semantic Monitoring
333(2)
Testing in Production
335(2)
Standardization
337(1)
Selecting Tools
338(1)
Democratic
338(1)
Easy to Integrate
339(1)
Provide Context
339(1)
Real-Time
339(1)
Suitable for Your Scale
340(1)
The Expert in the Machine
340(1)
Getting Started
341(1)
Summary
342(3)
11 Security
345(42)
Core Principles
346(1)
Principle of Least Privilege
347(1)
Defense in Depth
347(2)
Automation
349(1)
Build Security into the Delivery Process
349(1)
The Five Functions of Cybersecurity
350(1)
Identify
351(1)
Protect
352(1)
Detect
353(1)
Respond
353(1)
Recover
354(1)
Foundations of Application Security
354(1)
Credentials
354(6)
Patching
360(3)
Backups
363(1)
Rebuild
364(1)
Implicit Trust Versus Zero Trust
365(1)
Implicit Trust
366(1)
Zero Trust
366(1)
It's a Spectrum
367(2)
Securing Data
369(1)
Data in Transit
369(3)
Data at Rest
372(3)
Authentication and Authorization
375(1)
Service-to-Service Authentication
375(1)
Human Authentication
376(1)
Common Single Sign-On Implementations
376(1)
Single Sign-On Gateway
377(2)
Fine-Grained Authorization
379(1)
The Confused Deputy Problem
380(1)
Centralized, Upstream Authorization
381(1)
Decentralizing Authorization
382(1)
JSON Web Tokens
382(4)
Summary
386(1)
12 Resiliency
387(32)
What Is Resiliency?
387(1)
Robustness
388(1)
Rebound
389(1)
Graceful Extensibility
390(1)
Sustained Adaptability
390(1)
And Microservice Architecture
391(1)
Failure Is Everywhere
391(1)
How Much Is Too Much?
392(2)
Degrading Functionality
394(1)
Stability Patterns
395(2)
Time-Outs
397(2)
Retries
399(1)
Bulkheads
400(1)
Circuit Breakers
401(3)
Isolation
404(1)
Redundancy
405(1)
Middleware
405(1)
Idempotency
406(1)
Spreading Your Risk
407(1)
CAP Theorem
408(2)
Sacrificing Consistency
410(1)
Sacrificing Availability
410(1)
Sacrificing Partition Tolerance?
411(1)
AP or CP?
411(1)
It's Not All or Nothing
412(1)
And the Real World
412(1)
Chaos Engineering
413(1)
Game Days
414(1)
Production Experiments
415(1)
From Robustness to Beyond
415(1)
Blame
415(2)
Summary
417(2)
13 Scaling
419(36)
The Four Axes of Scaling
419(1)
Vertical Scaling
420(2)
Horizontal Duplication
422(4)
Data Partitioning
426(4)
Functional Decomposition
430(2)
Combining Models
432(1)
Start Small
433(2)
Caching
435(1)
For Performance
436(1)
For Scale
436(1)
For Robustness
436(1)
Where to Cache
437(5)
Invalidation
442(5)
The Golden Rule of Caching
447(1)
Freshness Versus Optimization
448(1)
Cache Poisoning: A Cautionary Tale
448(1)
Autoscaling
449(1)
Starting Again
450(1)
Summary
451(4)
Part III People
14 User Interfaces
455(36)
Toward Digital
456(1)
Ownership Models
456(2)
Drivers for Dedicated Frontend Teams
458(1)
Toward Stream-Aligned Teams
459(1)
Sharing Specialists
460(1)
Ensuring Consistency
461(1)
Working Through Technical Challenges
462(1)
Pattern: Monolithic Frontend
463(1)
When to Use It
464(1)
Pattern: Micro Frontends
464(1)
Implementation
465(1)
When to Use It
465(2)
Pattern: Page-Based Decomposition
467(1)
Where to Use It
468(1)
Pattern: Widget-Based Decomposition
469(1)
Implementation
470(3)
When to Use It
473(1)
Constraints
474(1)
Pattern: Central Aggregating Gateway
475(1)
Ownership
476(1)
Different Types of User Interfaces
477(1)
Multiple Concerns
478(1)
When to Use It
479(1)
Pattern: Backend for Frontend (BFF)
480(1)
How Many BFFs?
481(2)
Reuse and BFFs
483(3)
BFFs for Desktop Web and Beyond
486(1)
When to Use
487(1)
GraphQL
488(1)
A Hybrid Approach
489(1)
Summary
490(1)
15 Organizational Structures
491(34)
Loosely Coupled Organizations
491(2)
Conway's Law
493(1)
Evidence
493(2)
Team Size
495(1)
Understanding Conway's Law
496(1)
Small Teams, Large Organization
496(2)
On Autonomy
498(1)
Strong Versus Collective Ownership
499(1)
Strong Ownership
500(1)
Collective Ownership
501(1)
At a Team Level Versus an Organizational Level
502(1)
Balancing Models
502(1)
Enabling Teams
503(2)
Communities of Practice
505(1)
The Platform
506(3)
Shared Microservices
509(1)
Too Hard to Split
509(1)
Cross-Cutting Changes
509(1)
Delivery Bottlenecks
510(1)
Internal Open Source
511(1)
Role of the Core Committers
511(1)
Maturity
512(1)
Tooling
512(1)
Pluggable, Modular Microservices
513(2)
Change Reviews
515(3)
The Orphaned Service
518(1)
Case Study: realestate.com.au
519(2)
Geographical Distribution
521(1)
Conway's Law in Reverse
522(1)
People
523(1)
Summary
524(1)
16 The Evolutionary Architect
525(26)
What's in a Name?
525(2)
What Is Software Architecture?
527(2)
Making Change Possible
529(1)
An Evolutionary Vision for the Architect
529(1)
Defining System Boundaries
530(3)
A Social Construct
533(1)
Habitability
534(2)
A Principled Approach
536(1)
Strategic Goals
536(1)
Principles
536(1)
Practices
537(1)
Combining Principles and Practices
537(1)
A Real-World Example
538(1)
Guiding an Evolutionary Architecture
539(1)
Architecture in a Stream-Aligned Organization
540(2)
Building a Team
542(1)
The Required Standard
543(1)
Monitoring
543(1)
Interfaces
543(1)
Architectural Safety
544(1)
Governance and the Paved Road
544(1)
Exemplars
545(1)
Tailored Microservice Template
545(2)
The Paved Road at Scale
547(1)
Technical Debt
547(1)
Exception Handling
548(1)
Summary
548(3)
Afterword: Bringing It All Together 551(12)
Bibliography 563(6)
Glossary 569(6)
Index 575
Sam Newman is interested in how different aspects of technology intersect, from development, to ops, to security, usability, and organizational structures. After 20 years in the industry, Sam now runs his own consulting and training company Sam Newman and Associates, focusing in the area of Microservices, Cloud and CI/CD.

Sam has worked with a variety of companies across multiple industries all over the globe, often with one foot in the developer world, and another in the IT operations space. He has written articles, presented at conferences, and sporadically commits to open source projects. Sam is the author of the bestselling Building Microservices from O'Reilly.