VOOZH about

URL: https://thenewstack.io/graphql-vs-rest-you-really-dont-have-to-choose/

⇱ GraphQL vs. REST: You Really Don’t Have to Choose - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2023-10-10 09:13:41
GraphQL vs. REST: You Really Don’t Have to Choose
sponsor-apollo-graphql,sponsored-post-contributed,
DevOps / Software Development

GraphQL vs. REST: You Really Don’t Have to Choose

Because they approach data from different perspectives, GraphQL can be a complementary technology to REST.
Oct 10th, 2023 9:13am by Aditya Gune
👁 Featued image for: GraphQL vs. REST: You Really Don’t Have to Choose
Image from Wirestock Creators on Shutterstock.
Apollo GraphQL sponsored this post. Insight Partners is an investor in Apollo GraphQL and TNS.

Forums like StackOverflow are full of “GraphQL vs. REST” posts, and much of the discussion about GraphQL starts with this tale of dueling architectures, but companies don’t necessarily need to choose one or the other. While both technologies provide methods of fetching data from a backend system, they solve different problems and approach data from different ends of a spectrum.

GraphQL provides a strongly typed schema definition language to describe data that lives across any number of systems in a way that is intuitive and useful to clients. Client teams can then use a declarative query language to describe the data they need. GraphQL also reduces sequential network calls, as it allows clients to fetch a graph of data with a single query, so it doesn’t have to individually fetch all the related entities, compose them and return the data to the client.

By contrast, REST encourages a more resource-oriented approach to organizing and deploying services, usually along domain boundaries. It’s more focused on modeling entity relationships than it is on serving data to the client in a demand-driven way.

Articles that place the two technologies in competition with each other often lose sight of the bigger picture — they both serve an important purpose in an enterprise’s architecture. Because they approach data from different perspectives, GraphQL can be a complementary technology to REST.

GraphQL helps software teams deliver features faster, and the Apollo GraphOS platform helps teams deliver GraphQL at scale, across any number of clients and services. Insight Partners is an investor in Apollo GraphQL and TNS.
Learn More
The latest from Apollo GraphQL

Implementing the GraphQL Integration Layer

So how do companies actually use GraphQL and RESTful services together? Many organizations write a graph layer on top of existing service and data layers rather than replacing them altogether. This federated graph layer abstracts the complexity of REST endpoints for client teams as the graph layer exposes a single endpoint for all operations instead of the otherwise hundreds of unique REST endpoints.

This architecture is often called a supergraph or a federated graph and was introduced by Apollo in 2019. It creates an abstraction layer that can replace most backends-for-frontends (BFFs) or experience APIs. Client teams can use a declarative query language to fetch precisely the data they need using a single query, with all composition occurring server-side. This approach reduces the number of client-to-server round trips required to fetch resources, especially ones with complex relationships. Implementing this type of architecture is simpler than it seems as it doesn’t require rewriting the backend stack.

For example, in a traditional client-API architecture, fetching a resource and a subset of properties from two related resources would require a total of three round trips to the server. The client would also have to compose the API responses, parsing through the entire payload and discarding unnecessary data.

👁 Image

A supergraph, by contrast, can fetch these resources on the backend. This leaves the responsibility of fetching data and composing it into the appropriate shape to a server-side application, which often has more compute power and lower network latency than client-side applications. These performance gains can be even more prominent if the client is a mobile app with a potentially unstable signal or lower data rate limits.

👁 Image

Rather than sending the entire user object, cart object and purchase object to the client, we can let the GraphQL layer compose a schema that fits the client’s needs and send only relevant data back.

The combined GraphQL and REST API architecture also shows performance benefits when the backend service is not one API but a set of microservices. The same principle applies, but rather than eliminating three round trips to a single service, GraphQL eliminates three round trips to three services, each with its own network latencies and load levels.

Scalability Across Current and Future Clients

GraphQL offers an unmatched level of operational scalability because it provides a single façade to clients while remaining agnostic about the underlying data sources. Whether your backend consists of RESTful microservices, monolithic SOAP APIs or even other graphs, GraphQL can act as a way of exposing those data sources in a uniform way without the complexity of managing multiple endpoints and implementations at the client.

By providing an easily accessible interface for clients to request exactly the data they need, a GraphQL and REST architecture can speed up backend development as well. Rather than building one-off backends-for-frontends for each client, a supergraph promotes composability and reuse not just for current clients, but for future projects as well. This has benefits for both frontend and backend teams:

  • With less one-off integration and orchestration code to write, backend teams have more time to focus on the underlying systems that power the product.
  • Frontend teams can ship more clients or even implement micro-frontends, without relying on new and bespoke backend-for-frontends.

For companies with public APIs, a GraphQL implementation also provides a level of self-documentation that can be difficult to achieve with a REST API. The GraphQL server provides clients speedy access to the data being requested, while the backend services remain a set of highly structured REST APIs.

The hybrid GraphQL and REST API architecture also addresses a problem many companies face when attempting to scale their architecture: how to serve a diverse array of clients with various security, compliance or regulatory requirements. A pure GraphQL setup should not be completely relied on to manage the complexity of database access and the necessary business logic, while a pure REST API would present challenges associated with handling the diversity of data fetching required for an ever-growing number of clients. However, the combination of the two can be tremendously powerful in an environment where your architecture needs to scale to accommodate a growing variety of customers and client systems.

An Evergreen Architecture

The hybrid GraphQL — REST API design can holistically improve an architecture under pressure to scale. It allows an existing backend to remain untouched in the pursuit of greater client-facing flexibility. Layering GraphQL on top of REST rather than moving away from REST altogether saves the tech org the pain of a complete re-architecture. It’s all of the benefits at a much lower cost.

This design also allows the client-facing part of the architecture to develop organically and independently, without accumulating the tech debt incurred by trying to fit a highly structured relational model like REST into a flexible multiclient data layer. This means less engineering time spent on refactoring or paying down tech debt, and more time spent on building essential features.

The end goal of any tech stack should be to build a stable, scalable and profitable product. Breaking free of the traditional boundaries and integrating GraphQL and REST into a single architecture can allow greater flexibility and unlock paths for growth that would otherwise be difficult to achieve.

GraphQL helps software teams deliver features faster, and the Apollo GraphOS platform helps teams deliver GraphQL at scale, across any number of clients and services. Insight Partners is an investor in Apollo GraphQL and TNS.
Learn More
The latest from Apollo GraphQL
TRENDING STORIES
Aditya Gune works with ReveCom Media Inc. as a writer and analyst and is a software engineer at Jetty. He has a Master's degree in computer science from Oregon State University and almost a decade of experience building software, including...
Read more from Aditya Gune
Apollo GraphQL sponsored this post. Insight Partners is an investor in Apollo GraphQL and TNS.
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Pragma, Apollo GraphQL.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
👁 Image
Platform Engineering for APIs: Using GraphQL to Drive Developer Efficiency