Chapter 9: Performance – Design Patterns & Optimization
Loading audio…
ⓘ This audio and summary are simplified educational interpretations and are not a substitute for the original text.
Performance – Design Patterns & Optimization on performance in software architecture centers on ensuring a system’s ability to meet timing constraints, which is vital because all computing operations, from nanosecond computations to milliseconds for network and disk access, consume time. Performance is formalized by characterizing event arrival patterns and the system's time-based response, measured via metrics like latency, throughput, and jitter. A concrete performance scenario outlines the stimulus, the artifact stimulated, the system environment, the resulting response, and the performance measure used. A core technique for boosting performance is leveraging concurrency—allowing operations in parallel—though this demands strict management of shared system state to proactively prevent hard-to-find bugs known as race conditions. Architects employ two primary categories of tactics to control time and resource usage: controlling resource demand and managing existing resources. Demand control involves establishing Service Level Agreements (SLAs) to set maximum event rates, prioritizing critical events, limiting execution times, and reducing computational overhead by decreasing indirection or co-locating communicating components. Resource management tactics include provisioning faster hardware, using replication for computations (often managed by a Load Balancer) and data (caching), and applying various scheduling policies—including fixed-priority schemes like rate monotonic or dynamic approaches such as earliest-deadline-first—to minimize blocked time caused by resource contention. To address complex scaling needs, several design patterns are utilized, such as the Service Mesh, which uses sidecar proxies to efficiently handle cross-cutting concerns in microservices; Throttling, which limits incoming requests to prevent service overload; and Map-Reduce, which is optimized for distributed, high-performance parallel analysis of massive datasets.