Im Laufe der Jahre hat sich die Anwendungsarchitektur weiterentwickelt. Diese Entwicklung wurde durch die Notwendigkeit vorangetrieben, die Herausforderungen zu meistern, die sich aus den realen Anwendungsanforderungen ergeben. Wir begannen mit monolithischen, Client/Server-, N-Tier- und API-First-Anwendungsarchitekturen.
Microservices sind ein architektonisches Muster, das sich unter anderem als Antwort auf Continuous Delivery & Continuous Integration (CD/CI), Infrastrukturautomatisierung, domänenorientiertes Design, verteilte Teams und die Komplexität von Anwendungen und Interaktionen entwickelt hat.
Obwohl die Microservices-Architektur als Allheilmittel für alle Probleme der modernen Anwendungsentwicklung angepriesen wird und als Nachfolger der API-First-Anwendungsentwicklung gilt, erfordert ihre Umsetzung weit mehr Überlegung und Pragmatismus. Entwicklungsteams fallen auf das Gerede über dieses Architekturmuster herein und setzen es in der Praxis häufig falsch um.
Wir werden hier nicht näher darauf eingehen, was ein Microservices-Architekturmuster ist. Vielmehr werden wir einige häufige Fallstricke bei der Implementierung aufzeigen und ein pragmatisches Erweiterungsmuster (Orchestrierung) anbieten.
Was ist eine Microservices-Architektur?
Der Architekturstil der Microservices ist ein Ansatz zur Entwicklung einer einzelnen Anwendung als eine Reihe von Diensten, die unabhängig voneinander entwickelt und bereitgestellt werden können. Jeder Dienst läuft in einem eigenen Prozess und kommuniziert mit der Außenwelt, oft unter Verwendung von REST-Prinzipien. Jeder Dienst ist eigenständig und bietet eine Reihe von Funktionen, die unabhängig voneinander gewartet werden können.
The term "Microservice Architecture" has sprung up over the last few years to describe a particular way of designing software applications as suites of independently deployable services. While there is no precise definition of this architectural style, there are certain common characteristics around organisation around business capability, automated deployment, intelligence in the endpoints, and decentralised control of languages and data.Martin Fowler
Eine bildliche Darstellung, die monolithische und Mikrodienst-Architekturen vergleicht.

Häufige Fallstricke bei der Implementierung
Obwohl der kanonische Weg (siehe oben) für die Entwicklung von Mikrodiensten vorgeschrieben ist, sehen wir bei der Implementierung häufig einige Abweichungen. Meistens sind die Gründe dafür Kostenerwägungen, Zeitmangel der Entwicklungsteams und die Reduzierung der Interaktionskomplexität. Lassen Sie uns einige "Microservices-Architekturen" aus realen Implementierungen untersuchen.
Einzelne Datenbank Microservices
Though the development team starts nice and good, they make the choice of each service talking to the same database store. Reasons given are costs, reference and relational data etc.
Grobkörnige Microservices
Instead of having granular services which is based on the Single Responsibility Principle, they create a couple of coarse grained services which bundle most of the features within it. If any new service needs to be developed, they add it to the best fit coarse grained service. So over a period of time there will be no difference between this architecture and a monolithic one.
Knoten Anti-Muster Microservices
This type of Microservices architecture is more insidious, in the sense that it develops overtime. It starts off as a pure form micro services and then over a period of time as more fine grained services are added, the complexity of interaction manifests as an Anti Pattern called Knot. By then it is too late as significant resources and time would have already been spent on developing it. So there will be resistance all around in fighting the inertia and fixing this. Moreover organisationally there is no single role who will be willing to change this. So they continue building it with increasing complexity and its attendant issues.


Orchestrierung von Microservices
We have till now seen how Microservices Architecture in practise leads to sub optimal implementations. Moreover these implementation patterns occur over a period of time and have very good reasons for its evolution. So what can we do to avoid this? Is there a pattern that can alleviate most if not all of the evolutionary pitfalls? Can we establish an architecture that accepts this evolutionary implementation pressure and provides a prescription for it? The answer is yes. It is Microscervices Orchestration. We create a symphony of micro services which when conducted properly produces melodious music instead of cacophony.
Das Dirigieren der Symphonie
In order to conduct orchestration in a repeatable and consistent way, we need to create Recipes for each higher order service calls. Recipe : Is an ordered configuration of underlying micro services where the sequence of inputs and outputs to and from a service are defined to achieve a higher order feature.

Zusammenfassung
Microservices architecture is designed for adding requirements at any time. This architecture style is a very good fit for agile development processes and for distributed teams (either geographically or functionally). It is possible to implement a minimum viable product, deliver it to the user and then extend the system over time. But we need to be aware the evolutionary patterns that emerge. By applying explicit orchestration to a Microservices Architecture we can avoid many of the common implementation pitfalls.Verfasst von
Sai Panyam
Consulting Architect, cOMakeIT
Contact



