Scalable GraphQL Applications Powered by Cloud-ready Distributed SQL Database

Rate this content
Bookmark

Cloud native application development revolves around faster prototyping and building scalable applications for handling internet-scale traffic. GraphQL, with its roots in providing a flexible way to access data for UX applications, enables faster prototyping, leading to considerable adoption of GraphQL across different workloads. Increased adoption of GraphQL APIs in mission-critical applications prompts developers to think about the scalability challenges of the GraphQL APIs and corresponding backing database.


YugateDB, an open-source Distributed SQL database designed for cloud native applications from the ground up, is emerging as the popular option for building scalable and resilient GraphQL APIs. This talk will go over the features and deployment topologies of YugateDB, which allows developers to scale the relational queries of the GraphQL APIs seamlessly while not compromising on the PostgreSQL compatibility and features like triggers and functions.

This talk has been presented at GraphQL Galaxy 2021, check out the latest edition of this Tech Conference.

FAQ

YugabyteDB is a 100% open-source distributed SQL database designed to provide horizontal scalability for relational workloads and geo-distribution of datasets while maintaining PostgreSQL compatibility.

Nikhil Chandrapa is a member of the ecosystem engineering team at YugabyteDB, where he works on implementing ecosystem integrations for popular developer tools like GraphQL and Spring Framework.

YugabyteDB helps in scaling GraphQL services by allowing the addition of new nodes to the cluster, which can easily scale out the workload without much management. This ensures that the database can handle increased transactions and maintain low latency.

Distributed SQL in YugabyteDB refers to the ability to provide high availability and horizontal scalability for relational workloads. This includes supporting geo-distribution and ensuring that data can be spread across different regions or clouds.

YugabyteDB ensures high availability by allowing deployments across different availability zones, regions, or clouds. This helps in mitigating risks such as cloud outages and ensures continuous service availability.

Yes, YugabyteDB offers a free trial instance through its Yugabyte Cloud platform. Users can start a free trial to explore and test their GraphQL workloads on YugabyteDB.

Yes, YugabyteDB maintains PostgreSQL compatibility, which means that features like SQL joins, triggers, and functions that work in PostgreSQL will also work in YugabyteDB.

Geo-partitioning in YugabyteDB allows data to be distributed based on geographical locations. This means that certain rows can reside only in servers located in specific regions, ensuring data compliance and efficient data management.

YugabyteDB supports geo-distribution topologies, allowing deployments across different availability zones, regions, or clouds to ensure data availability and compliance.

You can get support for YugabyteDB by reaching out to the team on their Slack channel, where they are always active. Additionally, the YugabyteDB GitHub page contains resources and documentation for further assistance.

Nikhil Chandrappa
Nikhil Chandrappa
8 min
10 Dec, 2021

Comments

Sign in or register to post your comment.

Video Summary and Transcription

YugabyteDB is an open-source distributed SQL database that offers horizontal scalability and geo-distribution while maintaining Postgres compatibility. It enables building scalable and always-on GraphQL services by allowing the workload to be scaled through the addition of new nodes and deployment across different regions or clouds. YugabyteDB also supports geo-partitioning and data compliance. It can easily handle increasing GraphQL workloads and can be tried out by downloading the database or using the Yugabyte Cloud platform.

1. Introduction to YugobyteDB and Distributed SQL

Short description:

I will talk about building scalable and always-on GraphQL services using distributed SQL database. YugobyteDB is a 100% open-source distributed SQL database that provides horizontal scalability for relational workloads and geo-distribution of the dataset while maintaining Postgres compatibility.

Thanks you all for joining. My name is Nikhil Chandrapa. I work in the ecosystem engineering team of YugibyteDB. We are a database startup. I work in the – we kind of work in implementing ecosystem integrations for the popular developer tools like GraphQL, Spring Framework, and host of other cloud native projects.

In today's session, I wanted to talk about how we can build scalable and always on GraphQL services using distributed SQL database. In this talk, we are going to talk through what distributed SQL means and how some of the topologies of distributed SQL can help natively scale the GraphQL workload.

Before I get into scaling the GraphQL workflow itself, I just wanted to give a brief of YugobyteDB. YugobyteDB is a 100% open-source distributed SQL database. It's where we are going to provide horizontal scalability for the relational workloads and also able to provide geo-distribution of the dataset. While maintaining the Postgres compatibility, which means all the things that you will be doing with Postgres like SQL joins, some of the things like triggers functions, will continue to work with Yugobyte. But the data distribution will be in a different format.

2. Building Scalable and Always-On GraphQL Services

Short description:

YugabyteDB founders aimed to build a database that combines high availability with distributed capabilities. Distributed SQL allows scaling the workload by adding new nodes and deploying across different regions or clouds. It also enables geo-partitioning and data compliance. YugabyteDB can easily scale to handle increasing GraphQL workloads by adding new nodes. You can try it out by downloading the database or using the Yugabyte Cloud platform. If you have any questions or are interested in joining our team, reach out to us on Slack or visit our careers page.

YugobyteDB founders, when they started building the database itself, they wanted to build a database which can provide high availability like Amazon Aurora while supporting all the RDBMS features and also provide a distributed capability like Spanner where you can horizontally scale the relational workload as well as support your distribution. So, obviously, when coming to the actual topic, when it comes to the GraphQL itself, GraphQL is pretty simple how you get started. You have a GraphQL server, you connect it to your database, and you can start working with building your APIs.

As and when you finish building your API, you get to this problem where how do you scale your services, right? One of the harder problems is to scale your database workload itself. So, the database can reach its resource limitations, you might have to do query limiting, the latencies might increase. In order to that distributed SQL will help where you can keep adding new nodes to the cluster and it can easily scale out the workload without having much management things that as a developer you'll have to do. You just run a cli command on the graphical UI, you just say, scale from 500 transactions to 1000 transactions, it will automatically figure out what needs to be done behind the scenes and scale out the cluster.

And also apart from scaling out the database there's like few things that you have to take care when you want to run always on kind of a service, right? Obviously, where you deploy your database, whether you deploy it in your one region or a different cloud that matters. With distributed SQL like you got by DB, you are able to make use of the geo distribution topologies we support and you can either deploy across different availability zones, regions or cloud. Recently, we had that Amazon cloud outage right where both east and west regions went down for that many of the internet scale applications like popular apps went down. In order to avoid such a thing you would want to deploy your applications on two different clouds so that one of the main things you would want to do in such cases is to have your data tier available across the globe or across the geographical locations. That's how distributed SQL topologies will help to continue your business so that you don't have a lot of financial loss. And also you're able to do things like geo-partitioning and data compliance. In Nougatbyte, there is a concept of row-level data placement where based on a certain column, like a geographical location, E.U. or U.S., you can have certain rows only reside in the server of that particular region. Such that you would not have to manually take care of the compliance. The database will do it for you. That's how we have been able to develop this database from ground up for the cloud-native architecture, keeping the modern database technologies and data tier requirements in mind.

One of the things for us to make sure that Nougatbyte can work for the GraphQL kind of workloads, what we did is we took GraphQL subscription and we wanted to scale it out linearly, so that we know whenever we are going to the customer or the actual production workload itself, what we are able to do and obviously numbers talk all the time. We started with a simple three-node cluster where we were handling around 25,000 subscriptions and we were able to linearly scale out that workload, the GraphQL workload, it was a simple GraphQL workload which we had serving through Hasura, but the database itself was able to scale to handle 25,000 transactions to a million subscriptions such that we didn't have to do a lot of things. The same architecture was able to scale to 1 million subscribers just by adding new nodes to the database. So you can start small, as and when your GraphQL workload or the services or the API that you are serving through GraphQL kind of increases or increases in use, you can keep adding new nodes. So it will be much simpler than adding read replicas or other things because the distributed SQL database knows how to place the data and how to route the query traffic and kind of all the other things that are required for handling a distributed kind of a process is already built into the database. That's how we are able to easily scale out the database.

If you are interested in this particular piece of exercise, you can go ahead and see our GitHub. You can go to Navigate to Yugabyte and Yugabyte GraphQL Apps. You will see that. Obviously, you might be thinking how do I try it out, right? It's an open source database. You can just download the database on your Mac laptop and you can just quickly start it up. And also we are providing – recently we announced our Yugabyte Cloud platform where you can go ahead and start a free trial instance of Yugabyte DB and play around with your GraphQL workloads. It is super simple. It kind of takes care of all the install and manage part of running the database and also it supports linear scalability. It will be super easy for you to get started and if you have any questions regarding how you can get started with cloud or Yugabyte DB, please reach out to us. You can reach out to us on our Slack. We will be always active on Slack and also we are actively hiring a lot. We are now a unicorn company. If you are interested in solving distributed SQL or some of the GraphQL related workloads with Yugabyte DB, please feel free to see our careers page.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

From GraphQL Zero to GraphQL Hero with RedwoodJS
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
From GraphQL Zero to GraphQL Hero with RedwoodJS
Top Content
Tom Pressenwurter introduces Redwood.js, a full stack app framework for building GraphQL APIs easily and maintainably. He demonstrates a Redwood.js application with a React-based front end and a Node.js API. Redwood.js offers a simplified folder structure and schema for organizing the application. It provides easy data manipulation and CRUD operations through GraphQL functions. Redwood.js allows for easy implementation of new queries and directives, including authentication and limiting access to data. It is a stable and production-ready framework that integrates well with other front-end technologies.
Local State and Server Cache: Finding a Balance
Vue.js London Live 2021Vue.js London Live 2021
24 min
Local State and Server Cache: Finding a Balance
Top Content
This Talk discusses handling local state in software development, particularly when dealing with asynchronous behavior and API requests. It explores the challenges of managing global state and the need for actions when handling server data. The Talk also highlights the issue of fetching data not in Vuex and the challenges of keeping data up-to-date in Vuex. It mentions alternative tools like Apollo Client and React Query for handling local state. The Talk concludes with a discussion on GitLab going public and the celebration that followed.
Batteries Included Reimagined - The Revival of GraphQL Yoga
GraphQL Galaxy 2021GraphQL Galaxy 2021
33 min
Batteries Included Reimagined - The Revival of GraphQL Yoga
Envelope is a powerful GraphQL plugin system that simplifies server development and allows for powerful plugin integration. It provides conformity for large corporations with multiple GraphQL servers and can be used with various frameworks. Envelope acts as the Babel of GraphQL, allowing the use of non-spec features. The Guild offers GraphQL Hive, a service similar to Apollo Studio, and encourages collaboration with other frameworks and languages.
Rock Solid React and GraphQL Apps for People in a Hurry
GraphQL Galaxy 2022GraphQL Galaxy 2022
29 min
Rock Solid React and GraphQL Apps for People in a Hurry
The Talk discusses the challenges and advancements in using GraphQL and React together. It introduces RedwoodJS, a framework that simplifies frontend-backend integration and provides features like code generation, scaffolding, and authentication. The Talk demonstrates how to set up a Redwood project, generate layouts and models, and perform CRUD operations. Redwood automates many GraphQL parts and provides an easy way for developers to get started with GraphQL. It also highlights the benefits of Redwood and suggests checking out RedwoodJS.com for more information.
Adopting GraphQL in an Enterprise
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
Adopting GraphQL in an Enterprise
Today's Talk is about adopting GraphQL in an enterprise. It discusses the challenges of using REST APIs and the benefits of GraphQL. The Talk explores different approaches to adopting GraphQL, including coexistence with REST APIs. It emphasizes the power of GraphQL and provides tips for successful adoption. Overall, the Talk highlights the advantages of GraphQL in terms of efficiency, collaboration, and control over APIs.
Step aside resolvers: a new approach to GraphQL execution
GraphQL Galaxy 2022GraphQL Galaxy 2022
16 min
Step aside resolvers: a new approach to GraphQL execution
GraphQL has made a huge impact in the way we build client applications, websites, and mobile apps. Despite the dominance of resolvers, the GraphQL specification does not mandate their use. Introducing Graphast, a new project that compiles GraphQL operations into execution and output plans, providing advanced optimizations. In GraphFast, instead of resolvers, we have plan resolvers that deal with future data. Graphfast plan resolvers are short and efficient, supporting all features of modern GraphQL.

Workshops on related topic

Build with SvelteKit and GraphQL
GraphQL Galaxy 2021GraphQL Galaxy 2021
140 min
Build with SvelteKit and GraphQL
Top Content
Featured WorkshopFree
Scott Spence
Scott Spence
Have you ever thought about building something that doesn't require a lot of boilerplate with a tiny bundle size? In this workshop, Scott Spence will go from hello world to covering routing and using endpoints in SvelteKit. You'll set up a backend GraphQL API then use GraphQL queries with SvelteKit to display the GraphQL API data. You'll build a fast secure project that uses SvelteKit's features, then deploy it as a fully static site. This course is for the Svelte curious who haven't had extensive experience with SvelteKit and want a deeper understanding of how to use it in practical applications.

Table of contents:
- Kick-off and Svelte introduction
- Initialise frontend project
- Tour of the SvelteKit skeleton project
- Configure backend project
- Query Data with GraphQL
- Fetching data to the frontend with GraphQL
- Styling
- Svelte directives
- Routing in SvelteKit
- Endpoints in SvelteKit
- Deploying to Netlify
- Navigation
- Mutations in GraphCMS
- Sending GraphQL Mutations via SvelteKit
- Q&A
Build Modern Applications Using GraphQL and Javascript
Node Congress 2024Node Congress 2024
152 min
Build Modern Applications Using GraphQL and Javascript
Featured Workshop
Emanuel Scirlet
Miguel Henriques
2 authors
Come and learn how you can supercharge your modern and secure applications using GraphQL and Javascript. In this workshop we will build a GraphQL API and we will demonstrate the benefits of the query language for APIs and what use cases that are fit for it. Basic Javascript knowledge required.
End-To-End Type Safety with React, GraphQL & Prisma
React Advanced Conference 2022React Advanced Conference 2022
95 min
End-To-End Type Safety with React, GraphQL & Prisma
Featured WorkshopFree
Sabin Adams
Sabin Adams
In this workshop, you will get a first-hand look at what end-to-end type safety is and why it is important. To accomplish this, you’ll be building a GraphQL API using modern, relevant tools which will be consumed by a React client.
Prerequisites: - Node.js installed on your machine (12.2.X / 14.X)- It is recommended (but not required) to use VS Code for the practical tasks- An IDE installed (VSCode recommended)- (Good to have)*A basic understanding of Node.js, React, and TypeScript
GraphQL for React Developers
GraphQL Galaxy 2022GraphQL Galaxy 2022
112 min
GraphQL for React Developers
Featured Workshop
Roy Derks
Roy Derks
There are many advantages to using GraphQL as a datasource for frontend development, compared to REST APIs. We developers in example need to write a lot of imperative code to retrieve data to display in our applications and handle state. With GraphQL you cannot only decrease the amount of code needed around data fetching and state-management you'll also get increased flexibility, better performance and most of all an improved developer experience. In this workshop you'll learn how GraphQL can improve your work as a frontend developer and how to handle GraphQL in your frontend React application.
Build a Headless WordPress App with Next.js and WPGraphQL
React Summit 2022React Summit 2022
173 min
Build a Headless WordPress App with Next.js and WPGraphQL
Top Content
WorkshopFree
Kellen Mace
Kellen Mace
In this workshop, you’ll learn how to build a Next.js app that uses Apollo Client to fetch data from a headless WordPress backend and use it to render the pages of your app. You’ll learn when you should consider a headless WordPress architecture, how to turn a WordPress backend into a GraphQL server, how to compose queries using the GraphiQL IDE, how to colocate GraphQL fragments with your components, and more.
Relational Database Modeling for GraphQL
GraphQL Galaxy 2020GraphQL Galaxy 2020
106 min
Relational Database Modeling for GraphQL
Top Content
WorkshopFree
Adron Hall
Adron Hall
In this workshop we'll dig deeper into data modeling. We'll start with a discussion about various database types and how they map to GraphQL. Once that groundwork is laid out, the focus will shift to specific types of databases and how to build data models that work best for GraphQL within various scenarios.
Table of contentsPart 1 - Hour 1      a. Relational Database Data Modeling      b. Comparing Relational and NoSQL Databases      c. GraphQL with the Database in mindPart 2 - Hour 2      a. Designing Relational Data Models      b. Relationship, Building MultijoinsTables      c. GraphQL & Relational Data Modeling Query Complexities
Prerequisites      a. Data modeling tool. The trainer will be using dbdiagram      b. Postgres, albeit no need to install this locally, as I'll be using a Postgres Dicker image, from Docker Hub for all examples      c. Hasura