Slide 1

Slide 1 text

Goodbye Microservices, Hello Self-Contained Systems Simon Martinelli

Slide 2

Slide 2 text

About Me • 30 years in software engineering • 25 years with Java • Self-employed since 2009 • Teaching at two Universities • Co-Lead JUG Berne, Switzerland

Slide 3

Slide 3 text

The Evolution of Architecture

Slide 4

Slide 4 text

Until 1999

Slide 5

Slide 5 text

2000 - 2010

Slide 6

Slide 6 text

2011 - Today

Slide 7

Slide 7 text

Are Those the Same Thing? 7

Slide 8

Slide 8 text

1972 The effectiveness of a modularization is dependent upon the criteria used in dividing the system into modules. On the criteria to be used in decomposing systems into modules - David L. Parnas Published in Communications of the ACM Volume 15 Issue 12, Dec. 1972

Slide 9

Slide 9 text

It’s All About Modularity Module A self-contained component of a system, often interchangeable, which has a well-defined interface to the other components. Source: https://en.wiktionary.org/wiki/module 9

Slide 10

Slide 10 text

Does The Size Matter? • The term MICRO is misleading • Scope matters • Bounded Contexts • Design for Maintenance • 3 to 10 developers per Microservice during project development • But how many developers will maintain the system? 10

Slide 11

Slide 11 text

Modularity and Distribution 11 Distribution Modularity Modular monolith Monolithic big ball of mud Distributed big ball of mud Microservices

Slide 12

Slide 12 text

Distributed Big Ball of Mud • If you can't build a modular monolith, what makes you think microservices are the answer? - Simon Brown 12 Customer Order Catalog

Slide 13

Slide 13 text

Distribution and Communication • First Law of Distributed Object Design: Don't distribute your objects - Martin Fowler 13 Synchronous Request 1 Response 1 Request 2 Response 2 Asynchronous Request 1 Response 1 Request 2 Response 2 Event based Event 1 Event 3 Event 2 Event 4

Slide 14

Slide 14 text

Beware of the N+1 Select Problem • Use Case: Select all orders of certain customers 1. 1 request to get all customers 2. n requests to get orders of customer 14 Customer Order Client 1 1 ... n

Slide 15

Slide 15 text

Distributed Architecture Patterns Backend A Database A Database B Backend D Database D Frontend A Frontend B Frontend C Backend B Backend C Self-Contained System Monolithic frontend Integration Database

Slide 16

Slide 16 text

Self-Contained Systems Architecture https://scs-architecture.org The content in this section is licensed under the Creative Commons attribution-sharealike 4.0 international license.

Slide 17

Slide 17 text

What are Self-Contained Systems? • An architectural approach that separates a larger system’s functionality into many independent, collaborating systems • Relays on the concept of Bounded Context from Domain Driven Design DDD • Introduced by INNOQ

Slide 18

Slide 18 text

The Way to SCS • If you cut a monolithic system along its very domains and wrap every domain in a separate, replaceable web application then that application can be referred to as a self- contained system SCS.

Slide 19

Slide 19 text

Characteristics • An SCS contains its own user interface, specific business logic, and separate data storage • It may contain an optional API • The business logic may comprise microservices designed to solve domain-specific problems

Slide 20

Slide 20 text

Data Storage • Every SCS brings its own data storage and with it redundant data depending on the context and domain • These redundancies are tolerable as long as the sovereignty of data by its owning system is not undermined

Slide 21

Slide 21 text

How to Integrate SCS? • Self-contained Systems should be integrated via their web interfaces to minimize coupling to other systems

Slide 22

Slide 22 text

Asynchronous for the Win! • To further minimize coupling to other systems, synchronous remote calls inside the business logic should be avoided • Instead, remote API calls should be handled asynchronously to minimize dependencies and prevent error cascades • This implies that, depending on the desired rate of updates, the data model’s consistency guarantees may be relaxed

Slide 23

Slide 23 text

SCS vs Microservices SCS Microservices Size and Scope Larger with UI Smaller without UI Independence Autonomous Dependent to implement a single use case Integration Style Avoiding direct API calls Synchronous API calls Team Structure Teams own a full vertical slice Coordination needed due to service dependencies User Interface Include their own UI Don't handle UI concerns Deployment Deployed independently May require orchestration

Slide 24

Slide 24 text

Advantages of SCS • Resilient • Improved through loosely coupled, replaceable systems. • Scalable • Systems can be individually scaled to serve varying demands. • Open to Integration • A system of systems consists of individually developed software and standard products. • Independent • Technical decisions can be made independently, such as programming language, frameworks, tooling, etc. • No more risky big bang releases • Migration can occur in small, manageable steps that minimize the risk of failure and lead to an evolutionary modernization

Slide 25

Slide 25 text

Wholesale ERP Systems Modernization

Slide 26

Slide 26 text

Wholesale Domain Model

Slide 27

Slide 27 text

Systems Overview

Slide 28

Slide 28 text

Micro vs Macro Architecture Aspect Micro Architecture Macro Architecture Scope SCS level System landscape Key concerns Local optimization Cross-system coherence Stakeholders Developers, technical teams Architects, leadership, platform engineers Design principles Low coupling, high cohesion Autonomy, scalability, interoperability Examples Design patterns, data access frameworks API standards, messaging formats, observability guidelines

Slide 29

Slide 29 text

Our Macro Architecture • User Interface • Common Design System with Components and Styles • Link database for navigation • Integration • Replication of read-only data based on database views • Orders over ActiveMQ • Technology • Vaadin UI framework • Spring Boot • Oracle DB • Apache Camel • SymmetricDS

Slide 30

Slide 30 text

Strangler Fig

Slide 31

Slide 31 text

Conclusion • SCS provide optimal modularity based on business boundaries • Team autonomy from UI to DB • Reduces runtime dependencies to a minimum • Simpler deployment and operations • Supports continuous modernization 31

Slide 32

Slide 32 text

Thank you! • Web https://martinelli.ch • EMail [email protected] • X/Twitter simas_ch • Bluesky martinelli.ch