Building Microservices: Designing Fine-Grained Systems, 2nd Edition PDF Free Download

0

Download Pdf Building Microservices: Designing Fine-Grained Systems, 2nd Edition

As organizations shift from monolithic applications to smaller, self-contained microservices, distributed systems have become more fine-grained. But developing these new systems brings its own host of problems. This expanded second edition takes a holistic view of topics that you need to consider when building, managing, and scaling microservices architectures.

Through clear examples and practical advice, author Sam Newman gives everyone from architects and developers to testers and IT operators a firm grounding in the concepts. You’ll dive into the latest solutions for modeling, integrating, testing, deploying, and monitoring your own autonomous services. Real-world cases reveal how organizations today manage to get the most out of these architectures.

Microservices technologies continue to move quickly. This book brings you up to speed.

Get new information on user interfaces, container orchestration, and serverless
Use microservices to align system design with your organization’s goals
Explore 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 expanded content around user-to-service and service-to-service models

Table of contents

Preface
Who Should Read This Book
Why I Wrote This Book
What’s Changed Since The 2nd Edition?
Navigating This Book
Part I, Foundation
Part II, Implementation
Part III, People
Conventions Used in This Book
O’Reilly Online Learning
Acknowledgments
I. Foundation
1. What Are Microservices?
Microservices at a Glance
Key Concepts of Microservices
Independently Deployability
Modelled Around a Business Domain
Owning Their Own State
Size
Flexibility
Alignment of Architecture and Organization
The Monolith
The Single-Process Monolith
The Modular Monolith
The Distributed Monolith
Monoliths and Delivery Contention
Advantages of Monoliths
Enabling Technology
Log Aggregation and Distributed Tracing
Containers and Kubernetes
Streaming
Public Cloud and Serverless
Advantages of Microservices
Technology Heterogeneity
Robustness
Scaling
Ease of Deployment
Organizational Alignment
Composability
Microservice Pain Points
Developer Experience
Technology Overload
Cost
Reporting
Monitoring and Troubleshooting
Security
Testing
Latency
Data Consistency
Should I Use Microservices?
Who They Might Not Work For
Where They Work Well
Summary
2. How to Model Microservices
Introducing MusicCorp
What Makes a Good Microservice Boundary?
Information Hiding
Cohesion
Coupling
The Interplay of Coupling And Cohesion
Types of Coupling
Domain Coupling
Pass Through Coupling
Common Coupling
Content Coupling
Just Enough Domain-Driven Design
Ubiquitous Language
Aggregate
Bounded Context
Mapping Aggregates and Bounded Contexts to Microservices
Event-storming
The Case for Domain-Driven Design for Microservices
Alternatives to Business Domain Boundaries
Volatility
Data
Technology
Organizational
Different Goals, Different Drivers
Mixing Models and Exceptions
Summary
3. Splitting the Monolith
Have a Goal
Incremental Migration
The Monolith Is Rarely the Enemy
The Dangers of Premature Decomposition
What to Split First?
Decomposition By Layer
Code First
Data First
Useful Decompositional Patterns
Strangler Fig Pattern
Parallel Run
Feature Toggle
Data Decomposition Concerns
Performance
Data Integrity
Transactions
Tooling
Reporting Database
Summary
4. Microservice Communication Styles
From In-Process to Inter-Process
Performance
Changing Interfaces
Error handling
Technology for Inter-process Communication: So Many Choices
Styles of Microservice Communication
Mix and Match
Pattern: Synchronous Blocking
Advantages
Disadvantages
Where to Use It
Pattern: Asynchronous Non-blocking
Advantages
Disadvantages
Where to Use It
Pattern: Communication Through Common Data
Implementation
Advantages
Disadvantages
Where to Use It
Pattern: Request-Response Communication
Implementation: Synchronous Versus Asynchronous
Where to Use It
Pattern: Event-Driven Communication
Implementation
What’s in an Event?
Where to Use It
Proceed with Caution
Summary
II. Implementation
5. Implementing Microservice Communication
Looking for the Ideal Technology
Make Backwards Compatibility Easy
Make Your Interface Explicit
Keep Your APIs Technology-Agnostic
Make Your Service Simple for Consumers
Hide Internal Implementation Detail
Technology Choices
Remote Procedure Calls
REST
GraphQL
Message Brokers
Serialization Formats
Textual Formats
Binary Formats
Schemas
Structural vs Semantic Contract Breakages
Should You Use Schemas?
Handling Change Between Microservices
Avoiding Breaking Changes
Expansion Changes
Tolerant Reader
Right Technology
Explicit Interface
Catch Accidental Breaking Changes Early
Managing Breaking Changes
Lock-Step Deployment
Coexist Incompatible Microservice Versions
Emulate The Old Interface
Which Approach Do I Prefer?
The Social Contract
Tracking Usage
Extreme Measures
DRY and the Perils of Code Reuse in a Microservice World
Sharing Code Via Libraries
Service Discovery
Domain Name System (DNS)
Dynamic Service Registries
Don’t Forget the Humans!
Service Meshes and API Gateways
API Gateways
Service Meshes
What About Other Protocols?
Documenting Services
Explicit Schemas
The Self-Describing System
Summary
6. Workflow
Database Transactions
ACID Transactions
Still ACID, but Lacking Atomicity?
Distributed Transactions: Two-Phase Commits
Distributed Transactions—Just Say No
Sagas
Saga Failure Modes
Implementing Sagas
Sagas Versus Distributed Transactions
Summary
7. Build
A Brief Introduction to Continuous Integration
Are You Really Doing CI?
Branching Models
Build Pipelines and Continuous Delivery
Tooling
Tradeoffs and Environments
Artifact Creation
Mapping Source Code and Builds to Microservices
One Giant Repo, One Giant Build
Pattern: One Repository Per Microservice (aka Multi-Repo)
Pattern: Monorepo
Which Approach Would I Use?
Summary
8. Deployment
From Logical to Physical
Multiple Instances
The Database
Environments
Principles Of Microservice Deployment
Isolated Execution
Focus On Automation
Infrastructure As Code (IAC)
Zero-downtime Deployment
Desired State Management
Deployment Options
Physical Machines
Virtual Machines
Containers
Application Containers
Platform As A Service (PAAS)
Function As A Service (FAAS)
Which Deployment Option Is Right For You?
Kubernetes & Container Orchestration
The Case For Container Orchestration
A Simplified View Of Kubernetes Concepts
Multi-Tenancy and Federation
The Cloud Native Computing Federation
Platforms and Portability
Helm, Operators and CRDs, oh my!
And Knative
The Future
Should You Use It?
Progressive Delivery
Separating Deployment From Release
On To Progressive Delivery
Feature Toggles
Canary Release
Parallel Run
Summary
9. Testing
Types of Tests
Test Scope
Unit Tests
Service Tests
End-to-End Tests
Trade-Offs
Implementing Service Tests
Mocking or Stubbing
A Smarter Stub Service
Implementing (Those Tricky) End-to-End Tests
Flaky and Brittle Tests
Who Writes These End-to-End Tests?
How Long Should End-to-End Tests Run?
The Great Pile-up
The Metaversion
Lack Of Independent Testability
Should You Avoid End-to-End Tests?
Contract Tests and Consumer-Driven Contracts (CDCs)
The Final Word
Developer Experience
From Pre-Production to In-Production Testing
Types Of In-Production Testing
Making Testing In Production Safe
Mean Time to Repair Over Mean Time Between Failures?
Cross-Functional Testing
Performance Tests
Robustness Tests
Summary
10. From Monitoring to Observability
Single Microservice, Single Server
Single Microservice, Multiple Servers
Multiple Services, Multiple Servers
Observability vs Monitoring
The Pillars Of Observability? Not So Fast
Building Blocks For Observability
Log Aggregation
Metrics Aggregation
Distributed Tracing
Are We Doing OK?
Alerting
Semantic Monitoring
Testing In Production
Standardization
Selecting Tools
Democratic
Easy To Integrate
Provide Context
Real-time
Suitable For Your Scale
The Expert In The Machine
Getting Started
Summary
11. Security
Core Principles
Principle of Least Privilege
Defense in depth
Automation
Build Security Into the Delivery Process
The Five Functions of Cybersecurity
Identify
Protect
Detect
Respond
Recover
Foundations of Application Security
Credentials
Patching
Backups
Rebuild
Implicit Trust Versus Zero Trust
Implicit Trust
Zero Trust
It’s a Spectrum
Securing Data
Data in Transit
Data at Rest
Authentication and Authorization
Service to Service Authentication
Human Authentication
Common Single Sign-On Implementations
Single Sign-On Gateway
Fine-Grained Authorization
The Confused Deputy Problem
Centralized, Upstream Authorization
Decentralizing Authorization
JSON Web Token (JWT)
Summary
12. Resiliency
What Is Resiliency?
Robustness
Rebound
Graceful Extensibility
Sustained Adaptability
And Microservice Architecture
Failure Is Everywhere
How Much Is Too Much?
Degrading Functionality
Stability Patterns
Timeouts
Retries
Bulkheads
Circuit Breakers
Isolation
Redundancy
Middleware
Idempotency
Spreading Your Risk
CAP Theorem
Sacrificing Consistency
Sacrificing Availability
Sacrificing Partition Tolerance?
AP or CP?
It’s Not All or Nothing
And the Real World
Chaos Engineering
Game Days
Production Experiments
From Robustness to Beyond
Blame
Summary
13. Scaling
The Four Axis of Scaling
Vertical Scaling
Horizontal Duplication
Data Partitioning
Functional Decomposition
Combining Models
Start Small
Caching
For Performance
For Scale
For Robustness
Where to Cache
Invalidation
The Golden Rule of Caching
Freshness Versus Optimization
Cache Poisoning: A Cautionary Tale
Autoscaling
Starting Again
Summary
III. People
14. User Interfaces
Toward Digital
Ownership Models
Drivers for Dedicated Frontend Teams
Towards Stream-Aligned Teams
Sharing Specialists
Ensuring Consistency
Working Through Technical Challenges
Pattern: Monolithic Frontend
When to Use It
Pattern: Micro Frontends
Implementation
When to Use It
Pattern: Page-Based Decomposition
Where to Use It
Pattern: Widget-Based Decomposition
Implementation
When to Use It
Constraints
Pattern: Central Aggregating Gateway
Ownership
Different Types of User Interfaces
Multiple Concerns
When to Use It
Pattern: Backend for Frontend (BFF)
How Many BFFs?
Reuse and BFFs
BFFs for Desktop Web and Beyond
When to Use
GraphQL
A Hybrid Approach
Summary
15. Organizational Structures
Loosely Coupled Organizations
Conway’s Law
Evidence
Team Size
Understanding Conway’s Law
Small Teams, Large Organization
On Autonomy
Strong vs Collective Ownership
Strong Ownership
Collective Ownership
At a Team Versus Organizational Level
Balancing Models
Enabling Teams
Communities Of Practice
The Platform
Shared Microservices
Too Hard to Split
Cross-Cutting Changes
Delivery Bottlenecks
Internal Open Source
Role of the Core Committers
Maturity
Tooling
Pluggable, Modular Microservices
Change Reviews
The Orphaned Service
Case Study: RealEstate.com.au
Geographical Distribution
Conway’s Law in Reverse
People
Summary
16. The Evolutionary Architect
What’s in a Name?
What Is Software Architecture?
Making Change Possible
An Evolutionary Vision for the Architect
Defining System Boundaries
A Social Construct
Habitability
A Principled Approach
Strategic Goals
Principles
Practices
Combining Principles and Practices
A Real-World Example
Guiding An Evolutionary Architecture
Architecture in a Stream-Aligned Organization
Building a Team
The Required Standard
Monitoring
Interfaces
Architectural Safety
Governance and the Paved Road
Exemplars
Tailored Microservice Template
The Paved Road at Scale
Technical Debt
Exception Handling
Summary
Bringing It All Together
What Are Microservices?
Moving To Microservices
Communication Styles
Workflow
Build
Deployment
Testing
Monitoring and Observability
Security
Resiliency
Scaling
User Interfaces
Organization
Architecture
Further Reading
Looking Forward
Final Words
A. Bibliography
Glossary

Product information

Author(s): Sam Newman
Release date: August 2021
Publisher(s): O’Reilly Media, Inc.
ISBN: 9781492034025

Download Building Microservices: Designing Fine-Grained Systems, 2nd Edition Pdf Free:

You can easily download Building Microservices: Designing Fine-Grained Systems, 2nd Edition PDF by clicking the link given below. If the PDF link is not responding, kindly inform us through comment section. We will fixed it soon.

Click here to download

 NOTE: We do not own copyrights to these books. We’re sharing this material with our audience ONLY for educational purpose. We highly encourage our visitors to purchase original books from the respected publishers. If someone with copyrights wants us to remove this content, If you feel that we have violated your copyrights, then please contact us immediately. please contact us. or Email: [email protected]

Leave A Reply

Your email address will not be published.

5 × 2 =