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.
Upcoming SlideShare
Amazon Cognito + Lambda + S3 + IAM
Next

4

Share

Mobile on AWS

Mobile on AWS

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Mobile on AWS

  1. 1. AWS Cloud Kata for Start-Ups and Developers Hong Kong Mobile on AWS Markku Lepistö Principal Technology Evangelist @markkulepisto
  2. 2. How to build a mobile app today?
  3. 3. Authenticate users Authorize access Analyze User Behavior Store and share media Synchronize data Deliver media Store shared data Track Retention Stream real-time data Send push notifications Manage users and identity providers Securely access cloud resources Sync user prefs across devices Track active users, engagement Manage funnels, Campaign performances Store user-generated photos Media and share them Automatically detect mobile devices Deliver content quickly globally Bring users back to your app by sending messages reliably Store and query fast NoSQL data across users and devices Collect real-time clickstream logs and take actions quickly Your Mobile App
  4. 4. Amazon Cognito Amazon Mobile Analytics Amazon SNS Mobile Push Mobile Optimized Services Kinesis Connector DynamoDB Connector S3 Connector SQS Connector SES Connector Mobile Optimized Connectors Introducing AWS Mobile Services AWS Global Infrastructure (10 Regions, Availability Zones, 52 Edge Locations) Core Building Block Services Compute Storage Networking Analytics Databases Your Mobile App, Game or Device App AWS Mobile SDK, API Endpoints, Integrated SDK Management Console
  5. 5. Fully Integrated AWS Mobile SDK • Common authentication mechanism across all services • Automatically handle intermittent network connections • Cross-platform Support: Android, iOS, Fire OS • Native SDKs optimized for Mobile OS, for example, uses the local offline caching architecture • Reduced memory footprint; Pick and choose the service jars you need
  6. 6. Authenticate users Authorize access Analyze User Behavior Store and share media Synchronize data Deliver media Store shared data Track Retention Stream real-time data Send push notifications Manage users and identity providers Securely access cloud resources Sync user prefs across devices Track active users, engagement Manage funnels, Campaign performances Store user-generated photos Media and share them Automatically detect mobile devices Deliver content quickly globally Bring users back to your app by sending messages reliably Store and query fast NoSQL data across users and devices Collect real-time clickstream logs and take actions quickly Your Mobile App
  7. 7. Authenticate users Authorize access Analyze User Behavior Store and share media Synchronize data AWS Mobile SDK Amazon Mobile Analytics Deliver media Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity Broker) Amazon S3 Transfer Manager Amazon CloudFront (Device Detection) Store shared data Amazon DynamoDB (Object Mapper) Stream real-time data Amazon Kinesis (Recorder) Track Retention Amazon Mobile Analytics Send push notifications Amazon SNS Mobile Push Your Mobile App
  8. 8. Authenticate users: Amazon Cognito
  9. 9. Introducing Amazon Cognito Cross-device and Cross-platform Sync Securely access AWS services from Mobile device Simplifies Identity and Access Management Implement security best practices “Your App data is secure, available offline, and kept in sync between devices” Asynchronously sync user data across devices and platforms Manage unique identity for your user across identity providers Guest
  10. 10. Identity Providers Unique Joe Anna Bob Identities Any Device Any Platform Any AWS Service Helps implement security best practices Securely access any AWS Service from mobile device. It simplifies the interaction with AWS Identity and Access Management Support Multiple Login Providers Easily integrate with major login providers for authentication. Unique Users vs. Devices Manage unique identities. Automatically recognize unique user across devices and platforms. Amazon Cognito Identity Mobile Analytics S3 DynamoDB Kinesis
  11. 11. Amazon Cognito for Unauthenticated Identities Unique Identifier for Your “Things” “Headless” connected devices can also securely access cloud services. Save Data to the Cloud Save app and device data to the cloud and merge them after login Guest User Access Securely access AWS resources and leverage app features without the need to create an account or logging in Visitor Preferences Cognito Store Guest EC2 S3 DynamoDB Kinesis
  12. 12. Getting Started with Cognito in 3 steps Sign up for AWS Account and login to AWS Management Console Download and integrate the Mobile SDK and store and sync user data in a dataset Create identitypool for authenticated and unauthenticated users in the AWS Console
  13. 13. Amazon Cognito Security Architecture User ID (Temp Credentials) DynamoDB End Users Developer App w/SDK Access to AWS Services Cognito Identity Broker Login OAUTH/OpenID Access Token Cognito ID, Temp Credentials S3 Mobile Analytics Cognito Sync Store AWS Management Console Access Token Pool ID Role ARNs
  14. 14. Authorize access: Amazon Cognito + AWS IAM + Fine-grained access control
  15. 15. Amazon Cognito (Identity Broker) Identitypool Identity Providers Pool of identities that share the same trust policy Access Policy Access to AWS Services identitypool Unauthenticated Identities authenticated identities AWS IAM Roles AWS Account Web Identity Federation S3 DynamoDB Get Delete Put
  16. 16. Access Policy for the IAM Role { "Effect":"Allow", "Action":["s3:*"], "Resource":"*" } { "Effect": ”Deny", "Action": ["dynamodb:*"], "Resource": "*" } { "Effect": "Allow", "Action": [”cognito-sync:*"], "Resource": "*" } Allow Actions: All S3, Sync store Operations Resource: All resources within these services Deny Actions: All DDB Operations Resource: All resources
  17. 17. Access Policy Restriction { "Effect":"Allow", "Action":["s3:PutObject","s3:GetObject","s3:DeleteObject", "s3:ListMultipartUploadParts","s3:AbortMultipartUpload"], "Resource":"arn:aws:s3:::BUCKET_NAME/*" } { "Effect":"Allow", "Action":["s3:ListBucket","s3:ListBucketMultipartUploads"], "Resource":"arn:aws:s3:::BUCKET_NAME" } { "Effect": "Allow", "Action": ["dynamodb:GetItem", "dynamodb:Query", "dynamodb:PutItem"], "Resource" : [ "arn:aws:dynamodb:REGION:123456789:table/TABLE_NAME", "arn:aws:dynamodb:REGION:123456789:table/TABLE_NAME/ index/INDEX_NAME" ] } Allow Actions: Certain operations Resource: One bucket, table ..
  18. 18. Access Policy Restriction (Policy Variables) Allow Actions: All sync operations Resource: Only to that identity { "Effect": "Allow”, "Action": ["s3:GetObject”,"s3:PutObject”], "Resource": ["arn:aws:s3::: myBucket/amazon/snakegame/ ${cognito-identity.amazonaws.com:sub}"] } { "Effect":"Allow", "Action":"cognito-sync:*", "Resource":["arn:aws:cognito-sync:us-east-1: 123456789012:identitypool/ ${cognito-identity.amazonaws.com:aud}/identity/ ${cognito-identity.amazonaws.com:sub}/*"] } Allow Actions: S3 Get/Put operations Resource: Only to a specific part of bucket to that identity
  19. 19. Synchronize data across devices : Amazon Cognito (Sync)
  20. 20. What have customers told us about “Synchronized Profile” People have multiple devices and want to transition between devices. Implementing a user profile that syncs across devices, OS, apps is hard. It not only has to work when offline, but easy to integrate with existing apps.
  21. 21. Amazon Cognito Sync User Data Storage and Sync Any Platform iOS/Android/FireOS Store App Data, Preferences and State Save app and device data to the cloud and merge them after login Cross-device Cross-OS Sync Sync user data and preferences across devices with one line of code Work Offline Data always stored in local SQLite DB first. Works seamlessly when intermittent or no connectivity k/v data Identity pool
  22. 22. Amazon Cognito Sync Offline: The client SDK manages a local SQLite data store to allow the app to work even when connectivity is not available. Fast: The methods to read and write data only interact with the local SQLite database. Intelligent Sync: The sync method compares the local version of the data to the cloud sync store, pushes up deltas and pulls down new changes. Flexible Conflict resolution: The sync method first reads the changes then writes its local changes to the cloud sync store By default Cognito assumes that the last write wins. Developers can override and implement their own conflict resolution programmatically Local SQLite Cache
  23. 23. Amazon Cognito Sync Data Model AWS Account Identitypool Dataset Pool of identities that share the same trust policy Identity Identity Identity Dataset Dataset identitypool Unique identifier across devices, get cached on local devices as well as saved in the cloud 1:n 1:n 1:n Dataset synchronized across devices by simply calling dataset.synchronize() method Dataset Dataset Key/Value 1:n Key-value and sync count
  24. 24. Amazon Cognito Sync Data Model - Example AWS Account Identitypool Dataset Identity Identity Identity Dataset Dataset identitypool 1:n 1:n 1:n User preferences Developer has two apps: a game and a productivity app Game state Identitypool1 Productivity App Game App Dataset Dataset Key/Value 1:n
  25. 25. Integrating Cognito Sync functionality is dead simple Initialize the CredentialsProvider and CognitoClient Call synchronize on the dataset Create or open Dataset and Add Key Values provider = new CognitoCredentialsProvider(context, AWS_ACCOUNT_ID, COGNITO_POOL_ID, COGNITO_ROLE_UNAUTH, COGNITO_ROLE_AUTH); cognito = new DefaultCognitoSyncClient(context, COGNITO_POOL_ID, provider); dataset.synchronize(new SyncCallback(){..}); cognito.openOrCreateDataset(datasetName); dataset.put(key, value);
  26. 26. Integrating Cognito Sync functionality is dead simple Initialize the AWSCognitoSyncClient Call synchronize on the dataset Create or open Dataset and Add Key Values DataSet *dataset = [syncClient openOrCreateDataSet:@"myDataSet"]; NSString *value = [dataset readStringForKey:@"myKey"]; [dataset putString:@"my value" forKey:@"myKey"]; AWSCognitoSyncClient *syncClient = [[AWSCognitoSyncClient alloc] initWithConfiguration: configuration]; [dataset synchronize]; iOS
  27. 27. Analyze User Behavior Store and share media Deliver media Store shared data Track Retention Stream real-time data Send push notifications Track active users, engagement Manage funnels, Campaign performances Store user-generated photos Media and share them Automatically detect mobile devices Deliver content quickly globally Bring users back to your app by sending messages reliably Store and query fast NoSQL data across users and devices Collect real-time clickstream logs and take actions quickly Your Mobile App Authenticate users Authorize access Synchronize data Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity Broker)
  28. 28. Analyze User Behavior: Amazon Mobile Analytics
  29. 29. What Customers Told Us About “Mobile Analytics” Developers deeply value user analytics and consider it an integral part of their app development process. They want to monitor their most important metrics in a timely manner, and take action quickly. They would like to own their mobile data, just like they do with any other AWS service.
  30. 30. Amazon Mobile Analytics Scalable and Generous Free Tier Focus on metrics that matter. Usage reports available within 60 minutes of receiving data from an app Fast Scale to billions of events per day from millions of users. Own Your Data “Easily collect, visualize and understand your app usage data at scale” Data collected are not shared, aggregated, or reused
  31. 31. Getting Started with Mobile Analytics in 3 steps Sign up for AWS Account and create or use existing Cognito ID in the AWS Management Console View engagement and session activity reports in the AWS Management console within minutes Download and integrate the Mobile SDK with one line of code (Android/FireOS, iOS)
  32. 32. Key Business Metrics (with one line of code) 1. Monthly Active Users (MAU) 2. Daily Active Users (DAU) 3. New Users, 4. Daily Sessions, 5. Sticky Factor, 6. 1-Day Retention, 7. Avg. Revenue per DAU, 8. Daily Paying Users, 9. Avg. Paying DAU
  33. 33. Track Retention User retention is a key indicator to judge the outcome of a marketing campaign, new feature introduction, UX changes, app updates, etc. Mobile Analytics provide four charts to track daily or weekly rate of returning users, after first use of the app
  34. 34. Get behavioral insights into app specific actions that your users take Reports provide a view of how often custom events occur. You can add further context with Attributes and Metrics, to each custom event Examples Track the number of Likes/Shares, per article, in a news app Understand player abort rates per level, in a game Number of songs played, per user session, in a music app In-app item popularity in a shopping app Track Custom Events
  35. 35. Integrating Mobile Analytics is super simple Initialize the AmazonMobileAnalyticsClient. That’s it! Get Session Activity in the AWS Management Console. For Custom Events activity reports, add events. Add OnResume() and OnPause() analytics = new AmazonMobileAnalytics(provider, context, "SnakeGameAWS”); EventClient eventClient = analytics.getEventClient(); MobileAnalyticsEvent visitEvent = eventClient.createEvent("speedSet"); eventClient.recordEvent(visitEvent); analytics.getSessionClient().resumeSession(); analytics.getSessionClient().pauseSession(); Analytics.getEventClient().submitEvents();
  36. 36. Integrating Mobile Analytics is super simple Initialize the AmazonMobileAnalytics object. That’s it! Get Session Activity in the AWS Management Console. Submit the event. If we don't call submitEvents, events will automatically be submitted at periodic intervals. Create add Custom Events [eventClient submitEvents]; id<AWSMobileAnalyticsEventClient> eventClient = analytics.eventClient; id<AWSMobileAnalyticsEvent> level1Event = [eventClient createEventWithEventType:@"level1Complete"]; AWSMobileAnalytics* analytics = [AWSMobileAnalytics defaultAWSMobileAnalyticsWithIdentifier:@"someuniqueid"]; iOS
  37. 37. Store and share media Deliver media Store shared data Stream real-time data Send push notifications Store user-generated photos Media and share them Automatically detect mobile devices Deliver content quickly globally Bring users back to your app by sending messages reliably Store and query fast NoSQL data across users and devices Collect real-time clickstream logs and take actions quickly Your Mobile App Authenticate users Authorize access Analyze User Behavior Synchronize data Amazon Mobile Analytics Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity Broker) Track Retention Amazon Mobile Analytics
  38. 38. Store and share media: Amazon S3
  39. 39. Amazon S3 Connector: Transfer Manager S3 Connector Multipart upload media (photos, videos, audio) Fault tolerant download (e.g. assets) No backend required Automatic retries Pause, resume, cancel functions Optimized for native OS
  40. 40. // Creating the transfer manager self.transferManager = [S3TransferManager new]; self.transferManager.s3 = s3client; // Upload image [self.transferManager uploadFile:fileName bucket:bucketName key:objectName]; // Download image [self.transferManager downloadFile:fileName bucket:bucketName key:objectName]; // Pause, Resume, Cancel [self.transferManager pauseAllTransfers]; [self.transferManager resumeAllTransfers]; [self.transferManager cancelAllTransfers]; Amazon S3 Connector: Transfer Manager
  41. 41. Store shared data Stream real-time data Send push notifications Bring users back to your app by sending messages reliably Store and query fast NoSQL data across users and devices Collect real-time clickstream logs and take actions quickly Your Mobile App Authenticate users Authorize access Analyze User Behavior Synchronize data Amazon Mobile Analytics Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity Broker) Track Retention Amazon Mobile Analytics Store and share media Deliver media Amazon S3 Transfer Manager Amazon CloudFront (Device Detection)
  42. 42. Authenticate users Authorize access Analyze User Behavior Store and share media Synchronize data AWS Mobile SDK Amazon Mobile Analytics Deliver media Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity Broker) Amazon S3 Transfer Manager Amazon CloudFront (Device Detection) Store shared data Amazon DynamoDB (Object Mapper) Stream real-time data Amazon Kinesis (Recorder) Track Retention Amazon Mobile Analytics Send push notifications Amazon SNS Mobile Push Your Mobile App
  43. 43. Send Push Notifications: Amazon SNS Mobile Push
  44. 44. What Customers Told Us About “Push Notifications” Sending large-scale push notifications, cross-platform is still hard. Developers want to be able to reach their customers globally and across all devices.
  45. 45. Each platform works differently, and push gets even more complex as you scale to support millions of devices. Cloud App Platform Services Mobile Apps
  46. 46. Amazon SNS Cross-platform Mobile Push Internet Apple APNS Google GCM Amazon ADM Windows WNS and MPNS Baidu CP Industry’s First! New! With Amazon SNS, developers can send push notifications on multiple platforms and reach mobile users around the world New features: Message Expiry Time Message Attributes Amazon SNS Mobile Push Android Phones and Tablets Apple iPhones and iPads Kindle Fire Devices Android Phones and Tablets in China iOS Windows Desktop and Windows Phone Devices
  47. 47. Store shared data Stream real-time data Send push notifications Bring users back to your app by sending messages reliably Store and query fast NoSQL data across users and devices Collect real-time clickstream logs and take actions quickly Your Mobile App Authenticate users Authorize access Analyze User Behavior Synchronize data Amazon Mobile Analytics Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity Broker) Track Retention Amazon Mobile Analytics Store and share media Deliver media Amazon S3 Transfer Manager Amazon CloudFront (Device Detection)
  48. 48. Authenticate users Authorize access Analyze User Behavior Store and share media Synchronize data AWS Mobile SDK Amazon Mobile Analytics Deliver media Amazon Cognito (Sync) AWS Identity and Access Management Amazon Cognito (Identity Broker) Amazon S3 Transfer Manager Amazon CloudFront (Device Detection) Store shared data Amazon DynamoDB (Object Mapper) Stream real-time data Amazon Kinesis (Recorder) Track Retention Amazon Mobile Analytics Send push notifications Amazon SNS Mobile Push Your Mobile App
  49. 49. Summary
  50. 50. Key Takeaways Amazon Cognito Amazon Mobile Analytics Amazon SNS Mobile Push Kinesis Connector DynamoDB Connector S3 Connector SQS ConnectorSES Connector AWS Global Infrastructure (10 Regions, Availability Zones, 52 Edge Locations) Core Building Block Services Mobile Optimized Connectors Mobile Optimized Services Your Mobile App, Game or Device App AWS Mobile SDK, API Endpoints, Management Console Compute Storage Networking Analytics Databases Integrated SDK
  51. 51. Key Takeaways Amazon Cognito Amazon Mobile Analytics Amazon SNS Mobile Push Kinesis Connector DynamoDB Connector S3 Connector SQS ConnectorSES Connector AWS Global Infrastructure (10 Regions, Availability Zones, 51 Edge Locations) Core Building Block Services Mobile Optimized Connectors Mobile Optimized Services Your Mobile App, Game or Device App AWS Mobile SDK, API Endpoints, Management Console Compute Storage Networking Analytics Databases Integrated SDK Cross Platform and Optimized for Mobile Flexibility And Freedom of Choice Fully integrated and easy to get started
  52. 52. Amazon Cognito Amazon Mobile Analytics Amazon SNS Mobile Push Free Tier: 1 Million push messages every month Free Tier (for first 12 months): 1 Million syncs/month + 10GB of storage for Amazon Cognito Free Tier: 100 Million events every month Get Started for Free!
  53. 53. AWS Cloud Kata for Start-Ups and Developers Demo Cognito–Snake Game –Android SNS Mobile Push -iOS
  54. 54. AWS Cloud Kata for Start-Ups and Developers33% 29% 38% <$50 $50-$200 $200+ Amazon’s Large and Active Audience globally. Monthly Unique Visitors (US): 105MM 5.9 Active Global Customer Accounts: 209MM Avg. Daily Unique Visitors (US): 14.1MM Note: Active Customer Accounts are unique email addresses that have placed an order in the last 12 months Sources: 1. Amazon Investor Relations; 2. ComScore PlanMetrix January, 2013. 10% 38% 52% <$25K $25K-$75K $75K + 1 2 2 28% 32% 18% 42% 0-18 18-34 35-44 45+ Household Income of Amazon Unique Visitors2 Age Composition of Amazon Unique Visitors2 % of Amazon Shoppers Who have Made an Online Purchase2 Amount Spent Avg. Visits per Visitor per Month (US):
  55. 55. AWS Cloud Kata for Start-Ups and Developers The Amazon Appstore and Kindle Fire 1. Are driving world class monetization •Large active customer base with credit cards on file, 200 million globally and growing •Rapidly growing reach of the Amazon Appstore •Strong discovery enabled by personalization 2. Developing for Amazon Appstore is simple •The Amazon Appstore is Android •Both China and Global opportunities with one click upload •Standard 3:7 revenue share Over 75% of Android apps that we’ve tested on Kindle Fire work without any additional work required
  56. 56. AWS Cloud Kata for Start-Ups and Developers Marketing Promotion Opportunities
  57. 57. AWS Cloud Kata for Start-Ups and Developers SDKs Amazon Provide to Developers ReachEngageMonetizeTest and Manage In-App Purchasing Mobile Ads Mobile Associates A/B Testing Mobile Device Management Analytics Device Messaging Game Circle Login with Amazon
  58. 58. AWS Cloud Kata for Start-Ups and Developers Go Global StrategyUntil now Appstore helped 254 local developers and total 1054 apps go to global market in 2014. Voice from our partner -Don’t tap the white tail (别踩白块儿): “汇报一下我们现在的游戏情况: 日活跃用户:900万到1000万之间,日新增用户:100w到150w之间。目前客户端只有一个消息,并 且一天只向服务器请求一次,但请求峰值会到达每秒450个并发请求。这种一天一次的请求量是远 远不够的,我们以后会想做更频繁的网络请求,也有其他游戏会上线”
  59. 59. AWS Cloud Kata for Start-Ups and Developers 台北 6月25日
  60. 60. Let’s Build This System Dev Apple iPhone iOS SDK with XCode PHP Push Server App with web UI Elastic Beanstalk Container Notification Mac Amazon SNS Google AWS Cloud Android Notification
  61. 61. 1) Register Developer, Phone & App Identities with Apple Dev Apple iPhone Mac
  62. 62. 2) Load Client App on iPhone with XCode Dev iPhone iOS SDK with XCode Mac
  63. 63. 3) Register Phone Apps and Endpoints in SNS Dev iPhone Mac Amazon SNS AWS Cloud Android
  64. 64. 4) Deploy Push Server Application in Elastic Beanstalk Dev PHP Push Server App with web UI Elastic Beanstalk Container Mac AWS Cloud
  65. 65. 5) Server Discovers Registered SNS Phone Apps and Endpoints Dev Apple iPhone PHP Push Server App with web UI Elastic Beanstalk Container Mac Amazon SNS Google AWS Cloud Android
  66. 66. 6) Send Notifications from Server UI via Google & Apple Dev Apple iPhone PHP Push Server App with web UI Elastic Beanstalk Container Notification Mac Amazon SNS Google AWS Cloud Android Notification
  67. 67. Demo
  • lucgagnon

    Mar. 28, 2017
  • chingchuantan39

    Mar. 11, 2017
  • jpizarrom

    Jul. 5, 2015
  • johnsonjesurajan

    Oct. 14, 2014

Mobile on AWS

Views

Total views

1,151

On Slideshare

0

From embeds

0

Number of embeds

7

Actions

Downloads

0

Shares

0

Comments

0

Likes

4

×