Exploring the Backstage Model: Why API Entities Become ‘Contracts’ Beyond Simple Documentation

Hello! Today, we’re going to delve into the heart of Backstage: the Software Catalog, and specifically, the role of API Entities as the communication channel between systems. πŸš€

When you first encounter Backstage, it’s often confusing to pinpoint the exact position of APIs among various concepts like Component, System, and Group. After reading this article, you’ll perfectly understand how APIs go beyond simple documentation to connect the microservice ecosystem! πŸ’‘


πŸ—οΈ What is an API in the Backstage Model?

In Backstage’s Software Catalog model, an API is an independent Entity that defines “an interface that one software provides to another software.”

It’s not just verbally explaining “this service provides these features,” but rather a contract specified in a machine-readable and standardized format (OpenAPI, AsyncAPI, GraphQL, etc.). πŸ“œ


🌟 4 Key Roles of API Entities

Let’s explore the most important roles APIs play within Backstage.

1. Managing ‘Contracts’ Between Services 🀝

This is the most fundamental role. An API entity defines the functionality that a specific service (Component) exposes externally.

  • Provider: Specifies which component implements and manages this API. (spec.owner)
  • Consumer: Tracks which components use this API to fetch data.

2. Centralizing Technical Documentation (Single Source of Truth) πŸ“š

One of the biggest challenges for developers is “finding the latest API specification.” API entities centralize this information.

  • Support for various formats: Supports Swagger (OpenAPI), gRPC (Protocol Buffers), GraphQL Schema, and more.
  • Visualization: The Backstage UI directly renders API definitions in an easy-to-read format, so you don’t have to search separate documentation sites. πŸ”

3. Ensuring Dependency Visibility (Dependency Tracking) πŸ•ΈοΈ

APIs play a crucial role in mapping the overall ‘topology’ of the system.

  • It can immediately answer the question: “Which services will be affected if I modify this API?”
  • By setting providesApi and consumesApi relationships, it visualizes the complex connections between microservices.

4. Defining System Boundaries (System & Domain) 🏰

APIs act as a gateway for communication with the outside world at the System or Domain level, grouping multiple components. This allows for the creation of abstraction layers within a vast architecture.


πŸ› οΈ Real-world Example of an API Entity (Looking at YAML)

In Backstage, everything is defined in YAML. Let’s take a closer look at what an API entity looks like! πŸ•΅οΈβ€β™‚οΈ

YAML

apiVersion: backstage.io/v1alpha1
kind: API
metadata:
  name: user-profile-api
  description: μ‚¬μš©μžμ˜ ν”„λ‘œν•„ 정보λ₯Ό μ‘°νšŒν•˜κ³  μˆ˜μ •ν•˜λŠ” APIμž…λ‹ˆλ‹€.
spec:
  type: openapi           # Type of API (e.g., openapi, grpc, graphql)
  lifecycle: production   # Current status (experimental, production, deprecated)
  owner: team-a           # The team responsible for this API
  definition: |           # Actual API specification (or external file reference possible)
    openapi: 3.0.0
    info:
      title: User Profile API
      version: 1.0.0
    paths:
      /users/{id}:
        get:
          summary: μ‚¬μš©μž 쑰회
  • spec.type: Specifies the technology used to display the appropriate viewer. 🎨
  • spec.definition: This is where the actual technical specification goes. You can write it directly or reference an external URL.

🧭 API-Centric Workflow: Enhancing Developer Experience (DevEx)

When APIs are well-defined in Backstage, a developer’s day changes like this:

  1. Discovery: When starting a new project, search for existing user-service APIs. πŸ”Ž
  2. Understanding: Immediately check endpoints and parameters on the API page from the search results. πŸ“–
  3. Validation: Ensure stability by checking if the API is in production status or deprecated and soon to be removed. βœ…
  4. Collaboration: Contact the team registered as ‘Owner’ directly when an API modification is needed. πŸ’¬

🏁 Conclusion: APIs are More Than Just Documents!

In the Backstage Software Catalog model, the role of an API can be defined as “the connecting link that establishes order in the microservice ecosystem.”

It’s not just a repository for documents; it helps control system complexity by transparently exposing interactions between services and predicting the impact of changes. πŸŒ‰

If your organization is adopting Backstage, the success of Platform Engineering will depend not only on defining components but also on how meticulously you manage API entities!


Tags: Backstage, API, SoftwareCatalog, DeveloperPortal, Microservices, Documentation, PlatformEngineering, DevOps, OpenAPI, Architecture


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *