O’Reilly, 2015. — 280 p. — ISBN13: 978-1491950357.
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, this 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. 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.
Discover how microservices allow you to align your system design with your organization’s goals.
Learn options for integrating a service with the rest of your system.
Take an incremental approach when splitting monolithic codebases.
Deploy individual microservices through continuous integration.
Examine the complexities of testing and monitoring distributed services.
Manage security with user-to-service and service-to-service models.
Understand the challenges of scaling microservice architectures.
TOC:
Microservices.
What Are Microservices?
Key Benefits.
What About Service-Oriented Architecture?
Other Decompositional Techniques.
No Silver Bullet.
The Evolutionary Architect.
Inaccurate Comparisons.
An Evolutionary Vision for the Architect.
Zoning.
A Principled Approach.
The Required Standard.
Governance Through Code.
Technical Debt.
Exception Handling.
Governance and Leading from the Center.
Building a Team.
How to Model Services.
Introducing MusicCorp.
What Makes a Good Service?
The Bounded Context.
Business Capabilities.
Turtles All the Way Down.
Communication in Terms of Business Concepts.
The Technical Boundary.
Integration.
Looking for the Ideal Integration Technology.
Interfacing with Customers.
The Shared Database.
Synchronous Versus Asynchronous.
Orchestration Versus Choreography.
Remote Procedure Calls.
REST.
Implementing Asynchronous Event-Based Collaboration.
Services as State Machines.
Reactive Extensions.
DRY and the Perils of Code Reuse in a Microservice World.
Access by Reference.
Versioning.
User Interfaces.
Integrating with Third-Party Software.
Splitting the Monolith.
It’s All About Seams.
Breaking Apart MusicCorp.
The Reasons to Split the Monolith.
Tangled Dependencies.
The Database.
Getting to Grips with the Problem.
Example: Breaking Foreign Key Relationships.
Example: Shared Static Data.
Example: Shared Data.
Example: Shared Tables.
Refactoring Databases.
Transactional Boundaries.
Reporting.
The Reporting Database.
Data Retrieval via Service Calls.
Data Pumps.
Event Data Pump.
Backup Data Pump.
Toward Real Time.
Cost of Change.
Understanding Root Causes.
Deployment.
A Brief Introduction to Continuous Integration.
Mapping Continuous Integration to Microservices.
Build Pipelines and Continuous Delivery.
Platform-Specific Artifacts.
Operating System Artifacts.
Custom Images.
Environments.
Service Configuration.
Service-to-Host Mapping.
Automation.
From Physical to Virtual.
A Deployment Interface.
Testing.
Types of Tests.
Test Scope.
Implementing Service Tests.
Those Tricky End-to-End Tests.
Downsides to End-to-End Testing.
Flaky and Brittle Tests.
Test Journeys, Not Stories.
Consumer-Driven Tests to the Rescue.
So Should You Use End-to-End Tests?
Testing After Production.
Cross-Functional Testing.
Monitoring.
Single Service, Single Server.
Single Service, Multiple Servers.
Multiple Services, Multiple Servers.
Logs, Logs, and Yet More Logs...
Metric Tracking Across Multiple Services.
Service Metrics.
Synthetic Monitoring.
Correlation IDs.
The Cascade.
Standardization.
Consider the Audience.
The Future.
Security.
Authentication and Authorization.
Service-to-Service Authentication and Authorization.
Securing Data at Rest.
Defense in Depth.
A Worked Example.
Be Frugal.
The Human Element.
The Golden Rule.
Baking Security In.
External Verification.
Conway’s Law and System Design.
Evidence.
Netflix and Amazon.
What Can We Do with This?
Adapting to Communication Pathways.
Service Ownership.
Drivers for Shared Services.
Internal Open Source.
Bounded Contexts and Team Structures.
The Orphaned Service?
Case Study: RealEstate.com.au.
Conway’s Law in Reverse.
People.
Microservices at Scale.
Failure Is Everywhere.
How Much Is Too Much?
Degrading Functionality.
Architectural Safety Measures.
The Antifragile Organization.
Idempotency.
Scaling.
Scaling Databases.
Caching.
Autoscaling.
CAP Theorem.
Service Discovery.
Dynamic Service Registries.
Documenting Services.
The Self-Describing System.
Bringing It All Together.
Principles of Microservices.
When Shouldn’t You Use Microservices?
Parting Words.