Learnixo
Back to blog
AI Systemsintermediate

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.

Asma Hafeez KhanMay 16, 20265 min read
Vertical SliceClean ArchitectureArchitectureDesign DecisionsASP.NET Core.NET
Share:š•

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 folder

Clean 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 persistence

Vertical 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 benefits

Where 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 folders

Hybrid 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.

Enjoyed this article?

Explore the AI Systems learning path for more.

Found this helpful?

Share:š•

Leave a comment

Have a question, correction, or just found this helpful? Leave a note below.