Overview
Curated: · Written: · Reviewed:
Platform APIs & Abstraction Layers
In one line
A platform API is the stable contract between a platform team and the teams that consume it. It exposes the decisions a consumer must own (cost, durability, security, locality, workload responsibility) and hides the provider wiring and sequencing the platform owns. Reach for it when you ship a capability to dozens of consuming teams you cannot see, and when you need one contract that survives a provider change.
Key definitions
- Domain intent: a resource described by what the user needs, such as a production database with an owner, data class and availability target, not by provider calls.
- Capability discovery: the API reports what a backend supports (PITR, read replicas) instead of a shared field whose meaning differs per provider.
- Adapter boundary: the layer that maps domain resources to a provider and owns error mapping, idempotency and conformance tests.
- Idempotency key: a client-supplied identity that deduplicates an operation for a documented retention window. It gives deduplicated effects, not exactly-once execution.
- Escape hatch: a bounded, validated, visible extension point with stated support limits. It is never raw credentials.
- Field ownership: each field is written by the platform, the user or the controller, and by no one else.
How it works
- Portal, CLI, Terraform and GitOps clients send intent to one server-side API.
- The server validates, authorizes and stores desired state before any provider call.
- The adapter maps the resource to a provider. Long-running work returns a durable operation ID at once.
- Observed status is reported separately from desired state. Drift is reconciled, and undocumented inconsistency counts as a defect.
When to use and when not to
| Decision | Expose to the caller | Hide behind the platform |
|---|---|---|
| Durability or availability | Yes, as a named class with stated guarantees | Replication factor, failover mechanics |
| Backup and deletion | Yes, the platform states who owns them | Backup scheduling, deletion order |
| Provider storage class | No, map it to a domain tier | Provider class names and tables |
| Provisioning steps | No | Sequencing and rollback |
| Provider metadata such as ETags | Only as a documented opaque token | Provider semantics |
| Provider-only feature | Capability flag or distinct resource class | Shared field with per-provider meaning |
Do not build the abstraction when there is one provider, no second consumer, and no realistic migration. Build it when consumers would otherwise branch on provider fields.
Traps interviewers probe
- Lowest common denominator. A field such as highAvailability: true means synchronous replication on one cloud and best-effort failover on another. Fix: capability discovery or a distinct resource class.
- Consumers reading provider fields. Teams branch on providerStorageClass and break when a second provider returns unmapped values. Fix: publish one domain field as the supported contract, document its enum, and make consumers tolerate values they do not yet know.
- Holding a POST open. The handler waits 6 to 9 minutes for a provider, the gateway and SDK time out, and the retry creates a second resource. Fix: validate first, return an operation ID immediately, and bind a create to a request identity so a retry returns the prior outcome.
- Rules in the UI. The portal blocks a delete that the CLI allows. Fix: run validation and authorization server-side, shared by every client.
- Compatibility by field name alone. Adding an enum value or changing a default breaks callers that keep every field name and type intact. Fix: test old clients against new servers, and deprecate with dates and owner outreach.
Interview tips
Open with the criterion: "I expose what the user owns and hide what the platform owns," then give one example of each. Name the trade-off that decides it: durability, locality or cost stays visible; sequencing and provider wiring stay hidden.
Follow-ups to expect:
- How you test the contract: retry with the same key, timeout after a side effect, stale resourceVersion, pagination with a tenant filter, deletion and name reuse.
- How you migrate a portal-only platform to an API-first one, and which clients you move first.
- Where you would deliberately not abstract.
30-second answer outline:
- The criterion: user-owned tradeoffs stay visible, platform-owned sequencing stays hidden.
- One exposed decision and why it must stay visible.
- One hidden detail and why the platform owns it.
- How the contract stays safe: server-side checks, idempotent creates, an operation resource, versioned deprecation.
- What you would measure: operation age, stale status, error reason by category.
Feedback on this overview
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.