Skip to main content

Backstage Metamodel

Backstage is an open source developer portal created at Spotify and now a CNCF project. At its core is the Software Catalog, which uses a small, opinionated metamodel called the System Model. Entities are described in YAML files (usually catalog-info.yaml) stored next to the code, so the people who build the software also maintain its catalog records.

Entity kinds​

Software and infrastructure​

KindMeaningTypical spec.type
ComponentA piece of software, typically backed by one source code repository and deployed as a unitservice, website, library
APIA boundary between components, described by a machine-readable definitionopenapi, asyncapi, graphql, grpc
ResourceInfrastructure a component needs at runtimedatabase, s3-bucket, kafka-topic
SystemA collection of components, APIs and resources that together expose some functionality–
DomainA group of systems that share terminology, a domain model and a business purpose–

Organization​

KindMeaning
GroupA team, department or other organizational unit. Groups can be nested with parent and children
UserA person, member of one or more groups

Catalog management​

KindMeaning
LocationPoints to other places to read entity files from
TemplateA Scaffolder template for creating new components from a blueprint

Entity envelope​

Every entity has the same structure, whatever its kind:

FieldPurpose
apiVersion, kindWhich schema the entity follows
metadata.nameIdentifier, unique within kind and namespace
metadata.namespaceOptional, defaults to default
metadata.title, descriptionHuman-friendly name and description
metadata.labels, annotations, tags, linksExtension points for classification, tool integrations and links
specKind-specific fields, such as owner, lifecycle, system
relationsComputed by Backstage from spec, not written by hand

Entities refer to each other with entity references in the form kind:namespace/name, for example group:default/team-checkout. Within the same namespace, the short form team-checkout is enough when the kind is clear from the field.

Relationships​

Relations are always generated in pairs, one in each direction:

RelationInverseDeclared by
ownedByownerOfspec.owner
partOfhasPartspec.system, spec.domain, spec.subcomponentOf
providesApiapiProvidedByspec.providesApis
consumesApiapiConsumedByspec.consumesApis
dependsOndependencyOfspec.dependsOn
memberOfhasMemberspec.memberOf (User)
childOfparentOfspec.parent (Group)

Example​

catalog-info.yaml
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: order-service
description: REST service for creating and tracking orders.
tags: [java, spring-boot]
spec:
type: service
lifecycle: production
owner: team-checkout
system: sys-order-mgmt
providesApis:
- orders-api
consumesApis:
- payments-api
dependsOn:
- resource:orders-db
---
apiVersion: backstage.io/v1alpha1
kind: API
metadata:
name: orders-api
spec:
type: openapi
lifecycle: production
owner: team-checkout
system: sys-order-mgmt
definition:
$text: ./openapi.yaml

Extending the model​

The built-in kinds cover software well, but they do not cover business architecture. Common extensions:

  • Annotations and labels for extra attributes, such as criticality, data classification or a TIME rating. They are cheap to add and need no code.
  • Custom kinds, such as BusinessCapability or DataProduct, through a catalog processor. They are more work, but give first-class entities with their own relations.
  • Lifecycle values are free text. The defaults are experimental, production and deprecated; you can align them with the lifecycle states of your metamodel.

Strengths and limitations​

StrengthsLimitations
Maintained as code, reviewed in pull requestsNo business layer (capabilities, processes) out of the box
Ownership is mandatory and visibleLimited support for target state and roadmaps
Integrates with CI/CD, docs, monitoring through pluginsRequires a platform team to run and extend it
Small model, easy for engineers to learnRelationship semantics are coarse (dependsOn covers many things)

Official documentation​