Distributed Application Architecture Patterns

5 Decomposition Patterns

This chapter discusses how to code duplication and cross-cutting concerns in a distributed system. It presents patterns that can be used to implement many others in chapters 611. It starts with two single-node patterns by Burns [22].

  1. Sidecar in § 5.1 is a pattern that allows to offload cross-cutting concerns to a locally running component, such as a container or a process, in a programming language–agnostic way – which has since become a general term for any locally running supporting component

  2. Similarly, Ambassador in § 5.2 is a pattern that allows to handle network communication on behalf of a service, thus allowing it to be extended with any functionality needed

It then continues with two common approaches to handle client-facing cross-cutting concerns:

  1. Offload to Gateway in § 5.3 is a simple pattern that puts shared functionality into a gateway, which works well for smaller applications but does not scale

  2. Backend for Frontend (BFF) in § 5.4 is a (more costly) solution that overcomes this issue and has been shown to work well in practice

In a sense, other patterns could also be considered a part of this category:

Notable omissions in this category due to the methodology described in § 1 include: