Incremental developments in core engineering practices for software development have created the foundations for rethinking how architecture changes over time, along with ways to protect important architectural characteristics as it evolves. This practical guide ties those parts together with a new way to think about architecture and time. The software development ecosystem is constantly changing, providing a constant stream of new tools, frameworks, techniques, and paradigms. Over the past few years, incremental developments in core engineering practices for software development have created the foundations for rethinking how architecture changes over time, along with ways to protect important architectural characteristics as it evolves. This practical guide ties those parts together with a new way to think about architecture and time Copyright 4 Table of Contents 5 Foreword 9 Preface 11 Conventions Used in This Book 11 O’Reilly Safari 11 How to Contact Us 12 Additional Information 12 Acknowledgments 12 Chapter 1. Software Architecture 15 Evolutionary Architecture 17 How Is Long-term Planning Possible When Everything Changes All the Time? 17 Once I’ve Built an Architecture, How Can I Prevent It from Gradually Degrading Over Time? 20 Incremental Change 20 Guided Change 21 Multiple Architectural Dimensions 22 Conway’s Law 25 Why Evolutionary? 27 Summary 28 Chapter 2. Fitness Functions 29 What is a Fitness Function? 31 Categories 32 Atomic Versus Holistic 33 Triggered Versus Continual 33 Static Versus Dynamic 34 Automated Versus Manual 34 Temporal 35 Intentional Over Emergent 35 Domain-specific 35 Identify Fitness Functions Early 36 Review Fitness Functions 37 Chapter 3. Engineering Incremental Change 39 Building Blocks 42 Testable 43 Deployment Pipelines 45 Combining Fitness Function Categories 49 Case Study: Architectural Restructuring while Deploying 60 Times/Day 51 Conflicting Goals 53 Case Study: Adding Fitness Functions to PenultimateWidgets’ Invoicing Service 54 Hypothesis- and Data-Driven Development 56 Case Study: What to Port? 58 Chapter 4. Architectural Coupling 61 Modularity 61 Architectural Quanta and Granularity 62 Evolvability of Architectural Styles 65 Big Ball of Mud 66 Monoliths 67 Event-Driven Architectures 74 Service-Oriented Architectures 79 “Serverless” Architectures 90 Controlling Quantum Size 92 Case Study: Guarding Against Component Cycles 93 Chapter 5. Evolutionary Data 97 Evolutionary Database Design 97 Evolving Schemas 97 Shared Database Integration 99 Inappropriate Data Coupling 103 Two-Phase Commit Transactions 104 Age and Quality of Data 106 Case Study: Evolving PenultimateWidgets’ Routing 107 Chapter 6. Building Evolvable Architectures 109 Mechanics 109 1. Identify Dimensions Affected by Evolution 109 2. Define Fitness Function(s) for Each Dimension 110 3. Use Deployment Pipelines to Automate Fitness Functions 110 Greenfield Projects 111 Retrofitting Existing Architectures 111 Appropriate Coupling and Cohesion 111 Engineering Practices 112 Fitness Functions 112 COTS Implications 113 Migrating Architectures 114 Migration Steps 115 Evolving Module Interactions 118 Guidelines for Building Evolutionary Architectures 121 Remove Needless Variability 121 Make Decisions Reversible 123 Prefer Evolvable over Predictable 124 Build Anticorruption Layers 125 Case Study: Service Templates 127 Build Sacrificial Architectures 128 Mitigate External Change 129 Updating Libraries Versus Frameworks 131 Prefer Continuous Delivery to Snapshots 132 Version Services Internally 133 Case Study: Evolving PenultimateWidgets’ Ratings 133 Chapter 7. Evolutionary Architecture Pitfalls and Antipatterns 137 Technical Architecture 137 Antipattern: Vendor King 137 Pitfall: Leaky Abstractions 139 Antipattern: Last 10% Trap 141 Antipattern: Code Reuse Abuse 142 Case Study: Reuse at PenultimateWidgets 144 Pitfall: Resume-Driven Development 145 Incremental Change 145 Antipattern: Inappropriate Governance 146 Case Study: Goldilocks Governance at PenultimateWidgets 148 Pitfall: Lack of Speed to Release 148 Business Concerns 150 Pitfall: Product Customization 150 Antipattern: Reporting 151 Pitfall: Planning Horizons 152 Chapter 8. Putting Evolutionary Architecture into Practice 155 Organizational Factors 155 Cross-Functional Teams 155 Organized Around Business Capabilities 157 Product over Project 158 Dealing with External Change 159 Connections Between Team Members 160 Team Coupling Characteristics 161 Culture 162 Culture of Experimentation 163 CFO and Budgeting 165 Building Enterprise Fitness Functions 166 Case Study: PenultimateWidgets as a Platform 167 Where Do You Start? 167 Low-Hanging Fruit 167 Highest-Value 168 Testing 168 Infrastructure 169 Case Study: Enterprise Architecture at PenultimateWidgets 170 Future State? 171 Fitness Functions Using AI 171 Generative Testing 171 Why (or Why Not)? 171 Why Should a Company Decide to Build an Evolutionary Architecture? 172 Case Study: Selective Scale at PenultimateWidgets 174 Why Would a Company Choose Not to Build an Evolutionary Architecture? 175 Convincing Others 176 Case Study: Consulting Judo 177 The Business Case 177 “The Future Is Already Here...” 177 Moving Fast Without Breaking Things 178 Less Risk 178 New Capabilities 178 Building Evolutionary Architectures 178 Index 181 About the Authors 189 Colophon 190 "The software development ecosystem is constantly changing, providing a constant stream of new tools, frameworks, techniques, and paradigms. Over the past few years, incremental developments in core engineering practices for software development have created the foundations for rethinking how architecture changes over time, along with ways to protect important architectural characteristics as it evolves. This practical guide ties those parts together with a new way to think about architecture and time."--Amazon.com