Contents
API design for mobile apps determines how fast your app loads, how well it copes with poor connectivity and how expensive future changes will be. REST remains the solid default for most projects, GraphQL shines when many different clients consume the same data, and gRPC pays off mainly between backend services. This article explains how to choose and which rules apply regardless of style.
Why mobile APIs differ from web APIs
An interface that works well for a browser on an office desktop can disappoint on a smartphone. Mobile clients operate under conditions that directly shape API design:
- Unreliable networks: dead zones, train journeys and congested Wi-Fi cause high latency and dropped requests. Every extra round trip is noticeable.
- Old app versions in the wild: unlike a website, you cannot force every user to update immediately. Your API often has to serve several app versions in parallel, sometimes for months.
- Battery and data usage: large payloads and frequent polling drain batteries and data plans. Lean responses are part of the user experience.
- Store review cycles: a client-side bug cannot be fixed in minutes. Whatever can be solved on the server should be solved on the server.
The core principle follows from this: design the API around the app's screens and user flows, not around your database tables.
REST, GraphQL, gRPC and BFF compared
These approaches are not mutually exclusive. In many architectures the app talks REST or GraphQL to a gateway, which communicates with internal microservices via gRPC.
| Approach | Strengths | Weaknesses | Typical use |
|---|---|---|---|
| REST (JSON over HTTP) | Simple, widespread, HTTP caching, strong tooling (OpenAPI) | Over- and under-fetching, several requests per screen | Most business apps, MVPs, public APIs |
| GraphQL | Clients request exactly the fields they need, single endpoint, strongly typed schema | Caching is harder, query cost must be limited, steeper learning curve | Many clients with different data needs, highly connected data |
| gRPC / Protocol Buffers | Compact binary format, streaming, strict contracts | Needs an extra layer in browsers, harder to debug by eye | Service-to-service communication, real-time and IoT scenarios |
| Backend for Frontend (BFF) | A tailored API per client, logic stays on the server | An additional layer to maintain | Products with separate web and mobile front ends |
| WebSockets / Server-Sent Events | Real-time updates without polling | Connection handling on mobile devices is demanding | Chat, live tracking, collaboration |
Backend-as-a-service platforms that come with their own API are another option. We compare them in Firebase, Supabase or your own server as an app backend.
Decision criteria: which API style fits your app?
Base the choice on your situation rather than on trends. These questions help:
- How many clients are there? One app plus an admin panel usually does fine with REST. Several apps, partner integrations and web front ends with different data needs point towards GraphQL or a BFF.
- How nested is the data? If a single screen combines data from five resources, GraphQL saves round trips. With flat structures the benefit is small.
- How important is caching? REST benefits directly from HTTP caching, ETags and CDNs. With GraphQL you need to handle caching more deliberately on the client or application level.
- What does your team know? A well-built REST API beats a poorly secured GraphQL API.
- Do you need real-time updates? Then plan WebSockets or Server-Sent Events in addition to your main style.
In our experience most MVPs start with REST and a clean OpenAPI contract. Adding GraphQL later is entirely possible if the API is well structured from the beginning.
Rules for good mobile API design
Whatever style you choose, these principles have proven themselves in app projects:
- Contract first: define the interface as an OpenAPI specification or GraphQL schema before implementing it. App and backend developers can then work in parallel, use mock servers and generate client code.
- Screen-oriented endpoints: an endpoint such as
/home-feedthat delivers everything the start screen needs is often better for mobile clients than ten generic calls. - Cursor-based pagination: cursors are more stable than offsets for lists that change, avoiding duplicate or missing items when loading more.
- Consistent error objects: return machine-readable error codes plus a human-readable message. The Problem Details format (RFC 9457) is a good standard.
- Idempotency: critical actions such as orders or payments should accept an idempotency key, so a retry after a timeout never creates a duplicate booking.
- Compression and lean payloads: enable gzip or Brotli, drop unnecessary fields and serve images in suitable sizes via a CDN.
- Timestamps and change information: fields such as
updated_atenable incremental sync, the foundation of offline-first apps with reliable data synchronisation.
Versioning: don't forget older app releases
The biggest peculiarity of mobile APIs is the long life of old clients. Carelessly renaming a field can break an app version that still runs on many devices. These measures have proven effective:
- Additive changes only: add new fields and endpoints, but don't rename or remove existing ones. Clients must ignore unknown fields.
- Version breaking changes: via the path (
/v2/) or a header. In GraphQL, mark fields asdeprecatedand remove them only after a defined period. - Enforce a minimum app version: an endpoint returning the minimum supported version enables a controlled update prompt in the app.
- Measure usage: log the app version with every request so you know when an old version can actually be switched off.
- Feature flags: enable new functionality on the server instead of hard-wiring it into the client.
Security and performance of the interface
The API is your app's main attack surface, because client code can always be inspected. Secrets such as API keys for third-party services therefore never belong in the app but on the server. Use established methods like OAuth 2.0 with PKCE and short-lived access tokens, check permissions on the server for every request and apply rate limiting. For GraphQL, add query depth and complexity limits so a single query cannot overload the server. Our article on app security according to OWASP Mobile covers this in detail.
For performance, measure response times from real devices, not just inside the data centre. Sluggish apps are frequently caused by N+1 database queries or oversized responses. More levers are described in optimising app performance.
Agentic coding workshop for your team? From €799 net – request a quote by e-mailConclusion
For most mobile apps, a carefully designed REST API with an OpenAPI contract, cursor pagination, consistent errors and thoughtful versioning is the best choice. GraphQL is worthwhile with many clients and highly connected data, gRPC mainly inside the backend. Discipline matters more than style: design interfaces from the user's perspective, respect older app versions and enforce security on the server. If you are planning an app including its backend, our offer wizard leads to a fixed-price quote after a free analysis.
Frequently Asked Questions
Is GraphQL better than REST for mobile apps?
Not in general. GraphQL reduces round trips for nested data and many clients, while REST is easier to cache and entirely sufficient for most business apps.
How long should an old API version be supported?
That depends on how quickly your users update. Track the distribution of app versions and retire an old version only once hardly any requests come from it and an update prompt has been active.
What is a Backend for Frontend (BFF)?
A BFF is a dedicated server layer per client type that prepares data exactly as a specific app or web interface needs it. This keeps clients lean and business logic on the server.
Can API keys be stored inside the app?
Secret keys for third-party services should not be shipped in the app, because app packages can be analysed. Call such services through your own backend and authenticate users with short-lived tokens.