Vertical slice architecture introduced by Jaime Bogaerts.
This architecture offers against two traditional layered/onion/clean architecture approaches.
- Vertical Slice Architecture aims to organize code around specific features or use cases, rather than the technical concerns in a vertical slice architecture.
- A feature is implemented across all layers of the software, from the user interface to the database.
- This approach is often used in the development of complex, feature rich applications, particularly those that are delivered over the web.
- Vertical slice architecture is dividing an application into distinct features or functionalities, and each of them cuts through all of the layers of the application.
- This approach is in contrast to the traditional n-tier or layered architectures, where the application is divided horizontally.
Features
- The app has feature-based slices. The application is sliced by features or use cases. Each slice depicts a vertical application stack pathway, encompassing user interface, business logic, and data access layers.
- Each vertical slice is intended to be self-contained and independent from other slices. A Single feature can be developed, tested, and delivered without affecting other portions of the app.
- Focusing on the vertical reduces the dependencies between various components of the application. Each slice can be regarded as a miniature application with its own unique dependencies and functionality.
- Each slice can be regarded as a miniature application with its own unique dependencies and functionality. It encourages the utilization of cross-functional teams. The development teams that deal with the vertical slice architecture are frequently cross-functional and include all the skills required to create a feature from the ground up, thereby fostering a more comprehensive approach. Scalability and maintainability are facilitated by the architecture and development perspective.
- This architecture enables enhanced maintainability and scalability. New features can be incorporated as newer segments as the application expands without a substantial impact the current code
- Vertical slices can be individually tested and deployed, which simplifies the testing process and can result in more reliable and faster deployments.
Vertical slice is an internal application architecture pattern that is applicable to all microservices. This architecture is present in their internal code. Each microservice is responsible for a specific aspect of the functionality and communicates with other services.through interfaces that are clearly defined.
Disadvantage of this Patten
- Duplication of code across segments is possible, particularly for functionalities that are frequently used.
- Particularly for teams that are opposed to conventional architectures, there is a learning curve.
- In order to guarantee independence and maintainability, each slice's design must be meticulously examined.