All Projects β†’ hasura β†’ Graphql Serverless

hasura / Graphql Serverless

Example boilerplates for GraphQL backends hosted on serverless platforms

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Graphql Serverless

Prisma1
πŸ’Ύ Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB)
Stars: ✭ 16,851 (+27985%)
Mutual labels:  graphql, serverless
Aws Appsync Chat
Real-Time Offline Ready Chat App written with GraphQL, AWS AppSync, & AWS Amplify
Stars: ✭ 522 (+770%)
Mutual labels:  graphql, serverless
React Firebase Starter
Boilerplate (seed) project for creating web apps with React.js, GraphQL.js and Relay
Stars: ✭ 4,366 (+7176.67%)
Mutual labels:  graphql, serverless
Commerceql
UNMAINTAINED
Stars: ✭ 217 (+261.67%)
Mutual labels:  graphql, serverless
Api.gatsbyjs.org
The API for the Gatsby swag store.
Stars: ✭ 44 (-26.67%)
Mutual labels:  graphql, serverless
Aws App Sync
Easily Deploy AWS AppSync GraphQL APIs Using Serverless Framework Components
Stars: ✭ 261 (+335%)
Mutual labels:  graphql, serverless
Webiny Js
Enterprise open-source serverless CMS. Includes a headless CMS, page builder, form builder and file manager. Easy to customize and expand. Deploys to AWS.
Stars: ✭ 4,869 (+8015%)
Mutual labels:  graphql, serverless
Jamstack Serverless
Learn JAMstack Serverless Modern App Development in Baby Steps using Gatsby.js, React, TypeScript, GraphQL, Contentful, Netlify, FaunaDB, MongoDB, Apollo, Github Actions, Project Fugu, and CSS Houdini.
Stars: ✭ 178 (+196.67%)
Mutual labels:  graphql, serverless
Graphql Serverless
Sample project to guide the use of GraphQL and Serverless Architecture.
Stars: ✭ 28 (-53.33%)
Mutual labels:  graphql, serverless
Panther
Detect threats with log data and improve cloud security posture
Stars: ✭ 885 (+1375%)
Mutual labels:  graphql, serverless
Mongoke
Instant Graphql for MongoDb (active branch is golang, rewrite in process)
Stars: ✭ 203 (+238.33%)
Mutual labels:  graphql, serverless
Bootcamp 2021
Fusing Serverless Cloud Computing, Infrastructure as Code, Graph Databases, AI, and IoT Technologies and preparing for Operation Unicorn Startups
Stars: ✭ 55 (-8.33%)
Mutual labels:  graphql, serverless
Aws Appsync React Workshop
Building real-time offline-ready Applications with React, GraphQL & AWS AppSync
Stars: ✭ 193 (+221.67%)
Mutual labels:  graphql, serverless
Workers Graphql Server
πŸ”₯Lightning-fast, globally distributed Apollo GraphQL server, deployed at the edge using Cloudflare Workers
Stars: ✭ 255 (+325%)
Mutual labels:  graphql, serverless
Autoserver
Create a full-featured REST/GraphQL API from a configuration file
Stars: ✭ 188 (+213.33%)
Mutual labels:  graphql, serverless
Firebase Gcp Examples
πŸ”₯ Firebase app architectures, languages, tools & some GCP things! React w Next.js, Svelte w Sapper, Cloud Functions, Cloud Run.
Stars: ✭ 470 (+683.33%)
Mutual labels:  graphql, serverless
Appsync Refarch Realtime
AWS AppSync Real-Time Reference Architecture
Stars: ✭ 153 (+155%)
Mutual labels:  graphql, serverless
Space Cloud
Open source Firebase + Heroku to develop, scale and secure serverless apps on Kubernetes
Stars: ✭ 3,323 (+5438.33%)
Mutual labels:  graphql, serverless
Conference App In A Box
Full stack & cross platform app customizable & themeable for any event or conference.
Stars: ✭ 693 (+1055%)
Mutual labels:  graphql, serverless
Serverless
This is intended to be a repo containing all of the official AWS Serverless architecture patterns built with CDK for developers to use. All patterns come in Typescript and Python with the exported CloudFormation also included.
Stars: ✭ 1,048 (+1646.67%)
Mutual labels:  graphql, serverless

GraphQL Serverless

This repository contains a set of GraphQL backend boilerplates. These are intended to be useful references for setting up a dead-simple GraphQL resolver that can be deployed on a serverless platform and interact with a database (Postgres).

Each boilerplate comprises of:

  1. A basic hello world setup
query {
  hello
}
  1. Query resolvers that fetch from the database
query {
  user {
    id
    name
    balance
  }
}
  1. A Mutation resolver that runs a transaction against the database
mutation {
  transferMoney (userFrom, userTo, amount) {
    result
  }
}

This repository is organised by the serverless platform and runtime which then breaks down into the GraphQL framework + ORM that is being used. For example, aws-nodejs/apollo-sequelize is a boilerplate for running a GraphQL API on AWS Lambda with Nodejs using the apollo-server framework and the sequelize ORM.

Getting Started

Get started with the following languages and serverless platforms:

Optional: Scaling database interactions for serverless

In theory, hosting a GraphQL backend on serverless is very useful because serverless gives us a scalable and no-ops platform to deploy "business logic" instantly,

However, serverless backends cannot hold state between different requests because they are destroyed and re-created for every single invocation. This means that our GraphQL backend will cause a database connection to be created and destroyed for every invoation and will result in increased latency and be expensive for the database. A database is optimised for handling upto a few 100 long-living connections, and not a few thousand short-living connections.

Connection pooling with pgBouncer

To make our GraphQL backend scale at the same rate as serverless invocations, we will use a standalone connection pooler like pgBouncer to proxy our connections to the database.

architecture

pgBouncer maintains a persistent connection pool with the database but allows applications to create a large number of connections which it proxies to Postgres. We will deploy pgBouncer on a free EC2 instance. We can use the CloudFormation template present in this repo: cloudformation.json to deploy a pgBouncer EC2 instance in few clicks.

Results

Using pgBouncer, here are typical results for corresponding rate of Lambda invocations. The tests were conducted with the addUser mutation using jmeter.

Error Rate -> Without pgBouncer With pgBouncer
100 req/s 86% 0%
1000 req/s 92% 4%
10000 req/s NA 3%

Note: The table above indicates the success (2xx) or failure (non-2xx) of requests when instantiated at X req/s and not the throughput of those requests.

Using with Hasura GraphQL Engine

You can use these boilerplates to create any kind of GraphQL API. Resolvers that interact with other microservices or with a database, we started putting together this repository you may wish to merge your schema with Hasura GraphQL Engine to augment your schema with high-performance CRUD and realtime GraphQL APIs.

Follow this guide to merge your schema with Hasura: using-with-hasura.md

CONTRIBUTING

We strongly encourage contributions of boilerplates in other languages, frameworks/ORM or serverless platforms. Please follow CONTRIBUTING.md for guidelines on contributing.

Check out some of the open issues which require community help.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].