# Vertical Slice Architecture: How Does it Compare to Clean Architecture

This is the summary of the [presentation](https://www.youtube.com/watch?v=T-EwN9UqRwE&list=PLdo4fOcmZ0oULyHSPBx-tQzePOYlhvrAU&index=17).

# No Architecture

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1702408446786/bff7d8f7-7872-4e35-9262-a1ea4a854127.png align="center")

## 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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1702409551396/cec40852-f35b-41ba-925a-42ea53197232.png align="center")

## 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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1702409721133/8bed8ce7-d8a5-4721-8087-530f627728e8.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1702409982808/d6b80907-f49e-45f8-a817-1782997dbc42.png align="center")

## 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
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1702411018870/c0652c02-c5a9-4924-a4c8-c671a30ebc8a.png align="center")

# Vertical Slice Architecture

## Proximity Principle

Code that is changed together should live together.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1702411159442/b34b4bc6-b141-43c5-a238-7a4c34918f3c.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1702411179448/45e4e1c7-adbf-42b5-8c4e-dc04ad656ad4.png align="center")

## 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](https://www.youtube.com/watch?v=T-EwN9UqRwE&list=PLdo4fOcmZ0oULyHSPBx-tQzePOYlhvrAU&index=17)
