Software Architecture — quest for “quality without a name”
What is a good Software Architecture?
Here is the Webster’s meaning —
architecture noun
1 :the art or science of building
specifically : the art or practice of designing and building structures and especially habitable ones
2 :the manner in which the components of a computer or computer system are organized and integrated // different program architectures
Computer software architecture has evolved a lot and is still rapidly evolving. I wanted to understand the relationship between Architecture that deals with buildings and structures and Software Architecture and specifically the Software Patterns movement.
In the early days of my career, I came across Design Patterns and I picked up a copy of the most widely known patterns work at that time — Gang of Four (GOF) Design Patterns book by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides. In learning about the pattern movement and history, I came across Christopher Alexander and his seminal book The Timeless Way of Building (1979) that has had a huge influence on Software Design and Architecture but I couldn’t realize the full impact of it at that time. I read Alexanders book again recently after a long time and it was simply an eye opening.
His Pattern Languages concept gave rise to the software pattern movement in The Hillside Group with many distinguished software professionals contributing to the evolution of software patterns. It gave birth to the flagship patterns conference called the Pattern Languages of Programs conference, abbreviated as PLoP. PLoP has been held in the U.S.A. since 1994.
Quality without a name
A brief foray into Alexander’s work.
What makes a building good or bad? Why some architectures are lively? Around the world, there are some historic ancient architectures that are unique and have a character. Buildings, neighborhoods and towns share some common traits and we can see some “patterns” in them repeated although each building is unique. These buildings and neighborhoods have some local geographical as well as cultural traits. Some are alive, vibrant and some are not. What makes them so? What is that central thing in all these buildings which makes one “feel” it is good or bad?
“There is a central quality which is the root criterion of life and spirit in a man, a town, a building, or a wilderness. This quality is objective and precise, but it cannot be named. We know, now, what the quality without a name is like, in feeling and in character. But so far, concretely, we have not seen this quality in any system larger than a tree, a pond, a bench. Yet it can be in anything — in buildings, animals, plants, cities, streets, the wilderness — and in ourselves. We shall begin to understand it concretely, in all these larger pieces of the world only when we first understand it in ourselves. It is, for instance, the wild smile of the gypsies dancing in the road.” — Alexander
Alexander contends that this quality cannot be described by a word as words are too broad and quality is too particular. He argues various words like alive, whole, comfortable, free, exact, egoless, eternal etc may come close but don’t capture the full essence of that quality and hence it cannot be named! We can begin to understand it by observing certain pattern on events happening in that place.
An example of a pattern is “watching the world go by, sitting on porch”. The porch enables the event of sitting and watch the world go by. Similarly, an “alcove” gives a sense of coziness in a bedroom wall. “Entrance transition” is another pattern. The building essentially becomes a collection of such patterns where each pattern is defined by the pattern of events happening there. These set of patterns form a pattern language.
People can shape the buildings by using languages called pattern languages. Using these, people can generate infinite variety of new and unique buildings. For example, farmers make barns using patterns. These patterns are expressed as rule of thumb which any farmer can combine and re-combine to make an infinite variety of unique barns by using a pattern language. An example outline of Alexander’s pattern language for a farm house in the Bernese Oberland:
NORTH SOUTH AXIS
WEST FACE ENTRANCE DOWN THE SLOPE
TWO FLOORS
HAY LOFT AT THE RACK
BEDROOMS IN FRONT
GARDEN TO THE SOUTH
PITCHED ROOF
BALCONY TOWARD GARDEN
CARVED ORNAMENTS
Each of these patterns is expressed in the form of a rule which tells the farmer what to do.
When these patterns are shared by a neighborhood or town, you will see the same quality without a name appearing in all of those neighborhoods and towns. This is how they acquire uniqueness. Think New York or San Francisco residential architectures. There is a repeating pattern and a character to those buildings albeit every building is unique in itself.
A pattern is a three-part rule, which expresses a relation between a certain context, a problem, and a solution.
Alexander contends patterns by itself is nothing but contributes towards the whole. A building that is live is not anyone’s idea or opinion but it just “feels” good and natural and has that quality without a name. When a building has this quality without a name, it becomes one with nature.
Software Connection
What does this all have to do with software architecture?
Software architectures have many semblances with buildings. The software patterns are analogous to the building patterns. The pattern movement espoused this relationship in early 1990s and resulted in various works such as Gang of Four (GoF) Design Patterns, Kent beck’s Implementation patterns and many more. There are plenty of other patterns such as Circuit Breaker, Dispatcher pattern and many more.
The question remains — what is a good software architecture? Is there a “quality without a name” in Software and if so, how do we achieve it?
Alexander’s pattern language brings a quality without a name in the building/neighborhood. By analogy, a software pattern language could do the same to software architecture. Essentially, the quality in a software emerges from the patterns employed.
The buildings have the advantage of being visual and tangible and in fact, Alexander contends that no matter what patterns are used, the aliveness of a building has to be felt. It is not just someones opinion or idea of the architecture. It is alive by the system of forces it resolves and pattern of events it generates.
Software architecture on the other hand is not tangible and only the user interface is visible. The quality in a software architecture is determined by how well it satisfies the business and technical requirements. It can be felt by the developers who write and maintain the code. It can be felt by the business in the way it enables faster and efficient realization of business objectives. It is felt by operations & support that are involved in running it in production. It is felt by quality and security teams in the way it reduces production incidents.
In essence, the pattern of events that are generated by the software patterns could be a good measure of this intangible, unseen and elusive quality without a name.
Similar to the buildings shaped by the alexanders pattern languages, software can be built using software pattern languages. The software that is produced so has that quality without a name which makes it good! These patterns, when shared by software community, bring out the same quality without a name in other softwares.
Sam’s Club New eCommerce Platform (Ada)
That brings us to Ada. As we embarked on the journey of modernizing our legacy platform to a new eCommerce platform, a natural question arises as to the quality and efficacy of that architecture. How does the new architecture enable the best possible experience to members who shop at Sam’s Club? Is it possible to perceive the quality in this architecture?
By the software connection corollary above, one way to examine the quality without a name in Ada is by looking at the patterns employed in building it.
First, here are the system of forces to be resolved in Ada —
- The monolithic mindset coming from a Monolithic server with a single code base with lot of developers.
- Monthly releases where all features are synchronized monthly.
- Everything accessible to everyone to change, which is the reason for expensive code changes.
- Limited Scalability and Availability ; Hard to maintain due to production incidents arising out of lot of accidental code complexity
- Metrics deduced from Log data with higher latency/lags.
- Deployments are in off hours causing a toil on all
- Holiday preparation takes months to plan
- ……
There are many patterns used in Ada to combat these forces but here is an example Ada’s pattern language (which is still evolving):
MICROSERVICES
DOMAIN DRIVEN DESIGN
CQRS [COMMAND QUERY RESPONSIBILITY SEGREGATION]
BUILD RESILIENCY USING FAILURE MODE ANALYSIS
PRE-COMPUTATION
SERVICE LEVEL OBJECTIVES
HUB AND SPOKE
TELEMETRY INDEPENDENT OF LOGGING
SCALABLE, CONCURRENT CACHE
CANARIES
SEPARATE DEPLOYMENT PER VERSION
SERVERLESS
Here is a detailed look at some of the important patterns from above and the pattern of events it generates and how those events are beneficial to the business to assess the “quality without a name” in Ada’s architecture —
Conclusion
Each of the above patterns contributes to the whole similar to Alexanders patterns of “ALCOVE IN A BEDROOM WALL” or “BALCONY TOWARD GARDEN”. Some of the above patterns are industry standard best practices and some are specific to Samsclub. The quality in architecture is determined by the pattern of events generated by these patterns.
Alexanders pattern language provides a framework to realize the “quality without a name” in Software Architectures via Software Patterns that gives us one way to assess whether an architecture is good or bad.