Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rafalwilinski/edge-graphql-dynamodb-api
Serverless GraphQL API on Edge with Global DynamoDB Tables
https://github.com/rafalwilinski/edge-graphql-dynamodb-api
apollo apollo-server aws aws-cdk aws-lambda cdk dynamodb edge-computing graphql serverless
Last synced: 4 months ago
JSON representation
Serverless GraphQL API on Edge with Global DynamoDB Tables
- Host: GitHub
- URL: https://github.com/rafalwilinski/edge-graphql-dynamodb-api
- Owner: RafalWilinski
- Created: 2020-05-15T10:31:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T05:58:55.000Z (about 2 years ago)
- Last Synced: 2024-10-03T12:44:50.030Z (4 months ago)
- Topics: apollo, apollo-server, aws, aws-cdk, aws-lambda, cdk, dynamodb, edge-computing, graphql, serverless
- Language: TypeScript
- Homepage: https://rwilinski.me
- Size: 3.01 MB
- Stars: 30
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![Solution Diagram](./assets/overview.png)
- [Demo Playground](https://d1pc7a0vu5q5b3.cloudfront.net/playground)
- [Blogpost with full explanation](https://servicefull.cloud/blog/graphql-at-edge/)# Serverless GraphQL @ Edge + Global DynamoDB Tables
Why? Mostly for fun. I don't see too many practical use cases for such setup. Lambda@Edges aren't suitable for a lot of cases due to limited memory and CPU, so they are *slow*. If you need a globally available website with dynamic content, you should consider going with JAMStack served via CloudFront, Vercel or Cloudflare.
## Features
- Globally and highly available
- GraphQL Server at each of Edge locations using Lambda@Edge + CloudFront
- Globally replicated DynamoDB Tables
- GraphQL handlers routing to the closest DynamoDB table as persistence layer
- Pay-what-you-use model, no upfront or fixed charges, everything billed per-request
- Infra managed using AWS-CDK and Typescript
- Node functions packaged and minified automatically using Parcel, ([there's a small bug though](https://github.com/aws/aws-cdk/issues/8031))## Useful commands
* `npm run build` compile typescript to js
* `npm run deploy` deploy this stack to your default AWS account/region## Limitations
- Your server must be rather lightweight. Minified GraphQL Server code must be less than `1 MB`. Lambda@Edge is restricted to `128MB` of memory and `5000ms` of timeout for `VIEWER_REQUEST` integration type.
- Cannot use ENV variables
- Table name is hardcoded, gonna fix that
- Schema creation is laborious right nowLooking for cool DynamoDB editor? Check out [Dynobase](https://dynobase.dev)