O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

Simplify Your Front End Apps with Serverless Backend in the Cloud.

Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Carregando em…3
×

Confira estes a seguir

1 de 50 Anúncio

Simplify Your Front End Apps with Serverless Backend in the Cloud.

Customers are often looking at running their services at global scale, deploying applications to multiple regions. While it has traditionally been hard to do this, often requiring months of engineering work, serverless has changed the game!This hands-on talk will help you understand how to build two different versions of a multi-region, active-active serverless backend. Come learn the pros-and-cons of DNS routing versus IP Anycast, and see how you can leverage serverless services like Route 53, Global Accelerator, API Gateway, the Application Load Balancer, AWS Lambda and DynamoDB Global tables to build global scale, serverless applications.

Customers are often looking at running their services at global scale, deploying applications to multiple regions. While it has traditionally been hard to do this, often requiring months of engineering work, serverless has changed the game!This hands-on talk will help you understand how to build two different versions of a multi-region, active-active serverless backend. Come learn the pros-and-cons of DNS routing versus IP Anycast, and see how you can leverage serverless services like Route 53, Global Accelerator, API Gateway, the Application Load Balancer, AWS Lambda and DynamoDB Global tables to build global scale, serverless applications.

Anúncio
Anúncio

Mais Conteúdo rRelacionado

Diapositivos para si (18)

Semelhante a Simplify Your Front End Apps with Serverless Backend in the Cloud. (20)

Anúncio

Mais de Amazon Web Services (20)

Simplify Your Front End Apps with Serverless Backend in the Cloud.

  1. 1. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Simplify your frontend apps with serverless backend in the cloud Sébastien Stormacq, Developer Advocate { "name": "Sébastien Stormacq", "role": "Developer Advocate", "company": "Amazon Web Services”, "twitter": "@sebsto”, “github” : "sebsto" }
  2. 2. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. A typicalday in developer life
  3. 3. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. We need an app to let our customers update preference settings – our competitors just launched the same thing, so I need it fast. I don’t want to pay a lot for it, especially when no one is using it. But remember that we’re growing, so make sure it scales great and is easy to manage and operate. And you’re on your own – sorry! A typicalday in developer life
  4. 4. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. We need an app to let our customers update preference settings – our competitors just launched the same thing, so I need it fast. I don’t want to pay a lot for it, especially when no one is using it. But remember that we’re growing, so make sure it scales great and is easy to manage and operate. And you’re on your own – sorry! A typicalday in developer life No problem, I will use a cloud-based & serverless backend.
  5. 5. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved.
  6. 6. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Serverless means
  7. 7. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Serverless means No Server to Provision or Manage Scale with Usage Availability and Fault Tolerance Built-in Pay for value
  8. 8. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Serverless acrossthestack Database AccessCompute Developer Workflow
  9. 9. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Whatobstaclesdevelopersarefacing?
  10. 10. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. 165+services TECHNICAL & BUSINESS SUPPORT Support Professional Services Optimization Guidance Partner Ecosystem Training & Certification Solutions Management Account Management Security & Billing Reports Personalized Dashboard MARKETPLACE Business Apps Business Intelligence DevOps Tools Security Networking StorageDatabases IoT Rules Engine Device Shadows Device SDKs Device Gateway Registry Local Compute MIGRATION Schema Conversion Exabyte-Scale Data Migration Application Migration Database Migration Server Migration HYBRID Integrated Networking Data Integration Integrated Identity & Access Integrated Resource & Deployment Management Integrated Devices & Edge Systems ML / IA Custom Model Training & Hosting Conversational Chatbots Image & Scene Recognition Facial Recognition & Analysis Deep Learning (Apache MXNet, TensorFlow, & others) Text to Speech Facial Search ENTERPRISE Virtual Desktops App Streaming Sharing & Collaboration Corporate Email Communications Contact Center MOBILE API Gateway Single Integrated Console Identity Sync Mobile Analytics Mobile App Testing Targeted Push Notifications DEV/OPS One-click App Deployment DevOps Resource Management Application Lifecycle Management Containers Triggers Resource Templates Build and Test Analyze and Debug Patching ANALYTICS Data Warehousing Business Intelligence Elasticsearch Hadoop/Spark Data Pipelines Streaming Data Collection ETL Streaming Data Analysis Interactive SQL Queries APP SERVICES Queuing & Notifications Workflow Email Transcoding Search INFRA Regions Availability Zones Points of Presence CORE SERVICES Compute VMs, Auto-scaling, Load Balancing, Containers, Virtual Private Servers, Batch Computing, Cloud Functions, Elastic GPUs, Edge Computing Storage Object, Blocks, File, Archivals, Import/Export, Exabyte-scale data transfer CDN Databases Relational, NoSQL, Caching, Migration, PostgreSQL compatible Networking VPC, DX, DNS SECURITY & COMPLIANCE Identity Management Key Management & Storage Monitoring & Logs Configuration Compliance Web Application Firewall Assessment & Reporting Resource & Usage Auditing Access Control Account Grouping DDOS Protection MANAGEMENT TOOLS Monitoring Manage Resources Resource Templates Configuration Tracking Server Management Service Catalogue
  11. 11. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Manylinesof boiler platecode
  12. 12. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. IntroducingAWSAmplify
  13. 13. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Amplify– aCLIto ProvisionServices $ amplify add auth $ amplify add storage $ amplify add api $ amplify push Add an Amazon Cognito User Pool Create and secure an Amazon S3 bucket Add an AWSAppSync or API Gateway Deploy via AWS CloudFormation
  14. 14. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Amplify–ASet ofOpen-SourceLibraries
  15. 15. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Let’senricha React webapp
  16. 16. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Initialiseamplify $ amplify init $ amplify push
  17. 17. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. #1 Addauthentication
  18. 18. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Provision theservice $ amplify add auth $ amplify push
  19. 19. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. ModifyourApp import Amplify from 'aws-amplify’; import { withAuthenticator } from 'aws-amplify-react’; // 'aws-amplify-react-native'; import awsmobile from './aws-exports’; Amplify.configure(awsmobile); … export default withAuthenticator(App);
  20. 20. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Demo
  21. 21. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. $amplifyadd auth&& amplifypush AWS Cloud Clients AWS Cognito User Pool Accounts Multi Factor Authentication Signup & Signin
  22. 22. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. #2 AddanAPI
  23. 23. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. https://2018.stateofjs.com/data-layer/overview
  24. 24. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. query GetNote { getNote(id: ”1”) { id value } } mutation CreateNote { createNote(value: “My first note”) { id value } } subscription OnCreateNote { onCreateNote { id value } } GraphQL,a query languageforAPIs type Note { id: ID! value: String! }
  25. 25. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. AppSync, a runtimeto execute the query query GetPost { getPosts(id: ”1”) { id title comments { content } author { name } } } query GetPost { getPosts(id: ”1”) { id title comments { content } author { name } } } Amazon EC2 { "data" : { "posts" : [ { "id" : 1, "title" : "Introduction to GraphQL", "comments" : [ { "content" : "I want GraphQL for my next App!" } ], "author" : { "name" : "Sébastien Stormacq" } } ] } } Amazon DynamoDB AWS Lambda
  26. 26. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Provision theAPI $ amplify add api $ amplify push
  27. 27. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. $amplifyadd api $ amplify add api ? Please select from one of the below mentioned services GraphQL ? Provide API name: amplifynotes ? Choose an authorization type for the API Amazon Cognito User Pool Using service: Cognito, provided by: awscloudformation The current configured provider is Amazon Cognito. ? Do you want to use the default authentication and security configuration? Yes, use the default configuration. Successfully added auth resource ? Do you have an annotated GraphQL schema? No ? Do you want a guided schema creation? true ? What best describes your project: Objects with fine-grained access control (e.g., a project management app with owner-based authorization) ? Do you want to edit the schema now? Yes Please edit the file in your editor: /<path>/amplify/backend/api/amplifynotes/schema.graphql ? Press enter to continue
  28. 28. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. A basicschema type Note { id: ID! note: String! }
  29. 29. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Transformers(akaannotations) type Note @model @auth(rules: [{allow: owner}]){ id: ID! note: String! }
  30. 30. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Demo
  31. 31. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. $amplifyadd api&@model AWS Cloud Clients AWS AppSync Amazon DynamoDB Table Schemas Resolvers Data Sources type Query { getNote(...): Note listNotes(...): Note } type Mutation { createNote(...): Note updateNote(...): Note deleteNote(...): Note } type Subscription { onCreateNote (...): Note onUpdateNote (...): Note onDeleteNotet(...): Note } type Note { id: ID! value: String } queries mutations getNote listNotes updateNote deleteNote createNote Note Table Datasource IAM Role ARN Note Role ARN
  32. 32. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. #3 addsearchcapabilities
  33. 33. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. UpdateGraphQLTransformer type Note @model @auth(rules: [{allow: owner}]) @searchable { id: ID! note: String! }
  34. 34. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Provision theservice $ amplify push
  35. 35. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Demo
  36. 36. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. @searchable AWS Cloud Clients AWS AppSync Amazon DynamoDB Table Schemas Resolvers Data Sources queries mutations getNote listNotes updateNote deleteNote createNote Note Table Datasource IAM Role ARN Note Role ARN type Query { getNote(...): Note listNotes(...): Note } type Mutation { createNote(...): Note updateNote(...): Note deleteNote(...): Note } type Subscription { onCreateNote (...): Note onUpdateNote (...): Note onDeleteNotet(...): Note } type Note { id: ID! value: String }
  37. 37. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. @searchable AWS Cloud Clients AWS AppSync Document Index Amazon ElasticSearch Schemas Resolvers Data Sources type Query { getNote(...): Note listNotes(...): Note searchNotes(...): [Note] } type Mutation { createNote(...): Note updateNote(...): Note deleteNote(...): Note } type Subscription { onCreateNote (...): Note onUpdateNote (...): Note onDeleteNotet(...): Note } type Note { id: ID! value: String } queries mutations getNote listNotes updateNote deleteNote createNote ElasticSearch Datasource IAM Role ARN ES Domain ARN Streaming Lambda Note Table Datasource IAM Role ARN Note Role ARN searchNotes Amazon DynamoDB Table
  38. 38. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. #4 deploytheapp
  39. 39. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Provision theservice $ amplify add hosting $ amplify publish
  40. 40. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. amplifyaddhosting $ amplify add hosting ? Select the environment setup: DEV (S3 only with HTTP) ? hosting bucket name my_hosting_bucket ? index doc for the website index.html ? error doc for the website index.html
  41. 41. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Demo
  42. 42. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. amplifypublish (dev) AWS Cloud Clients Amazon Cloudfront Amazon S3 Bucket serving static web content Edge Locations
  43. 43. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. amplifypublish (prod) AWS Cloud Clients Amazon Cloudfront Amazon S3 Bucket serving static web content Edge Locations
  44. 44. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. AdvancedTopics
  45. 45. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Amplifyblack belt tips ฀ $ amplify checkout ENV $ amplify add ENV
  46. 46. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Amplifyblack belt tips ฀
  47. 47. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Amplifyblack belt tips ฀
  48. 48. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. Whatdid wejustdo ? We created a front end web app backed by cloud services • User Sign-in, Sign-up (Amazon Cognito) • CRUD GraphQL API (AWS AppSync + Amazon DynamoDB) • Search API (Amazon ElasticSearch) • Hosting (Amazon S3, Amazon CloudFront) https://github.com/sebsto/amplify-react-workshop
  49. 49. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. TakeAway
  50. 50. © 2019, AmazonWeb Services, Inc. or itsaffiliates. All rightsreserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you Sébastien Stormacq, Developer Advocate { "name": "Sébastien Stormacq", "role": "Developer Advocate", "company": "Amazon Web Services”, "twitter": "@sebsto”, “github” : "sebsto" }

×