CH09-01: API Platform Architecture Mental Model
Goal
Chapter 8 looked at a web application request path. This chapter zooms in on the API surface that often sits inside or beside that path.
An API is not only an HTTP route that reaches backend code. An API is a contract. It tells consumers what capability is available, how to call it, which identity is required, which data shape is accepted, what response to expect, how errors are returned, how traffic is limited, and how changes will be handled over time.
The durable idea is:
An API platform turns backend functionality into controlled, observable, and reusable contracts.
The Short Version
A single API might expose one backend capability. An API platform manages many APIs as a product surface for many consumers.
Those consumers might include:
A public web application.
A mobile application.
A partner system.
An internal support dashboard.
Another backend service.
A reporting or automation tool.
Each consumer may need different access rules, traffic limits, versions, data exposure, monitoring, and support expectations. That is why API architecture is more than publishing endpoints.
The simple question is:
How do callers reach this backend?
The better architecture question is:
How do we turn backend capability into a safe contract that consumers can depend on and teams can operate?
The API Platform Model
Think of an API platform as a boundary between consumers and backend capabilities:
flowchart LR
C["Consumers<br/><small>Web, mobile, partners, internal tools</small>"]
G["API gateway and policy boundary<br/><small>Identity, routing, limits, versions, telemetry</small>"]
B["Backend services<br/><small>Business logic and domain rules</small>"]
D["Data and integration<br/><small>Databases, queues, events, internal systems</small>"]
O["Operations<br/><small>Logs, alerts, ownership, cost</small>"]
C --> G --> B --> D
G --> O
B --> O
D --> O
This is not saying every API platform needs the same products or the same topology. It is saying the responsibilities are different.
The gateway boundary protects and organizes the contract. Backend services still own the real business behavior. Data and integration services still need their own security, reliability, and ownership decisions. Operations must see the whole path, not only one layer.
What Belongs at the API Boundary
The API boundary is where consumer traffic becomes a managed platform concern.
Common boundary responsibilities include:
| Responsibility | What It Means | Why It Matters |
|---|---|---|
| API contract | Define routes, methods, request shape, response shape, and error behavior. | Consumers need predictable behavior. |
| Authentication | Prove who or what is calling. | Anonymous or unknown callers should not reach protected APIs. |
| Authorization signal | Help decide which caller can use which API or operation. | Different consumers may have different rights. |
| Routing | Send requests to the correct backend. | The platform can hide backend placement from consumers. |
| Policies | Apply cross-cutting controls such as headers, validation, transformation, limits, or token checks. | Common controls become consistent. |
| Rate limits and quotas | Control how much traffic consumers can send. | Backends are protected and consumers are treated fairly. |
| Versioning | Expose change safely. | Consumers are not broken without warning. |
| Observability | Capture gateway, consumer, and backend signals. | Teams can diagnose failures and usage patterns. |
| Ownership | Define who owns APIs, policies, versions, support, and deprecation. | API products need lifecycle management. |
Azure API Management is the Azure service that commonly sits at this boundary. It is a managed API gateway and API lifecycle service. You do not need the details yet. For now, focus on the job: it helps centralize how APIs are exposed, protected, organized, documented, monitored, and governed.
What Stays Behind the Boundary
An API gateway should not become the place where all business logic moves.
Backend services still own:
Domain rules.
Data validation that depends on business meaning.
Data integrity.
Transactions and consistency decisions.
Calls to databases or internal systems.
Durable workflow and integration behavior.
Backend-specific logging and error handling.
This distinction matters because gateway policies are good at boundary controls, not deep domain ownership. A gateway can validate a token, reject oversized requests, route to a backend, transform a header, or throttle a caller. It should not become the only place that knows how orders, payments, subscriptions, or customer records work.
Contracts Protect Consumers and Backends
API platforms protect both sides of the relationship.
Consumers benefit because they get stable contracts, predictable errors, documentation, versioning, and support expectations. Backends benefit because they are not exposed directly to every caller, every traffic spike, every authentication pattern, and every partner-specific requirement.
Consider a company with account, billing, and order capabilities. A web app, mobile app, partner provider, and internal dashboard all need some of those capabilities, but not in the same way.
| Consumer | API Need | Platform Concern |
|---|---|---|
| Web app | Account and order APIs for signed-in users. | User identity, latency, browser-friendly errors, app telemetry. |
| Mobile app | Account and order APIs with mobile release cycles. | Backward compatibility, versioning, mobile-specific traffic patterns. |
| Partner system | Order status and fulfillment APIs. | Partner identity, subscriptions, rate limits, auditing, contract documentation. |
| Internal dashboard | Customer support APIs. | Employee identity, privileged authorization, audit logs, lower tolerance for data exposure mistakes. |
If every backend endpoint is exposed directly to every consumer, each backend team must solve all of these concerns separately. An API platform gives the organization a shared boundary for common contract responsibilities while still allowing backend teams to own their services.
Example: Account, Billing, and Order APIs
Imagine a company exposing account, billing, and order APIs.
A weak design might look like this:
Consumers -> Backend services directly
That can work for a small internal prototype. It becomes risky when the number of consumers grows. Each backend now needs to handle caller onboarding, authentication patterns, throttling, documentation, versions, logging, and partner-specific rules by itself.
A stronger first model is:
Web, mobile, partners, internal tools
-> API platform boundary
-> Account API, Billing API, Order API
-> Data stores, messaging, internal systems
Now the platform can define products for different consumers, apply consistent policies, capture usage, route to backends, and provide a stable contract surface. The backend services still own account, billing, and order behavior.
Common Mistakes
Treating an API gateway as a substitute for backend design.
Exposing every backend endpoint directly to every consumer.
Skipping versioning, ownership, telemetry, and lifecycle planning.
Putting domain rules into gateway policies because it is convenient at first.
Giving partner, public, internal, and service-to-service consumers the same API contract and limits.
Designing APIs as routes before defining consumer needs and support expectations.
If Someone Asks You
What is the purpose of an API platform in Azure?
A good answer is:
An API platform turns backend capabilities into governed contracts for consumers. It provides a boundary for identity, routing, policies, rate limits, versions, documentation, telemetry, and ownership. Azure API Management often sits at that boundary, while backend services still own business logic, data integrity, and integration behavior.
What You Should Remember
APIs are contracts; the platform makes those contracts controlled and operable.
Questions to Check Your Understanding
What responsibilities belong at an API platform boundary?
Why should backend services still own business rules?
How do API consumers influence architecture decisions?
Why is an API platform different from a single backend API?