Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

0

Compartir

Descargar para leer sin conexión

API moderne e real-time per applicazioni innovative

Descargar para leer sin conexión

Con l’ascesa delle architetture di microservizi e delle ricche applicazioni mobili e Web, le API sono più importanti che mai per offrire agli utenti finali una user experience eccezionale. In questa sessione impareremo come affrontare le moderne sfide di progettazione delle API con GraphQL, un runtime query language open source utilizzato da Facebook, Amazon e altri.
Approfondiremo diversi scenari, fra cui autorizzazione degli utenti, caching, sorgenti dati differenti, comprendendo come AppSync può aiutare a risolvere questi casi d’uso creando API moderne con funzionalità in tempo reale e offline.
Inoltre, impareremo come alcuni clienti nel settore dei media utilizzano AWS AppSync per fornire dati in tempo reale alla propria applicazione mobile e Web.

  • Sé el primero en recomendar esto

API moderne e real-time per applicazioni innovative

  1. 1. Stefano Sandrini Sr EMEA Specialist SA, AWS Mobile @electricste API Modernization with GraphQL Advanced use cases
  2. 2. Prerequisites GraphQL Fundamentals AWS Fundamentals & AppSync fundamentals API Concepts Fundamentals
  3. 3. Agenda Modernization Modernization with GraphQL & AWS AppSync Use cases Customizations Operating at scale
  4. 4. Agenda. Use Cases, Customizations, Operation Complex business logic VS Complex resolvers Authorization Offline and Caching Conflict resolution, delta sync, API Cache vs Resolver Cache Plug in any data source… for offline and real-time ! Multiple auth method, users vs systems, auth for real-time use cases
  5. 5. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. https://commons.wikimedia.org/wiki/File:Blue_Origins_New_Glenn_Launch_(29350547990).png
  6. 6. Why modernization? Build efficient APIs Build reusable and scalable APIs Engage with customers Deliver the right data at the right time Develop applications faster
  7. 7. Today, customers are building: Universal APIs Enterprise data Apps connect to many data sources Real-time apps Chat functionality Fan engagement Location-aware notifications Mobile-first apps Consumer IoT/connected Field service Offline support
  8. 8. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  9. 9. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. GraphQL, the GraphQL logo and any related marks are trademarks of Facebook, Inc.
  10. 10. AWS AppSync Conflict detection and resolution in the cloud GraphQL facade for any AWS service Enterprise security features: IAM, Amazon Cognito, OIDC, API keys Managed serverless GraphQL service Add data sync, real-time, and offline capabilities for any data source or API Connect to data sources in your account
  11. 11. AWS AppSync Amazon DynamoDB Amazon Aurora Amazon Elasticsearch Service (Amazon ES) AWS Lambda HTTP query sync { syncPosts { items { id } } } Query language for APIs Runtime for fulfilling those queries GraphQL, the GraphQL logo and any related marks are trademarks of Facebook, Inc. Local (publish/subscribe) Your existing data
  12. 12. AWS AppSync Amazon DynamoDB Amazon Aurora Amazon Elasticsearch Service (Amazon ES) AWS Lambda HTTP query sync { syncPosts { items { id } } } Query language for APIs Runtime for fulfilling those queries GraphQL, the GraphQL logo and any related marks are trademarks of Facebook, Inc. Local (publish/subscribe) Your existing data
  13. 13. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  14. 14. Sometimes…
  15. 15. Sometimes… !?!??!!?!?!?!!
  16. 16. Direct Lambda resolver AWS AppSync AWS Lambda
  17. 17. Direct Lambda resolver AWS AppSync AWS Lambda Optional
  18. 18. Direct Lambda resolver AWS AppSync AWS Lambda Optional Info Object
  19. 19. Direct Lambda resolver AWS AppSync AWS Lambda Optional Info Object
  20. 20. Direct Lambda resolver AWS AppSync AWS Lambda Optional Info Object
  21. 21. Direct Lambda resolver AWS AppSync AWS Lambda Optional Info Object
  22. 22. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  23. 23. Multi-auth • Authorization on • Type • Operation • Field • Default auth mode • Additional providers AWS AppSync AWS Cloud Data sources
  24. 24. Security Identity and Access Management
  25. 25. Multi-auth type Flight @aws_api_key @aws_cognito_user_pools (cognito_groups: [”FrequentFlyers"]) @aws_iam { id: ID! @aws_api_key @aws_iam departureDate: String! departureAirportCode: String! @aws_api_key departureAirportName: String! @aws_api_key departureCity: String! departureLocale: String! arrivalDate: String! arrivalAirportCode: String! @aws_iam arrivalAirportName: String! @aws_iam arrivalCity: String! @aws_iam arrivalLocale: String! @aws_iam ticketPrice: Int! ticketCurrency: String! flightNumber: Int! seatAllocation: Int seatCapacity: Int! }
  26. 26. AWS AppSync – authorization modes Sign in with OIDC idP Use JSON web tokens (JWTs) When to use Existing user directory Authenticating users in app Not interacting with other AWS services OpenID Connect Granular access control based on claims #set( $userGroups = ctx.identity.claims.get("oidc:groups”)) #set( $allowedGroups = ["Bloggers", "Readers"] ) #foreach( $userGroup in $userGroups ) #if( $allowedGroups.contains($userGroup) ) #set( $isStaticGroupAuthorized = true ) #break #end #end #if( !($isStaticGroupAuthorized == true ) ) $util.unauthorized() #end
  27. 27. AppSync – authorization modes Backend systems AWS credentials IoT systems When to use Amazon EC2 instances AWS Lambda functions AWS Identity and Access Management (IAM) { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": ["appsync:GraphQL"], "Resource": [ "arn:*:apis/GraphQLApiId/types/Query/fields/<field>", "arn:*:apis/GraphQLApiId/types/Mutation/fields/<field>", "arn:*:apis/GraphQLApiId/types/Post/fields/<field>" ] }] }
  28. 28. Multi-auth type Mutation { createFlight(input: CreateFlightInput!, condition: ModelFlightConditionInput): Flight @aws_iam } type Subscription { onCreateFlight: Flight @aws_subscribe(mutations: ["createFlight"]) @aws_iam }
  29. 29. Multi-auth for real-time: Chat application Get signature for signed URL based on identity getSignedPolicy Secrets Manager Conversations User conversations Messages DynamoDBB Stream readCountUpdater uploadHandler putObject event Update message with attachment/thumbnail Update user conversation’s read count Media Bucket Distribution Download Upload chatAPI postConfirmTrigger UserPool Users
  30. 30. Multi-auth for real-time Subscription Resolver
  31. 31. Amazon DynamoDB Real-time GraphQL subscriptions AWS AppSync AppSync data sources Secure WebSocket channel Secure WebSocket channel Secure WebSocket channel Secure WebSocket channel Secure WebSocket channel Secure WebSocket channel
  32. 32. Amazon DynamoDB Real-time GraphQL subscriptions AWS AppSync AppSync data sources Secure WebSocket channel Secure WebSocket channel Secure WebSocket channel Secure WebSocket channel Secure WebSocket channel Secure WebSocket channel
  33. 33. Real-time GraphQL subscriptions AWS AppSync AppSync data sources Amazon DynamoDB
  34. 34. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  35. 35. Amazon DynamoDB (User Profiles) Amazon API Gateway (Order Service) AWS Lambda (Inventory Service) API Consumers (Front-end Clients or other Backend Services) Amazon Aurora (Pricing)
  36. 36. Cache Full API Caching Per Resolver Caching Encryption
  37. 37. AppSync Cache • Managed server-side caching • Full API Caching • Per Resolver Caching • Encryption
  38. 38. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  39. 39. Amplify DataStore: developer experience Model app data and relationships (locally or in admin UI) Set up authentication and authorization Work with app data using an “offline-first” programming model—receive updates to shared data in real-time
  40. 40. Closer look at the DataStore API ?
  41. 41. Define: DataStore-compliant API Supports a Sync operation for all models Supports a subscription operation for all models May Support create/update/delete operations for some models Selection sets specify mandatory fields for each model id _lastChangedAt _version _deleted When it exists, selection sets specify mandatory fields of a parent model Id _deleted (as a minimum)
  42. 42. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  43. 43. Private subnet Plug in any data source with AWS Lambda AWS Lambda Service VPC VPC AWS Cloud Security group
  44. 44. Thank you! © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Stefano Sandrini Sr EMEA Specialist SA, AWS Mobile @electricste

Con l’ascesa delle architetture di microservizi e delle ricche applicazioni mobili e Web, le API sono più importanti che mai per offrire agli utenti finali una user experience eccezionale. In questa sessione impareremo come affrontare le moderne sfide di progettazione delle API con GraphQL, un runtime query language open source utilizzato da Facebook, Amazon e altri. Approfondiremo diversi scenari, fra cui autorizzazione degli utenti, caching, sorgenti dati differenti, comprendendo come AppSync può aiutare a risolvere questi casi d’uso creando API moderne con funzionalità in tempo reale e offline. Inoltre, impareremo come alcuni clienti nel settore dei media utilizzano AWS AppSync per fornire dati in tempo reale alla propria applicazione mobile e Web.

Vistas

Total de vistas

76

En Slideshare

0

De embebidos

0

Número de embebidos

0

Acciones

Descargas

1

Compartidos

0

Comentarios

0

Me gusta

0

×