Architecture Considerations. More Important Than You Might Think.
Architecture, which architecture? The architecture of the things we are delivering. On a pretty abstract level. We are going to build something the fulfills the need of some user. Does not even matter if he or she or they pay us. There is a job to be done and we either get the job done directly or we are going to provide some means to get this job done. This is my level of abstraction.
If we are doing something for our user, (who now secretly turned into a customer, because the user now does not actively use our work product) we need to focus on the workflow for the activity. This workflow is actually the value stream. There is a number of methods or recipes out there that tell and educate you on how find the value stream. Just find it yourself. When you are done you will have a structure like this:
Value stream for a hypothetical activity executed for our customer
There are three “swim lanes” associated with with three different teams or competences or manufacturing stations, and the work is being passed through the different entities and teams until it gets finished. There are parallel activities, there are dependencies. Each box describes a discrete activity that has a start and an end, receives some specific input and delivers a specific output. This work breakdown is like an architecture of the workflow. The building blocks are specific activities. Time by the way is running from left to right. There might be some improvement potential, but at least the work is structured and well prepared for improvement measures. I will not discuss them here. They are in the expertise of lean management or lean manufacturing.
For me it is enough that we see clear input and output and clear interfaces. The work can be modularized and measured and improved in the sense of scientific management – if the management knows how to do the steps in the boxes or we can use the ideas from the Toyota Manufacturing System to have the value generators improve the process. (The only place where value is generated is a the shop floor. Everybody else is doing work classified as “non value-add necessary”. In best case. All other cases qualify as “waste”.) In a way, this is also classical scientific management by F.W. Taylor.
In the case of a physical or logical product, i.e. some output the customer wants to use him or herself to generate value no his/her own, we have a similar concept: the boundary diagram.
A boundary diagram for a system. Boxes denote an internal structure called subsystems. There are well defined inputs and outputs for the system and its subsystem.
There probably are a number of definitions for boundary diagrams. A very simple one is that we structure the system in such a way that all sub-units are independent and communicate with the environment though interfaces with defined
- material transfer
- information transfer
- energy transfer
- mechanical contact.
(Yes, information transfer is the same as energy transfer in a Physics world, but in engineering it is smart to separate both, even when it is not correct at all.)
If you follow me down this rabbit hole (see “Alice’s Adventures in Wonderland” by Lewis Caroll), we can realize that all products and services can be implemented in independent boxes with defined interfaces. Pretty spooky thing, right?
Now it is time to learn from some big guys. I can describe everything in units with interfaces. Sounds like service based solutions. Yes. This would be service based and each box represents a service. If I now freeze the interfaces, all these services now become independent. Correct? In consequence, all the insides of the boxes can be hidden behind a magic curtain. You might want to check out the famous example of the Mechanical Turk. From the outside you cannot detect if there is a machine or a person. (Yes, you can remember the Turing test now ). Same story: as long as I do not tell you what is in side the box, I can do what I want and you will not be unhappy as long as I am delivering according to what I promised. In our speak: I deliver according to my output specification.
If you are at that point, you may want to check the ideas of Simon Wardley on Wardley mapping. (Simon, I know I am oversimplifying, but this is the way my brain works. Sorry.) The Amazon way of monetizing services is also an option. I believe this is how Amazon Web Services were started.
Back to our architecture. Perfect situation: I am free to do whatever I like if and when I keep my promise. I can optimize my work. I can use the tools I want, I can use the methods I want, etc. Which tools and methods do I want? Typically the ones that make my life as easy as possible. Nature always takes the path of least resistance. No, that is a lie. Nature takes the path of least action, which is the physicist way of saying: “The path of the least effort.” We can describe nature pretty well, when we assume it to be lazy. Now tell me Physics is not fun. After sneaking in some Richard Feynman wisdom, let us have a look at the ideas of Application Programming Interface first (API-first) as a useful concept.
The Steve Yegge’s “Google Platforms Rant” CSE 452: Google’s Introduction to Distributed System Design
“[…]
His Big Mandate went something along these lines:
- All teams will henceforth expose their data and functionality through service interfaces.
- Teams must communicate with each other through these interfaces.
- There will be no other form of interprocess communication allowed: no direct linking, no direct reads of another team’s data store, no shared-memory model, no back-doors whatsoever. The only communication allowed is via service interface calls over the network.
- It doesn’t matter what technology they use. HTTP, Corba, Pubsub, custom protocols – doesn’t matter. Bezos doesn’t care.
- All service interfaces, without exception, must be designed from the ground up to be externalizable. That is to say, the team must plan and design to be able to expose the interface to developers in the outside world. No exceptions.
- Anyone who doesn’t do this will be fired.
- Thank you; have a nice day!
[…]”
This is what Steve Yegge claims has been mandated by Jeff Bezos for Amazon. Quite some time ago.
In the light of what we just looked at before, these are some simple rules to follow in order to generate something very modular, adaptable and externizable, i.e. if you find the function somewhere a bit cheaper and it is not of strategic value for you, buy it, don’t make it. If you can sell the function as a service: sell it. Maybe you have heard of Amazon Web Services before. Something they sold to the outside world. This is the meaning of “externizable”. If you can sell it, sell it as a package. The same thing in reverse: If you can sell it as a package, you can easily also buy it from somebody else and weave it into your solution.
Wait a second though. Steve Yegge writes that Jeff Bezos wrote about teams, while I talked about functions and subsystems. You can match sub-system structure with team structure. Mathematically this is an isomorphism. In the original paper, Melvin Conway promoted a homomorphism between team structure and product/service architecture. He did not talk about service architecture, but see above. Difference between isomorphism and homomorphism? Something is isomorphic if the structure is exactly the same. If two subsystems or two functions are very small and it for some reason makes sense to keep them separate, you can ask one team to work on both. Voilà: the isomorphism becomes a homomorphism. Very simple. One team does one sub-system. If the sub-system is too large, make it smaller, BUT fix the interfaces.
The screw can be turned one more notch: Haier, the appliance maker, or rather its CEO Zhang Ruimin has taken an extreme approach to generate sub-system solutions: Micro-enterprises. The internal contracting as principle for coordination can be seen as a (very abstract) API. Simply an API between companies. In the bottom of the article, you will find the statement that complex systems cannot be engineered top down, but that they need to emerge bottom up. We will come to this point in the next chapter.
On the practical side: How should I know in the beginning which structure is the right one? Building teams takes a bit of time and in the end we are dealing with people. We do not want to move people around the organization with a high frequency. Simple solution: Separate the flow organization from the hierarchical organization. In the areas of high uncertainty, it make sense to separate line responsibilities from content responsibilities. If you do that, you can borrow the idea of “Tiger Teams”. Keep the team structure malleable until the solution becomes clear. Then harden the structure to give security to people. Still hierarchical leadership does not need to coincide with technical leadership. It can however. Understanding this concept explains the success of a number of startup compared to teams from corporations. In the startup, you focus on the product and the hierarchy follows. Like the Bauhaus Form follows Function concept. Keep even your hierarchy product centric. Corporations often react differently to challenges.
- Separate line organization from technical organization, i.e. line leadership is different from technical leadership. This causes conflicts between leaders, but this is not presenting a problem, since leadership is “non-value add necessary” at best and the developer produce the value in the organization. The conflict is not where value is generated.
- Match the technical organization to the product architecture. That allows the right people to be in close vicinity (not necessarily in physical proximity, but in terms of functionality.
- Understand that the architects in your organization are in a leadership role. Choose and and educate them wisely. Listen to them and provide them with the necessary power. A seasoned developer may not necessarily be the best architect. Make him or her a senior or “executive” developer. A more junior developer may in fact be a better architect. Architecting things and developing things are two different trades. Sometimes.
- Architecture is more than the documentation of your product. It is defining the products future and modularity and feature roadmap. As a Danish proverb says: “Predictions are very difficult. Especially about the future”, the task is difficult. One solution thus is to keep the architecture as adaptive as possible.
So far so good. As takeaway for now, we have:
- Understand the product/service.
- Decide if you need a modular and adaptive architecture or you are better off with a monolithic solution.
- If you want a modular and adaptive product/service, structure your product or service with focus on modularity.
- Define and document the architecture. Make sure the architecture welcomes adaptations.
And two more things.
- There is intentional architecture and emergent design. Both work hand in hand.
- A monolithic solution has its benefits, just as modular solutions have their benefits. As always: It depends on the context. The lead architect needs to make a decision. The decision may be right or wrong, but a decision is needed.
Intentional and Emergent Design
Architecture plays at different levels. Above we discussed abstract boxes of functionalities in value streams and boundary diagrams. How boxes are connected at the level of interest is the realm of intentional architecture. An architect understands the functionality of the product or the execution of the workflow and structures the topic. This is what we understand as “intentional architecture“. What happens within the box is in the authority of the team, developing the functionality. On this level, one level lower than the “intended” architecture, we also have an intended architecture. Just one inside the functionality. When we now add feedback or “correction loops” into the system, i.e. we allow the architects and developer from inside the boxes to communicate with the architects defining the system architecture, new ideas and solutions may appear. If they do, new solutions ideas may manifest. This is the realm of emergent design. Emergence means that the system has properties that could not be foreseen in the properties of its constituents. Emergent design results from iterative delivery of constituents of the system we are working to deliver. (See also the HBR article on Haier.) There is no such thing as emergent architecture. In order to control the design of things, architecture needs to be intentional. If architecture just “happens” it may be seen as emergent, but in fact it is just reverse engineering of a solution and trying to justify decisions taken on the fly. Emergent design is a very useful consequence of iterative development. Architecture may change and evolve as the solution develops. There is no contradiction: if architecture is sketched/documented/drawn as the solution is developed, the solution structure is validated with an architectural description. Trust me: you will find flaws right away. It is similar to the statement “If you can’t explain it to a six-year old, you don’t understand it yourself.” (Probably by Einstein.) If your design is not simple, it will not be easy to modify and to extend in the sense of iterative development. Thus, you will automatically kill it after a few weeks latest. Simply BECAUSE you cannot extend the functionality in the sense of iterative development. But, you will only kill it if I insist on interactive development and frequent demos. This is where puzzle pieces fall together and generate a solution. Remember this thing with with agility? Always demo the product. This is the very reason why. If you can demo every week or every other week, you HAVE a modular architecture that welcomes changes. If you can’t demo frequently, I have an idea why… BTW: you can plan a modular architecture. Agility is not a must. It just points you to an adaptive solution.
After discussion architecture in general, let us have a look at possible solutions for easy and cheap adaptability: The API-first approach.