Pragmatic Real-Time API design and DevOps with AWS Amplify
In this presentation, I will discuss about the challenges that modern-day developers face and how to overcome them using real-time API design and DevOps.
rights reserved. About Me Twitter @mjmrz YouTube https://www.youtube.com/c/cloudtutorials Website https://thecloudtutorials.com Cloud trainer on YouTube Blogger Tech Lead at 99X Technology, Sri Lanka CTO at Whatif AS, Norway
rights reserved. Did you know? Delay User Reaction 0 - 100ms Instant J 100 – 300ms Feel sluggish K 300 – 1000ms Machine is working… K 1s+ Mental context switch L 10s+ I’ll come back later… L
rights reserved. Developer Challenges Data requirements vary across devices and become harder when multiple users share data Users want instant access to data Users want to continue using their apps even with low or no connectivity Building scalable data- driven apps without learning distributed systems concepts is hard
rights reserved. What is GraphQL? • Open declarative data-fetching specification • Resources defined by the GraphQL schema • Client sends the query, the server orchestrates data • Multiple transport support (HTTP, MQTT over WebSocket) • Efficient (Network bandwidth) • Self documenting
rights reserved. Schema type Query { listAlbums: [Albums] } type Mutation { createAlbum(input: CreateAlbumInput!): Album } type Subscription { onCreateAlbum: Album @aws_subscribe(mutations: ["createAlbum"]) } type Album { id: ID! title: String pictures: [Picture] } type Picture { id: ID! file: S3Object }
rights reserved. Developer Challenges Data requirements vary across devices and become harder when multiple users share data Users want instant access to data Users want to continue using their apps even with low or no connectivity Building scalable data- driven apps without learning distributed systems concepts is hard
rights reserved. What is AWS AppSync? • Managed GraphQL service with real-time capabilities and offline programming model • Enterprise level security • Connect to resources in your AWS account • Served your data in real-time or offline • Automatic conflict resolution in the cloud
rights reserved. Amplify CLI • Create/Update/Delete cloud resources • Generate client side code to communicate with AppSync API • Manage multiple cloud environments • Provide powerful GraphQL schema transformations
rights reserved. Amplify Client Libraries AWS AppSync SDK • Integrates with Apollo client • Works with queries, mutations, and subscriptions • Built in offline support • Supports offline helpers for GraphQL operations Amplify GraphQL Client • Light-weight Client • Works with queries, mutations and subscriptions • Does NOT support offline
rights reserved. Pricing Example (all numbers per month) • Chat application with 2,500 users • Average user connects for 1,500 minutes • Sends 1,000 and Receives 1,000 messages • 2.5M queries and 2.5M real-time updates AppSync Query 2.5M x $4/million = $10.00 AppSync Real-time 2.5M x $2/million = $5.00 AppSync Minutes 2,500 x 1,500 x $0.08/million = $0.30 Data Transfer 1KB x 2.5M = 2.4GB x $0.09 = $0.21 DynamoDB Database Free Tier (as long as store < 25Gb) Total $15.51