Layered
Best when simplicity, familiarity, and clear separation of responsibilities matter most.
This reference page compares the major architectural styles from the main batch in one place. Its purpose is to shorten the decision loop when a team needs to compare system shapes quickly without rereading all the detailed pages.
Teams often debate layered versus hexagonal versus clean versus modular monolith without naming the actual decision forces. This page brings the styles into one comparison table so the team can evaluate dependency direction, framework isolation, operational complexity, and migration cost side by side.
The best comparison question is not "Which architecture is modern?" It is "Which architecture makes our main constraints easier to manage?" Some styles primarily clarify module structure. Some protect the core from infrastructure churn. Some optimize for operational independence. Some support asynchronous collaboration or transformation pipelines. Good teams compare styles by forces, not by fashion.
Best when simplicity, familiarity, and clear separation of responsibilities matter most.
Best when inward dependency direction and framework isolation matter strongly.
Best when deployment, ownership, or event-driven collaboration pressures are real enough to justify them.
| Style | Main strength | Main risk | Typical fit |
|---|---|---|---|
| Layered / N-Tier | Clarity and familiarity | Dependency erosion between layers | Business systems with moderate complexity |
| Modular Monolith | Strong internal boundaries without distributed ops | Modules drift if governance weakens | Most serious business platforms before service split |
| Hexagonal | Protects core from infrastructure | Can become ceremonial if ports multiply without need | Systems with volatile adapters and external integrations |
| Onion / Clean | Strong inward dependency rules | Over-abstracting simple systems | Teams that need core-model isolation |
| Event-Driven | Loose coupling and async collaboration | Hidden flow complexity | Systems with natural event collaboration |
| Pipes and Filters | Composable processing stages | Overuse outside pipeline workloads | Transform-heavy processing paths |
| Microservices | Independent evolution across real boundaries | Operational and consistency cost | Large systems with proven bounded contexts |
package org.javaomnibus.reference;
public final class ArchitectureChoiceHeuristic {
public String choose(boolean manyTeams, boolean infraVolatile, boolean mostlySingleDeployable) {
if (mostlySingleDeployable && !manyTeams) return "Layered or modular monolith";
if (infraVolatile) return "Hexagonal / Onion / Clean";
if (manyTeams) return "Modular monolith first, then microservices if boundaries prove stable";
return "Use the simplest style that keeps dependencies honest";
}
}