Matthias Kauzmann

Microservice-Ready Without Microservices: Introducing Hexagonal Architecture in a Monolith

What if your monolith had the clean boundaries of microservices? Learn how Hexagonal Architecture makes your monolith microservice-ready without the immediate overhead.

Microservice-Ready Without Microservices: Introducing Hexagonal Architecture in a Monolith
#1about 5 minutes

Why hexagonal architecture is a practical alternative to microservices

When operational constraints prevent a microservice approach, hexagonal architecture provides a way to structure and maintain large monolithic applications.

#2about 4 minutes

Isolating a pricing subdomain within a larger monolith

A pricing feature, initially hosted within a larger application for convenience, serves as a real-world example of a distinct domain that can be structured for future extraction.

#3about 9 minutes

Exploring the core layers: adapter, application, and domain

The architecture is built on three layers with a strict dependency rule where outer layers (adapters) depend on inner layers (application, domain), but not the other way around.

#4about 5 minutes

How hexagonal architecture makes a monolith microservice-ready

By isolating business logic from external dependencies and treating internal subdomains as clients, this architecture makes it easier to extract features into separate microservices later.

#5about 7 minutes

Using ArchUnit to automatically enforce architectural rules

The ArchUnit testing library can be used in a CI/CD pipeline to validate dependency rules and prevent violations of the hexagonal structure.

#6about 5 minutes

Advancing to compile-time enforcement with modularization

To create stricter boundaries than testing allows, Java's modularization system can enforce architectural constraints at compile time, preventing invalid dependencies entirely.

#7about 2 minutes

A positive verdict on adopting hexagonal architecture

After eight months of use, the architecture has proven its value by promoting cleaner code and better structure, making it a recommended approach for complex projects.

Related jobs
Jobs that call for the skills explored in this talk.

Featured Partners

Related Articles

View all articles

From learning to earning

Jobs that call for the skills explored in this talk.