Giter VIP home page Giter VIP logo

gqlgen-lambda's Introduction

gqlgen-lambda

This is a prototype project demonstrating that a performant, zero-cost Graphql layer is possible with AWS Lambda functions.

The lambda function is uses Golang and GqlGen. It uses Gin to serve the requests, and aws-lambda-go-api-proxy to proxy the request from API Gateway to Gin. The Graphql function is written in such a way that you can easily convert the code to a microservice with little to no effort.

Pros

  • You get the ease of writing and deploying a lambda function. (Sam CLI, Serverless Framework, Apex Up, etc.)
  • Can easily convert the lambda function to a standalone service, and can convert existing services to lambda easily
  • Can easily test the endpoint with the playground endpoint offered by GqlGen
  • You can utilize the benefits of API Gateway, such as rate limiting, throttling, Authorization, etc.
  • Performant, since written in Golang
  • Tiny cold start time
  • Most of all, since AWS has a generous free tier for Lambda, in most cases you should be able to have a Graphql endpoint for free

Cons

  • No way to do subscriptions
  • and ... that's it? ๐Ÿค”

Why not AppSync?

AppSync is great for bootstrapping and fast development and in most cases, AppSync would be enough. It has plenty of features like:

  • it integrates nicely with Amplify and can easily generate client code given an AppSync endpoint
  • provides plenty of sample templates for multiple data sources
  • provides authorization, such as integration with Cognito
  • multiple convenient scalar types
  • integration with X Ray
  • Graphql generation wizard

and lots more

However, it is difficult to some things, like:

  • debug AppSync resolvers
  • connect to data sources not supported by AppSync (must make HTTP calls)
  • do complex business logic
  • do unit tests
  • logging

AppSync also pretty much forces you to lock in from day one, and you can't really re-use any of the VTL templates. However, we can easily repurpose this project to a microservice. With AppSync, you don't get a full fledged language and all of its benefits, such as robust libraries, concurrency, etc.

gqlgen-lambda's People

Contributors

spachava753 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

leandrostoroli

gqlgen-lambda's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.