GOTO Berlin: Microservices as an Alternative to Monoliths
Are we building systems that are too big, bigger than they need to be, James Lewis, a principle consultant at ThoughtWorks, started his presentation at the GOTO Berlin Conference when talking about "Microservices - adaptive architectures and organisations". There are examples where up to 90% of the total cost of ownership incurs after the launch of a system. There are also lots of examples of projects where we as an industry have spent a huge amount of money on building very large, complex and ultimately unsuccessful systems.
James’ experiences at large organisations where a traditional way of building systems is to put all functionality in one big application, with one big database and the problems this creates, has led him into a path of building systems where entirely separate business capabilities are kept separate in smaller parts, as microservices, each with their own database.
His first step on this path is the idea of hexagonal business capabilities and refers to Alistair Cockburn’s Hexagonal Architecture. One single business capability or functionality, together with its own data, forms a hexagon, a bounded context using DDD terms. All these hexagons are then put together in a larger hexagon, eventually forming a system.
His next step concerns a uniform interface for all services. A common integration technology when building system in isolation has been integration with direct database access. Problems with this is that it tightly couples different parts of a system, logic and data gets easily scattered all over the system and it becomes difficult to predict effect of changes. James prefers to use the ways of integration that the Web so successfully uses, based on http, html and hypermedia, and therefore uses REST for communication. Two standard application protocols James finds useful together with REST are Atom and AtomPub.
James believes that all these small services should obey the Single Responsibility Principle and that the principle should apply at every level of abstraction, from objects to subsystems business capabilities, and all the way up to the system.
In his final step James looked into scalability. Building a single large system with all functionality makes it hard or impossible to scale different parts of the system. If some parts have a high load and other a much lower load they must still run with the same capacity. With small services they can be deployed on different servers using different number of servers. Another advantage is that different services can be implemented on different platforms. A vital factor when using many small services is to automate monitoring and deployment e.g. using programmable infrastructure. Advances in virtualization and Infrastructure as a Service, IAAS, providers during the last couples of years makes this possible.
The GOTO Berlin Conference 2013 is the first GOTO conference in Berlin, with over 400 attendees and about 80 speakers.
Keith Adams Dec 06, 2013