Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Serverless meets GraphQL

Creating a GraphQL endpoint in 60 minutes or less.
Assaf Gannon, Javascript Architect, from Tikal.
In this talk, we will address 2 of the most interesting topics in recent times - serverless and GraphQL. We will go over the requirements and key tools required to get started with both. We will demonstrate how simple it is to create a GraphQL endpoint and deploy it using Serverless services.
Was originally presented at https://www.meetup.com/Fullstack-Developers-Silicon-Valley/events/250007589/

Serverless meets GraphQL

  1. 1. Serverless meets GraphQL Creating a Serverless GraphQL endpoint in 60 minutes or less
  2. 2. Who am I? Assaf Gannon Full Stack Developer since 2000 Work @ Tikal assaf@tikalk.com https://github.com/assafg/graphql-shopping-cart
  3. 3. Engineers Love Building stuff…
  4. 4. What is Serverless? BaaS PaaS+
  5. 5. What is Serverless? BL BL BL DB Auth PubSub Queue Cache Logs API Storage
  6. 6. Serverless Architecture at Nordstrom
  7. 7. What is Serverless? Small pieces of Business Logic deployed independently Using Services for non-Business Logic stuff: Persistance (DB / Cache / Static) Messaging Authentication / Authorization Logging / Monitoring
  8. 8. What are the Pros Seamless horizontal scaling Fast and cheap ramp up Pay as you go High-end tech widely available
  9. 9. What’s the catch? Vendor lock-in Different development and Architecture paradigms On-premise solutions can be difficult to set up and maintain (see ‘Vendor Lock-in’)
  10. 10. Popular Vendors AWS GCP Azure Kubless
  11. 11. Our Project: GraphQL Endpoint for a Shopping-Cart Using AWS
  12. 12. Some Architecture
  13. 13. GraphQL Endpoint API Gateway DynamoDB
  14. 14. GraphQL Query language for APIs Typed Access multiple resources in single query Get only what you need Play: https://launchpad.graphql.com/new
  15. 15. DynamoDB NoSQL DB Service by AWS Fast, Flexible & Scalable Document & key-value support
  16. 16. Lambda AWS Functions Service Deploy your code as a function Highly scalable Multiple languages supported
  17. 17. Auth0 Commercial Authentication service Easy to integrate Supports most SSO providers
  18. 18. serverless.com A toolkit for developing & deploying server less architecture Supports: AWS, Google Cloud Platform, Azure, OpenWhisk
  19. 19. Apollo A set of frameworks to make GraphQL more accessible Apollo Server Apollo Client Apollo Engine https://www.apollographql.com
  20. 20. “Audentes fortuna iuvat”
 - Virgil
  21. 21. Ingredients 2 Lambda functions (GraphQL Query & Mutate) 1 DynamoDB store Auth0 authentication
  22. 22. Getting started: 1. Install serverless CLI 
 (https://serverless.com/framework/docs/getting-started/) 2. Make sure AWS credentials are in place 3. Choose you language (Javascript, Java, Python, Go, C# are supported) 4. Create a new Service via ‘serverless create`
  23. 23. Now what?! 1. Deploy your empty service 2. Add your functions and resources to serverless.yml 3. Start implementing your functions
  24. 24. 1.Deploy your empty service
  25. 25. 2. Add your functions and resources to serverless.yml
  26. 26. 3. Start implementing your functions
  27. 27. > sls deploy:
  28. 28. The GraphQL implementation
  29. 29. Adding a DB Let’s make this interesting…
  30. 30. Enter Event Sourcing
  31. 31. Osiris https://github.com/assafg/osiris
  32. 32. Add DynamoDB resources
  33. 33. x 2 Mutations Query
  34. 34. Adding Auth0
  35. 35. - serverless.yml -

×