
Choose REST when your data is simple, your clients behave alike and you want the most familiar tooling. Choose GraphQL when many different clients need different slices of the same data, or when one screen pulls from several sources. Most early-stage products are better served by REST. Most products that outgrow it do so because of client variety, not traffic.
The rest of this article shows where that rule comes from, what the measurements say, and what each choice costs you in daily work. We build web apps and platforms in Zurich, so we also cover the practical side: what to ask before you commit.
TL;DR
- REST is an architectural style built around resources and URLs. GraphQL is a query language with a typed schema, usually served from a single endpoint.
- GraphQL removes over-fetching and under-fetching and suits varied clients and multiple data sources. REST is simpler, caches more easily and suits smaller apps.
- In one academic study, GraphQL had lower average response times for most endpoints, but REST scaled better under high concurrency.
- GraphQL shifts work to the server: query cost limits, the N+1 problem and caching all need deliberate design.
- For a first product with one web client, start with REST. Move to GraphQL when client variety makes endpoints multiply.
What each one actually is
The two are not equal kinds of thing, which is why comparisons get muddled. REST is an architectural pattern. GraphQL is a query language and runtime. A REST API exposes resources at URLs such as /orders/42, and the HTTP method says what to do with them. A GraphQL API exposes a schema, and the client sends a query that describes the exact shape of data it wants back.
They have more in common than the debates suggest. According to the AWS AppSync documentation, both follow a client-server model, both are stateless and both typically run over HTTP. You can build a poor API in either style, and a good one in either style.
A useful shorthand: with REST, the server decides what each endpoint returns. With GraphQL, the client decides what it needs, within what the schema allows.
Side-by-side comparison
| Criterion | REST | GraphQL |
|---|---|---|
| Basic idea | Resources behind many URLs | One schema, usually one endpoint |
| Data shape | Fixed by the server per endpoint | Chosen by the client per query |
| Over- and under-fetching | Common | Avoided by design |
| Schema | Optional (for example OpenAPI) | Required, strongly typed |
| HTTP caching | Straightforward | Harder, needs extra work |
| Real-time | Long-polling or server-sent events | Subscriptions |
| Learning curve | Low | Moderate |
| Best fit | Simple data, similar clients, public APIs | Many clients, many data sources, nested data |
The rows come from the same trade-offs the next sections explain one by one.
Data fetching: over-fetching, under-fetching and round trips
This is the reason GraphQL exists. Imagine a mobile order screen that needs the customer name, the last three orders and the status of each. With REST you might call /customers/7, then /customers/7/orders, then one status call per order. That is under-fetching: the first response is not enough, so you make more requests. Meanwhile each response probably carries fields the screen never shows, which is over-fetching.
A University of Washington study on GraphQL and REST performance describes exactly this: REST can lead to both problems, while GraphQL lets clients specify what to retrieve and can consolidate data from multiple sources into one request. The AWS documentation says the same thing in practical terms: GraphQL cuts network overhead by returning only requested data in a single call.
There is a REST answer too. You can add purpose-built endpoints for each screen, or accept parameters that select fields. That works, but every new client then adds server work. This is the point where teams begin to consider GraphQL: not when REST is slow, but when the number of endpoint variants gets out of hand.
Performance: what the measurements say
Be skeptical of any article that says one is simply faster. The University of Washington researchers measured both styles under several load scenarios. They found that Apollo GraphQL had 25 to 67% lower average round-trip time than REST for most endpoints and load scenarios, while REST scaled better under high concurrency.
Read that carefully. It is one study, one stack and one set of test conditions. It does support two sensible conclusions:
- For a client on a slow or mobile connection, fewer round trips and smaller payloads help, and GraphQL is good at that.
- A GraphQL server does more work per request, because it parses, validates and resolves each query. Under heavy concurrent load that overhead shows.
For most Swiss SMEs and startups, neither effect decides the project. Your database design, your hosting region and your caching will move response times more than the API style. If you need a performance answer for your own product, measure a realistic prototype with your own data rather than relying on a benchmark.
For a look at how real-time delivery works in practice, this guide to REST and WebSocket data streams shows how a data API combines request-based endpoints with live feeds.
Caching: where REST has the easier life
REST uses the web’s own machinery. Per IBM’s comparison, REST APIs use eTags and last-modified headers to cache calls, so browsers, CDNs and proxies understand them without help. Each URL is a cache key.
GraphQL usually sends queries to one endpoint, often as POST requests, so that built-in HTTP caching mostly does not apply. IBM notes that GraphQL can be harder to cache, though persisted queries, response caching and server-side caching help. Client libraries such as Apollo Client also cache normalized objects on the client side, which softens the problem in the browser.
The practical consequence: if your product serves lots of public, read-heavy content that a CDN should absorb, REST is the lower-effort path. If your traffic is mostly authenticated, personalized data, the caching gap matters much less, because that data was never going into a shared cache anyway.
Schema, typing and error handling
GraphQL requires a strongly typed schema written in its schema definition language. The AWS documentation points out that this lets the service identify many request errors before your code runs. A client asking for a field that does not exist gets a clear rejection. The schema also drives documentation, autocomplete and code generation, which is a real gain for teams with separate frontend and backend developers.
REST does not require a server-side schema. You can add one with OpenAPI, and many teams do, but nothing forces it. Without it, error handling and validation live in the surrounding code, and contracts between teams can drift.
One GraphQL quirk surprises newcomers: a request can return HTTP 200 with a partial result and an error list inside the body. Your monitoring and your client code need to look inside the response, not only at status codes.
Real-time updates
GraphQL has subscriptions, a built-in way for a client to receive updates when data changes. IBM points out that REST has no equivalent, and usually relies on long-polling or server-sent events. In practice, subscriptions are typically carried over WebSockets, which means running a stateful connection layer. That is real infrastructure to operate and scale.
If live updates are a minor feature, such as a notification badge, a REST API plus server-sent events is often simpler. If live data is the product, as in chat, collaborative editing or dashboards, think about the transport first and the query style second.
The costs GraphQL brings with it
GraphQL moves complexity from the client to the server. Three issues come up in nearly every project.
The N+1 problem
A GraphQL server resolves each field with a resolver. Ask for 50 orders and the customer on each, and a naive implementation runs one query for the orders and 50 more for the customers. GraphQL.org’s performance guidance names this N+1 problem and recommends batching, for example with DataLoader. It is solvable, but someone has to know to solve it.
Expensive queries and security
Because clients write the query, they can write a very costly one. The OWASP GraphQL Cheat Sheet warns that expensive queries can lead to denial of service and recommends depth limiting, amount limiting, pagination, timeouts, query cost analysis and rate limiting. It also advises disabling insecure defaults such as excessive error detail and introspection in production, and checking access control properly. With REST, the server fixes what each endpoint can cost, so this class of problem is smaller.
Team skills and tooling
Most developers already know REST, and the tooling is everywhere. IBM observes that many organizations still rely on REST for its established tooling and simplicity, even where GraphQL is a strong option. A smaller talent pool and a steeper learning curve are part of GraphQL’s cost, and that matters if you hire in Switzerland, where senior engineers are expensive and scarce.
Where gRPC fits
People searching this topic often meet a third option. gRPC runs over HTTP/2 and sends compact binary messages defined in Protocol Buffers, with a required schema in a .proto file. A comparison of REST, GraphQL and gRPC summarizes the usual split: REST for public APIs and anything a browser calls directly, GraphQL when many clients need different slices of the same data, and gRPC between internal services you control on both sides.
For a typical website or web app, gRPC is not the first decision. It becomes relevant when you split a backend into several services that talk to each other a lot.
When to use GraphQL, and when REST is the better fit
The AWS guidance is a good baseline. REST suits smaller applications with less complex data needs, or clients that use data and operations in similar ways. GraphQL suits limited bandwidth, multiple data sources or varied client requests. Postman frames the trade-off as simplicity and standardization for REST, against flexibility and efficiency for GraphQL.
Turn that into questions about your own product:
- How many different clients will consume the API? One web app and one mobile app with similar screens: REST. A web app, two mobile apps, partner integrations and a kiosk, each with different needs: GraphQL deserves a look.
- How nested is your data? Flat lists and simple records suit REST. Deep graphs of related objects suit GraphQL.
- Do you aggregate several backends? A GraphQL layer in front of a CRM, an ERP and a shop system can give frontend developers one clean interface.
- Is the API public? Public APIs for third parties are easier to document, cache and rate limit as REST.
- Who will maintain it? If your team is two developers and an agency, the simpler model wins on cost of ownership.
- Do you have heavy read traffic for public content? REST and CDN caching win.
A common middle path
You do not have to choose once for all time. Many products keep REST for simple, cacheable resources and public endpoints, and add a GraphQL layer later as a gateway for complex frontends. Starting with a clean, well-documented REST API with an OpenAPI schema keeps that door open without paying for GraphQL on day one.
What this means for a startup or SME in Switzerland
The question most founders ask is not which is better but which one avoids a rewrite. Our honest answer: the API style rarely causes rewrites. Unclear requirements, tangled data models and one-off endpoints do. Pick the style your team can run well, define your data model carefully, and document the contract.
Two cases come up often in our work. The first is a new MVP with a single web frontend: REST, with a typed schema, is fast to build and cheap to hand over. The second is a company connecting an existing shop, CRM and ERP into a new portal: here a GraphQL layer, or a thin integration layer with purpose-built REST endpoints, can both work, and the right call depends on how many frontends you expect in the next two years.
How we can help
We are a small Zurich studio, and senior engineers stay on every project from the first conversation to handover, so the API decision is made by the people who will build and maintain it. We build websites, web and mobile apps, platforms and system integrations, and we can review an existing API or plan a migration. If you want a second opinion before committing, see our pricing and engagement options or look at recent projects. For ongoing care, our Run & monitor plan is listed at CHF 750 per month, and our Guidance plan for senior technical advice at CHF 799 per month.
FAQ
Is GraphQL better than REST?
Neither is better in general. GraphQL is stronger for varied clients, nested data and multiple sources, while REST is simpler, easier to cache and well understood by almost every developer. The right choice depends on your clients, your data and your team.
Is GraphQL faster than REST?
Often for the individual request, but not always at scale. In a University of Washington study, GraphQL had lower average response times for most endpoints, while REST scaled better under high concurrency. Test your own workload before deciding.
What are the main pros and cons of GraphQL?
The pros are exact data fetching, a typed schema, fewer round trips and built-in subscriptions. The cons are harder HTTP caching, the N+1 problem, the need to limit expensive queries and a steeper learning curve.
Can I use GraphQL and REST together?
Yes. Many teams keep REST for simple or public endpoints and put GraphQL in front of several services for complex frontends. This lets you adopt GraphQL where it pays off without rewriting everything.
Sources
- Comparing REST and GraphQL, AWS AppSync documentation
- GraphQL vs. REST: Investigating Performance and Scalability, University of Washington
- GraphQL vs REST: What’s the Difference? IBM
- Performance, GraphQL.org
- GraphQL Cheat Sheet, OWASP
- REST vs GraphQL vs gRPC: Differences, Performance, and When to Use
- GraphQL vs REST: Choosing the Right API Architecture, Postman
- Prediction market data API: REST and WebSocket guide
Talk to us
Have a project this touches on?
A free 10-minute call is the fastest way to find out whether we are the right studio for it.
Book a free 10-min callKeep reading
More articles.
Project Estimation Accuracy: How to Get Software Estimates You Can Trust
Why software estimates miss, which estimation techniques work, and how to make your numbers more reliable over time, with research-backed steps and examples.
Read articleWordPress to Headless: A Migration Guide for Next.js
Moving WordPress to a headless setup with Next.js: when it pays off, how the migration works step by step, what it costs in upkeep, and how to avoid pitfalls.
Read articleCode Audit Checklist: What to Check and How to Report It
A practical code audit checklist for founders and CTOs: security, architecture, tests, dependencies, Swiss data protection and how to write up findings.
Read article