ROUTE06

Technology

Apollo GraphQL: The Expansion of Open Source Software and SaaS

2022-12-28

Takafumi Endo

Share

In recent years, a variety and large volume of data processing has become common in the operation of products such as web services and mobile applications, not only in large companies but also in startup companies that have just been established. Thanks to advancements in technology, particularly cloud computing, it is now possible to develop and operate web services that handle large volumes of data—such as video and voice—and applications requiring real-time responses and integration with multiple IoT devices, all without the need for specialized system construction or a dedicated team. This is becoming possible.

With the rise of communication technologies and standards like 5G, the volume of data processed has significantly increased. This has also accelerated opportunities to handle new types of data, such as personal data and health logs, via microdevices at high speeds and frequencies on the web. The demand for API integration and efficient data fetching with various external services and system integration across departments and affiliated companies within a company continues to increase, and the need for efficient API access is crucial in enhancing user experiences. Software architecture is becoming more and more complex every year. In addition, the level of demand from users for quick response and stability is high, and the expression of user interfaces, such as dynamic components and personalization, is also becoming more sophisticated. The number of data processing issues, both front-end and back-end, and the solutions to address them, will continue to increase.

Given this context, this article introduces GraphQL, an open-source query language for Web APIs that has gained significant attention in recent years, along with Apollo Graph, a company that develops and operates an application platform built on GraphQL. When it comes to data processing technology, products and technologies of major tech companies such as Google, Amazon, and Microsoft tend to attract attention in general, but various open source software and related services such as Apollo GraphQL are used behind the scenes of all web services. Apollo GraphQL's advanced features, including schema stitching, make it a powerful tool for developers.

What is GraphQL?

GraphQL is a powerful query language for APIs that provides a strongly typed schema, enabling more efficient and flexible data retrieval. Real-time subscriptions are one of the features that enhance the responsiveness of applications. Developed by Facebook in 2015, GraphQL has quickly become a widely adopted standard for building modern APIs. Unlike traditional REST APIs, GraphQL allows clients to specify exactly what data they need, reducing the amount of data transferred and improving overall performance. This precision in data fetching not only optimizes network usage but also enhances the responsiveness of applications, making it a preferred choice for developers handling complex data interactions, including error handling.

GraphQL, a new query language for the Web API era

GraphQL is a Web API (Application Programming Interface) standard released by Facebook (now Meta) in 2015, and is used as an open-sourced query language in the development of web services and native applications worldwide It is used as an open-source query language in the development of web services and native applications around the world 1. GraphQL defines schemas using a novel ‘graph’ concept, allowing data requests to be made to a web server declaratively, similar to SQL. Schema validation ensures data consistency, making it a reliable choice for developers. Compared to RESTful APIs, GraphQL offers better control over the frequency of HTTP requests, responses, and data volume, all through a single, simple endpoint (URI, URL, etc.). The design of multiple endpoints and methods is simple. Compared to the RESTful API, which emphasizes the design of multiple endpoints and methods, the client application developer has a clear learning curve and can be more agile in implementation. One of the advantages of using GraphQL relates to the number of HTTP requests that would be generated when trying to retrieve data of interest via the REST API. As an example, let’s take product: you have a product ID and want to retrieve all product data. If we also want to retrieve the images, variants, and metafields for all products, we would have 4 unique HTTP calls. This is because in our REST, everything is a separate endpoint. This uses a tenth of our capacity, and with a recovery rate of 2 calls per second, it takes 2 seconds to recover.

Recent mobile applications often deal with large amounts of nested and interlinked data, and to improve system performance, the minimum amount of data required for a specific function (e.g., news feeds, posts, messages, etc.) module/domain must be referenced and GraphQL is a technology standard that has emerged from an era in which the implementation of functions and data processing on the client/front end of websites and native applications such as iOS/Andorid are becoming more diverse and faster, and in which microservices and API integration among various applications are required. GraphQL is a technology standard that was born from the background of the need for microservices and API integration between various applications, and has recently been adopted not only by Facebook (Meta), but also by other tech companies such as GitHub, Twitter, Shopify, Airbnb, Rakuten, Mercari, and large companies such as Walmart, Starbucks, and the New York Times, in addition to many others. Times, and other large companies, as well as in the development sites of startups around the world1

On the other hand, GraphQL is a standard that emphasizes front-end developer experience, such as easy definition of necessary data structures on the client side, and is currently being used differently from REST according to the reliability of data between GraphQL servers and the characteristics of web applications. While it increases the flexibility of front-end implementations, it also has issues such as the complexity of back-end mechanisms such as GraphQL server design and node structures between graphs. To begin with, GraphQL is an open-source query language specification, and on the server side, it is necessary to build an environment in which queries are executed in the GraphQL runtime environment, and of course, security measures such as query request control and data caching mechanisms must be prepared separately. In recent years, Apollo and its development and operation company, Apollo Graph, have been attracting attention as an application platform that addresses such issues. GraphQL optimizes network usage and enhances the responsiveness of applications, helping engineering teams deliver GraphQL solutions at scale. Metrics reporting is another benefit, allowing teams to monitor and optimize API performance effectively.

What is Apollo, the GraphQL client?

Apollo Graph is a software company that develops and manages a variety of applications designed to support client and server implementations of GraphQL. One of their products, Apollo Client (for front-end), provides various libraries for implementing UI and server data integration with GraphQL, and supports front-end languages such as React.js, Swift, and Kotlin. While GraphQL has issues such as the relative difficulty of caching by CDNs compared to REST APIs, Apollo Client provides functions to facilitate cache data integration and state management6. Apollo Graph also develops various applications related to GraphQL, including Apollo Server, a library and application for running GraphQL on a JavaScript server. Apollo Graph is a front-end developer’s product that facilitates implementation in various languages and frameworks in the GraphQL environment, while server-side developers can build and manage the often complex GraphQL server, infrastructure, and other development environments in a secure and scalable manner. Additionally, the Apollo GraphOS platform enables engineering teams to effectively implement GraphQL at any scale, accelerating feature delivery and enhancing application development. Server-side developers can build and manage the often-complex GraphQL server, infrastructure, and other development environments in a secure and scalable manner. Explorer IDE is another tool provided by Apollo that enhances the development workflow, making it easier for developers to work with GraphQL.

GraphQL Architecture
Created by us based on the diagram in StepZen's "A New Architecture for APIs"
.

Apollo Graph is an OSS (Open Source Software) development community, but also a unicorn company that is highly regarded by world-class venture capitalists such as Andreessen Horowitz 7. Their products range from publicly available OSS to paid SaaS offerings, and in recent years, many software companies have adopted a similar business model. Apollo’s open source library has grown to over 17 million downloads per month and over 6 billion queries executed daily as of August 2021. Apollo actively engages with the GraphQL community through events and collaborative efforts, fostering innovation and networking opportunities.

According to Apollo Graphics, the company has already been awarded the SOC 2 Type II security certification by Walmart and Starbucks. In 2020, Netflix is expected to adopt Apollo Federation, an architecture for integrated management of multiple GraphQL servers and domain development. In 2020, Netflix will adopt Apollo Federation, an architecture for managing multiple GraphQL servers and domain development,8 and Apollo products are currently being deployed by Expedia, PayPal, and other large, multi-channel digital service companies. “Apollo Federation will allow us to implement our existing schema linking in a safer, declarative manner, while opening up a whole new level of broader federation opportunities across the level of broader federation opportunities across the wider enterprise”. Dan Boerner, Distinguished Product Manager at Expedia Group 9. Created by us based on the diagram in “Expedia Group Transforms Product Development with Apollo”.

Walmart had already adopted a BFF (Backend For Frontend) architecture, which was already a microservice and front-end friendly development environment, but it took about 14 months from planning and research to migrate its e-commerce platform to a GraphQL architecture using Apollo. to a GraphQL architecture that leverages Apollo. According to their published materials, the result was the unification of multiple carts, search functions, etc. that had previously existed, highlighting the improved convenience for users as well as the developer experience10.

Apollo GraphQL
Created by us based on the diagram in "The Apollo GraphQL platform" by Apollo Graph

Benefits of Using Apollo

Apollo stands out as a leading provider of GraphQL tools and libraries, offering numerous benefits for application development:

Improved Performance: Apollo’s advanced caching and optimization features significantly reduce latency, ensuring that your application runs smoothly and efficiently. Additionally, query request control enhances security by managing and validating incoming queries.

Increased Flexibility: With Apollo’s GraphQL client, you can effortlessly switch between different data sources and APIs, making it easier to integrate new features and services into your application. Data caching further improves performance by storing frequently accessed data for quicker retrieval.

Enhanced Developer Experience: Apollo’s suite of tools and libraries provides a seamless and intuitive experience for developers, simplifying the process of building and maintaining complex applications.

Scalability: Designed to handle large volumes of traffic, Apollo’s GraphQL server can scale to meet the demands of even the most extensive applications, ensuring robust performance under heavy loads.

Apollo Solutions

Apollo offers a comprehensive range of solutions for building, managing, and scaling GraphQL APIs and applications:

Apollo Client: A flexible and customizable GraphQL client for JavaScript and native platforms, enabling developers to fetch data efficiently and manage application state seamlessly.

Apollo Server: A spec-compliant and production-ready GraphQL server for Node.js and other platforms, providing a robust foundation for your GraphQL API. It also supports schema stitching, allowing you to combine multiple schemas.

Apollo GraphOS: A cloud platform that connects any GraphQL API, offering powerful features like metrics reporting, schema validation, and the Explorer IDE to enhance your development workflow. It also supports real-time subscriptions, enhancing data interaction.

Apollo Federation: A configurable, high-performance routing runtime for building federated GraphQL APIs, allowing you to manage and scale multiple GraphQL services as a single cohesive graph.

Expedia Appolo GraphQL
Created by us based on the diagram in "Expedia Group Transforms Product Development with Apollo"

"Apollo Federation will allow us to implement our existing schema linking in a safer, declarative manner, while opening up a whole new level of broader federation opportunities across the level of broader federation opportunities across the wider enterprise". Dan Boerner, Distinguished Product Manager at Expedia Group 9.

Getting Started with Apollo

Getting started with Apollo is straightforward. Follow these steps to begin:

1. Install Apollo Client or Server: Use npm or yarn to install the Apollo Client or Server in your project.

2. Create a New GraphQL Schema: Define your data structure using the Apollo Schema Definition Language (SDL).

3. Schema Validation: Ensure your GraphQL schema is correctly validated to prevent errors and maintain data integrity.

4. Configure Apollo Client or Server: Set up the Apollo Client or Server to connect to your GraphQL API, ensuring seamless data fetching and state management.

5. Metrics Reporting: Implement metrics reporting to monitor the performance of your Apollo setup and optimize as needed.

6. Start Building Your Application: Leverage the Apollo Client or Server to build your application, taking advantage of Apollo’s powerful features to enhance performance and scalability.

Features of Apollo

Apollo offers a range of features that make it an ideal choice for building and managing GraphQL APIs and applications:

Caching: Apollo’s caching capabilities reduce latency and improve performance by storing frequently accessed data in memory, ensuring quick data retrieval.

Optimization: Apollo’s optimization features minimize the amount of data transferred, enhancing performance by optimizing queries and mutations.

Security: Apollo’s robust security features protect your GraphQL API from unauthorized access and malicious attacks, ensuring data integrity and privacy. Apollo also meets the SOC 2 Type II certification standard, providing an additional layer of security assurance.

Scalability: Apollo’s scalability features enable your application to handle large volumes of traffic, allowing it to grow and meet the needs of even the largest user bases.

Explorer IDE: Apollo includes the Explorer IDE, a powerful tool for exploring and testing queries, making it easier for developers to work with GraphQL APIs.

By integrating these sections, the article will provide a comprehensive overview of GraphQL and Apollo, highlighting their benefits, solutions, and features, while maintaining a consistent tone and style.

GraphQL Server: The Heart of Your GraphQL API

A GraphQL server is the backbone of any GraphQL API, responsible for processing incoming queries and mutations, and delivering the requested data to the client. The efficiency and reliability of your GraphQL server directly impact the performance and scalability of your API. Apollo GraphQL offers a suite of tools and libraries designed to help developers build, manage, and scale robust GraphQL servers. Among these, Apollo Server stands out as a spec-compliant and production-ready JavaScript GraphQL server. It provides a solid foundation for your GraphQL API, ensuring that your data is handled securely and efficiently. With Apollo Server, you can leverage advanced features like schema stitching, real-time subscriptions, and detailed error handling, making it easier to deliver high-quality data experiences to your users.

GraphOS: The GraphQL Developer Platform

GraphOS is Apollo’s cloud platform that revolutionizes the way developers build, manage, and scale their GraphQL APIs. By connecting any GraphQL API, GraphOS offers a plethora of powerful features designed to enhance the developer experience. With metrics reporting, you gain valuable insights into your API’s performance and usage patterns, allowing you to make data-driven decisions. Schema validation ensures that your API remains consistent and error-free, while the Explorer IDE provides an intuitive interface for exploring and testing your GraphQL queries. GraphOS simplifies the complexities of managing a GraphQL API, enabling you to focus on delivering new features and improving your application’s performance.

Use Cases and Success Stories

Apollo GraphQL has been instrumental in helping a diverse range of companies and organizations achieve their goals. From small startups to large enterprises, Apollo’s tools and libraries have enabled businesses to deliver scalable, performant, and secure GraphQL APIs. For instance, Netflix adopted Apollo Federation to manage multiple GraphQL servers, resulting in a more efficient and cohesive API architecture. Similarly, Walmart leveraged Apollo to unify its e-commerce platform, significantly enhancing the user experience and developer productivity. These success stories highlight the transformative impact of Apollo GraphQL, demonstrating its ability to meet the demands of modern application development and deliver exceptional results.

Community and Support

One of the standout aspects of Apollo GraphQL is its vibrant and active community. With a wealth of resources at your disposal, getting started with GraphQL has never been easier. Apollo offers comprehensive documentation and tutorials that guide you through every step of your GraphQL journey. The community forums and GitHub repositories are bustling with activity, providing a platform for developers to share knowledge, ask questions, and collaborate on projects. This strong community support ensures that you are always up-to-date with the latest developments in the GraphQL ecosystem and can quickly find solutions to any challenges you encounter.

OSS and the Potential of SaaS for the Enterprise

In October 2022, Apollo Graph will announce GraphOS, which will support the construction of infrastructure for large-scale systems that bundle multiple GraphQL APIs and groups of servers, with the aim of becoming a marketplace for data access connected to a variety of microservices, from enterprise networks to external API services. Based in San Francisco, Apollo Graph aims to become a marketplace for data access connected to a variety of microservices, from enterprise networks to external API services. It is expected that the company will enhance its enterprise-oriented functions and promote a platform strategy that can be expected to have network effects, in conjunction with the expansion of Apollo’s functions as SaaS, as well as the feedback of knowledge to the OSS development community. The evolution and utilization of GraphQL-related technologies will continue to accelerate in the future. One of the key features enhancing security in enterprise environments is query request control, which ensures that only authorized queries are processed, thereby protecting sensitive data.

In the history of software development, not only Apollo Graph, but also MongoDB, GitLab, and other OSS communities have been supported by many technology companies that develop and operate commercial applications for OSS. On the other hand, there are many products such as GitHub for git that were developed as SaaS with different functions and spread, while originating from the OSS technology. Especially in the enterprise domain, commercialized SaaS tends to be preferred in terms of security and development man-hours, and it is expected that more and more OSS in specialized technical areas such as GraphQL will be converted to SaaS for enterprise use in the future. Data caching is another method to improve performance in large-scale systems, ensuring faster access to frequently requested data. We hope this article proves useful for those exploring case studies of GraphQL and Apollo Graph, or for those considering business ventures related to OSS and its SaaS.

For enterprise organizations, GraphQL offers significant advantages, including improved data access, reduced latency, and increased developer productivity. GraphQL enables developers to access data from multiple sources in a single query, minimizing the need for multiple API calls and enhancing application performance. Apollo GraphOS is a cloud platform specifically designed to manage and scale GraphQL APIs at an enterprise level. With Apollo GraphOS, you can handle schema validation, metrics reporting, and performance optimization in a cohesive and efficient manner. The platform also supports the creation and management of GraphQL federations, simplifying the development of complex, distributed systems. By utilizing Apollo GraphOS, enterprises can ensure their GraphQL APIs are robust, scalable, and capable of meeting the demands of modern application development.

In conclusion, GraphQL is a powerful query language for APIs that offers a strongly typed schema and flexible data retrieval capabilities. With tools like Apollo Client, developers can build scalable applications quickly and efficiently, while Apollo GraphOS provides the infrastructure needed to manage GraphQL APIs at scale. Whether you’re developing a small application or a complex enterprise system, GraphQL and Apollo offer numerous benefits, including improved data access, reduced latency, and increased developer productivity. By embracing these technologies, you can enhance your application’s performance and deliver exceptional user experiences.

Apollo GraphQL
GraphQLSaaSAPIMicroservicesServerless ArchitectureCloud ComputingOpen SourceData IntegrationEnterpriseDevOps

About the Author

Takafumi Endo is a graduate of the Graduate School of Information Sciences at Tohoku University. After graduation, he worked at the Development Bank of Japan Inc. and Dream Incubator Inc. He then founded Smarby, Inc., where he served as CEO. After the company's acquisition by a major apparel company through an M&A, he became Director, CPO, and CMO at STRIPE DEPARTMENT CO., LTD. Following his involvement as an EIR at Delight Ventures, Inc., he founded ROUTE06 and became its Representative Director.


New Articles

Transformation

Priority Plan 2024 for the Realization of a Digital Society: The Future of Business Competitiveness and Digital Transformation

This article explains how the Priority Plan for the Realization of a Digital Society will impact Japan's business environment and how companies should leverage digital transformation.

Details