Vertical Slice vs Clean Architecture ā Choosing the Right Approach
Compare Vertical Slice Architecture and Clean Architecture: organizational model, coupling patterns, team fit, scalability, when each excels, and how to choose between them for your project context.
The Core Difference
Clean Architecture (organize by technical layer):
Domain/ ā entities, value objects, domain events
Application/ ā use cases, commands/queries, interfaces
Infrastructure/ ā database, external services, repositories
Presentation/ ā controllers, endpoints
Vertical Slice (organize by feature):
Features/
Patients/
GetPatient/ ā query + handler + endpoint
CreatePatient/ ā command + handler + endpoint
Prescriptions/
CreatePrescription/ ā command + handler + endpoint
Clean Architecture: change a business rule ā touch Application/ and Domain/
Vertical Slice: change a business rule ā touch one feature folderClean Architecture: Strengths
ā Strong domain model: entities with rich behavior, enforced invariants
ā Clear dependency rule: outer layers depend on inner layers, never the reverse
ā Domain is testable without infrastructure (no DB, no HTTP)
ā Scales well for: complex domain logic shared across many use cases
ā Explicit contracts: interfaces between Application and Infrastructure
ā DDD-friendly: Aggregates, Repositories, Domain Services fit the layer structure
Best fit:
- Complex domain with rich business rules
- Multiple teams: domain team vs infrastructure team
- Domain logic shared across many use cases (not just one handler)
- When the domain model needs to be completely independent of persistenceVertical Slice: Strengths
ā Feature cohesion: all code for a feature is co-located
ā Easy onboarding: find the GetPatient folder, understand the feature completely
ā Low coupling between features: one feature's change rarely affects another
ā Scales with team size: each team owns their feature folders
ā Less indirection: no interface-for-every-repository ceremony
ā Fast delivery: add a feature ā add a folder
Best fit:
- CRUD-heavy applications (most features are simple read/write)
- Rapidly growing feature set with many small independent features
- Small to medium domain complexity
- Feature teams that own end-to-end slices
- When the overhead of strict layer separation outweighs its benefitsWhere Each Struggles
Clean Architecture struggles when:
ā Every new feature requires changes in 4+ layers and 4+ folders
ā Shared Application Services become bloated god classes
ā The domain model is anemic (entities are just property bags ā no behavior)
ā Junior developers get lost in the abstraction layers
ā Feature work is simple CRUD but the architecture enforces full ceremony
Vertical Slice struggles when:
ā Significant business logic needs to be shared across many features
ā Complex domain invariants that must be enforced across aggregate boundaries
ā The SharedKernel grows unchecked (see the dumping-ground anti-pattern)
ā Features become large and need internal structure themselves
ā Lack of discipline leads to duplicate logic across feature foldersHybrid Approach (Most Common in Production)
Most production systems end up using a hybrid:
SharedKernel/
Domain/ ā rich entities, value objects (Clean Architecture style)
Behaviors/ ā cross-cutting pipeline behaviors
Features/
Patients/
GetPatient/ ā thin: query + simple handler
CreatePatient/
Command.cs
Handler.cs ā calls domain entity methods for complex logic
Validator.cs
Endpoint.cs
Infrastructure/
Persistence/ ā EF Core DbContext, configurations
The domain model provides rich behavior.
The features organize the application layer by slice.
Infrastructure is traditional.
This combines Clean Architecture's domain strength
with Vertical Slice's feature cohesion.Decision Framework
Use Clean Architecture when:
ā Domain has complex, shared business rules
ā Multiple use cases need the same domain logic
ā Team has DDD/domain modeling experience
ā Regulatory domain (healthcare, finance) where domain correctness is paramount
Use Vertical Slice when:
ā Most features are independent CRUD operations
ā Team velocity is the primary concern
ā Onboarding new developers quickly matters
ā Feature ownership is clear: each team owns their slices
Use Hybrid when:
ā Rich domain model + feature-organized application layer
ā When Clean Architecture's ceremony is too high but domain logic is real
ā Most .NET shop teams end up here organically
Neither is wrong ā the wrong choice is picking based on trend,
not based on your domain complexity and team context.Red Flag / Green Answer
Red Flag: "We use Clean Architecture because it's the industry standard and everyone says you should."
Clean Architecture is a design philosophy, not a requirement. For a CRUD application with simple business rules, 4 layers with full interface segregation adds ceremony without benefit. The domain layer in many "Clean Architecture" codebases is just DTOs with no behavior ā Clean Architecture with an anemic domain model is worse than a well-organized monolith.
Green Answer:
We evaluated our domain complexity. For the prescription management feature, the domain has complex invariants (warfarin dosing rules, INR thresholds, allergy checking) ā so we use domain entities with behavior and a rich domain model (Clean Architecture principles). For the simpler reporting and configuration features, we use Vertical Slices with thin handlers directly querying the database. The architecture matches the complexity level of each area.
Key Takeaway
Clean Architecture excels for complex, shared domain logic and strict layer independence. Vertical Slice excels for feature-organized teams with independent, high-velocity feature delivery. Most production systems use a hybrid: rich domain model (Clean Architecture) + feature-organized application layer (Vertical Slice) + traditional infrastructure. Choose based on your domain complexity and team structure ā not based on which architecture is more popular in blog posts.
Found this helpful?
Leave a comment
Have a question, correction, or just found this helpful? Leave a note below.