Skip to main content

Domain Gateways

Domain Gateways provide an external abstraction, like a general Gateway does, over a collection of services within a Domain by the team that manages that Domain.

Domain Gateways provide a translation tier between internal software components and public APIs federated by a Federated Gateway.

Responsibilities

  • Translation and Aggregation of internal protocols, such as gRPC, to public API protocols including REST and GraphQL.
  • Authorization Checks
  • Limited Orchestration

Aggregation

Domain Gateways aggregate internal service APIs using clients from those services to programmatically translate between internal gRPC types to external REST or GraphQL types.

Best Practices

For simple Solutions, a single "Core" Domain Gateway may be sufficient for aggregating all the various internal services.

Using multiple Domain Gateways is warranted for more complicated Solutions composed of many services with dedicated teams working on sets of applications within a "Domain". For example, a single team may have responsibility for managing "Account and Identity", which may be composed of multiple services such as account-service, login-service, profile-service, etc. These suite of applications may have their functionality aggregated by an accounts-domain-gateway.

A Domain Gateway should generally be responsible for aggregating at least two services. If a Domain Gateway is serving only a single Service with no plans for adding additional Services to that Domain, consider whether the architecture can be simplified by aggregating the Service under a different Domain Gateway.

Qualities

  • Translates between external-facing APIs, such as REST or GraphQL, and efficient internal APIs, such as gRPC
  • Allows for internal domain refactoring with minimal disruption to external clients
  • Contains minimal business logic
  • Contains cross-cutting authorization checks and observabilities