Font Awesome Free 5.13.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
Skip to main content

Horizontal versus vertical separation

The benefits and drawbacks of horizontal and vertical boundaries

Horizontal slicing

  • Boundaries between different technical areas (layers) of the system
  • Example: a layer for the API, a layer the business logic and a layer for communicating with the database
  • Benefit: allow for technological flexibility (for example, relatively easy to switch to other kind of DB)
  • Drawback: single functional change is likely to affect multiple layers

Vertical slicing

  • Boundaries between different functional areas of the system
  • Example: functionality for managing customers can be separated from functionality for placing orders
  • Benefit: Changes within a single functional domain can happen within a single part of the system
    • Especially helpful if different parts maintained by different teams!
    • Changes within a single functional domain can happen within a single team and coordination with other teams is only required if the communication with other functional domains needs changes as well
    • See Architecture and people - Conway's law
    • See microservices, where different small teams each maintain one or more microservices that encapsulate a certain functional area across several layers of the technical stack, even down to the database

Resources