The Patterns Approach
Professionals seeking practical advice need an intuitive understanding of these systems that goes beyond theory. They need detailed and specific explanations that help comprehend real code while remaining applicable to a wide range of systems. The Patterns approach is an excellent tool to fulfill these requirements.
The concept of patterns was initially introduced by architect Christopher Alexander in his book A Pattern Language [Alexander1977]. This approach gained popularity in the software industry, thanks to the influential book widely known as the Gang Of Four [Gamma1994] book.
Patterns, as a methodology, describe particular problems encountered in software systems, along with concrete solution structures that can be demonstrated by real code. One of the key strengths of patterns lies in their descriptive names and the specific code-level details they provide.
A pattern, by definition, is a “recurring solution” to a problem within a specific context. Therefore, something is only referred to as a pattern if it is observed repeatedly in multiple implementations. Generally, The Rule of Three3 is followed—a pattern should be observed in at least three systems before it can be recognized as a pattern.
The patterns approach, employed in this book, is rooted in the study of actual codebases from various open source projects, such as Apache Kafka,4 Apache Cassandra,5 MongoDB,6 Apache Pulsar,7 etcd,8 Apache ZooKeeper,9 CockroachDB,10 YugabyteDB,11 Akka,12 JGroups,13 and others. These patterns are grounded in practical examples and can be applied to different software systems. By exploring the insights gained from these codebases, readers can learn to understand and apply these patterns to solve common software challenges.
Another important aspect of patterns is that they are not used in isolation but rather in conjunction with other patterns. Understanding how the patterns interlink makes it much easier to grasp the overall architecture of the system.
The next chapter takes a tour of most of the patterns and shows how they link together.