Vertical Slice Architecture: How Does it Compare to Clean Architecture

Photo by Rikki Chan on Unsplash

Vertical Slice Architecture: How Does it Compare to Clean Architecture

This is the summary of the presentation.

No Architecture

Pros

  • Little or no abstraction

  • Quick to build early - go from nothing deployed

  • Potential for performance due to tight coupling & less abstraction

Cons

  • As the size of the system increases so does the time to develop

  • Difficult for multiple teams to work on the same codebase

  • Technology changes or breaks impact the whole system

  • Difficult to test

N-Tier

Pros

  • Fairly intuitive abstraction to start

  • Reasonably quick to build

  • Improved testability

Cons

  • As the size of the system increases so does the time to develop

  • Difficult for multiple teams to work on the same codebase

  • Technology changes or breaks impact the whole system

Clean Architecture

Pros

  • Highly abstracted for larger systems

  • Resilient to technology changes

  • Very testable

  • Not influenced by anything external

  • Consistent velocity

  • Easy to work on by a few teams

Cons

  • Higher barrier to entry

  • Depends on training & a disciplined team to utilize it well

  • Slower development time overall

  • Lots of code to write a simple feature

Vertical Slice Architecture

Proximity Principle

Code that is changed together should live together.

Pros

  • Little to no abstraction

  • Low barrier to entry

  • Resilient to technology changes

  • The level of testability can be per feature

  • Easy to work on by many teams

  • Feature changes have no impact on other features

Cons

  • Requires contracts & messaging when working in a larger-scale system

  • Hard to decide what to have as Shared Code vs Feature Code

  • Each feature can be written in a different way leading to cognitive load when switching

Reference

https://www.youtube.com/watch?v=T-EwN9UqRwE&list=PLdo4fOcmZ0oULyHSPBx-tQzePOYlhvrAU&index=17