Successfully reported this slideshow.
Your SlideShare is downloading. ×

Build high performing mobile apps, faster with AWS

Loading in …3

Check these out next

1 of 50 Ad

More Related Content

Slideshows for you (20)

Viewers also liked (18)


Similar to Build high performing mobile apps, faster with AWS (20)


Recently uploaded (20)

Build high performing mobile apps, faster with AWS

  1. 1. ©2015,  Amazon  Web  Services,  Inc.  or  its  affiliates.   All  rights  reserved Shiva  N Solutions  Architect Build  High  Performing  Mobile  Apps,  Faster  with  AWS
  2. 2. What  Our  Mobile  Customers  Have  Told  Us Problems  developers   face  today Fragmentation   across  platforms Sync  scalability   is  extremely  hard Expensive   to  manage  and  operate Distracts  them  from  building   core  UX Managing   unique  user  identities   is  difficult “Table  stakes”  for  every  app Undifferentiated  Heavy  Lifting Developer’s  Mobile  App  Code User  Identity  Mgmt.  and  Auth User  Data  Synchronization Asynchronous  Communication Active  Devices  Analytics User  Behavior  Analytics Engagement  Analytics Push  Notifications Event  Triggers Platform  agnostic  Mobile  Backend Data  Validation  and  Transformation File  and  Media  Storage Shared  Database  Storage Data  Collection   And  More…. AWS  Cloud  Infrastructure
  3. 3. What  Our  Mobile  Customers  Have  Told  Us Developer’s  Mobile  App  Code User  Identity  Mgmt.  and  Auth User  Data  Synchronization Asynchronous  Communication Active  Devices  Analytics User  Behavior  Analytics Engagement  Analytics Push  Notifications Event  Triggers Platform  agnostic  Mobile  Backend Data  Validation  and  Transformation File  and  Media  Storage Shared  Database  Storage Data  Collection   And  More…. AWS  Cloud  Infrastructure Amazon  Cognito Amazon  Mobile  Analytics Amazon  SNS  Mobile  Push Amazon  Lambda Mobile-­optimized   Connectors (Kinesis,  S3,  DynamoDB,  SQS)
  4. 4. Amazon  Cognito Amazon  Mobile  Analytics Amazon  SNS  Mobile  Push Kinesis  RecorderDynamoDB  Mapper S3  Transfer  Mgr SQS  Client SES  Client AWS  Global  Infrastructure  (Regions,  Availability  Zones,  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 AWS  Mobile  Stack AWS  Lambda Lambda   Functions λ λ λ λ
  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 • Continuously  updated  with  latest  platform   enhancements iOS Android JavaScript Unity Xamarin Download   the  latest   versions  of  the  SDKs
  6. 6. Authenticate   users Integrated  access Collect  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  data  in  the  cloud Amazon  DynamoDB (Object  Mapper) Stream  real-­time  data Amazon  Kinesis (Recorder) Call  server  side  logic AWS   Lambda Send  push  notifications Amazon  SNS   Mobile  Push Your   Mobile   App
  7. 7. Authenticate  Users:  Amazon  Cognito
  8. 8. Amazon  Cognito   Simplifies  Identity  and   Access  Management Securely  access  all   AWS  services  from   mobile  device Cross-­device  and   cross-­platform  sync Implement  security  best   practices “Your  app  data  is  secure,  available   offline,  and  kept  in  sync  between  devices” Synchronize  user’s  data   across  devices  and   platforms Manage  users  as   unique  identities  across   identity  providers Or,  Your  Own   Auth
  9. 9. Identity   Providers Unique IdentitiesJoe Anna Bob Any  Device Any  Platform Any  AWS   Service Helps  implement  security  best   practices Securely  access  any  AWS  service  from  mobile   device.  Simplified  interaction  with  AWS  Identity   and  Access  Management. Support  Multiple  Log-­In  Providers Easily  integrate  with  major  log-­in  providers  for   authentication. Unique  Users  vs.  Devices Manage  unique  identities.  Automatically   recognize  unique  user  across  devices  and   platforms. Amazon  Cognito  Identity Amazon Mobile Analytics Amazon S3 Amazon DynamoDB Amazon Kinesis
  10. 10. 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
  11. 11. Amazon  Cognito  Security Set  granular  access  permissions  on  AWS   resources Get  fine-­grained  access  control  to  cloud   resources. Safeguard  AWS  Credentials No  need  to  embed  credentials  in  the  app   anymore.  Get  least-­privileged  temporary   credentials. Helps  implement  security  best  practices Securely  access  any  AWS  Service.  It  simplifies   the  interaction  with  Security  Token  Service  and   removes  the  need  of  Token  Vending  Machine EC2 S3 DynamoDB Kinesis
  12. 12. Authorize  Users  Securely:  Amazon  Cognito  +  AWS  IAM  +   Fine-­grained  access  control
  13. 13. 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
  14. 14. 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
  15. 15. Synchronize  Data  Across  Devices:  Amazon  Cognito  (Sync)
  16. 16. Amazon  Cognito   Cloud  Save  and  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 No  Back  End Simple  client  SDK  eliminates  need  for  server   side  code.
  17. 17. Amazon  Cognito  Sync  Data  Model • Identity  Pool:  Pool  of  app  users.  Can  be  shared   across  apps. • Identity:  An  individual  user.  Consistent  across   identity  providers.  Can  be  a  guest  user. • Dataset:  Per  user  grouping  of  data.  The  most   granular  level  of  sync.  Up  to  1  MB. • Record:  Key-­‐value  pair. AWS  Account Dataset IdentityIdentityIdentity DatasetDataset Identity   Pool 1:60 1:n 1:20 DatasetDatasetRecord 1:1024 You Your  App Your  App  Users User  Data   Container User  Data
  18. 18. Integrating  Amazon  Cognito  Sync   Functionality  Is  Dead  Simple Initialize   the  CredentialsProvider   and  CognitoClient Call  synchronize   on  the  dataset Create  or  open  the  dataset  and  add  key  values provider = new CognitoCachingCredentialsProvider (context, AWS_ACCOUNT_ID, COGNITO_POOL_ID, COGNITO_ROLE_UNAUTH, COGNITO_ROLE_AUTH, Regions.US_EAST_1); cognito = new CognitoSyncManager (context, Regions.US_EAST_1, provider); dataset.synchronize(new SyncCallback(){..}); cognito.openOrCreateDataset(datasetName); dataset.put(key, value);
  19. 19. Integrating  Amazon  Cognito  Sync   Functionality  Is  Dead  Simple Initialize   the  AWSCognitoSyncClient Call  synchronize   on  the  dataset Create  or  open  the  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
  20. 20. Analyze  User  Behavior:  Amazon  Mobile  Analytics
  21. 21. 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 “Simply  and  cost-­effectively  collect  and  analyze   your  application   usage  data” Data  collected  are  not   shared,  aggregated,  or   reused
  22. 22. 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
  23. 23. 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.
  24. 24. 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  for  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
  25. 25. Integrating  Mobile  Analytics  is  super  simple Initialize   the  MobileAnalyticsManager.   That’s  it!  Get  Session   Activity  in  the  AWS  Management  Console.   For  Custom  Events  activity  reports,  add  events. Add  OnResume()  and  OnPause() private static MobileAnalyticsManager analytics; analytics = MobileAnalyticsManager.getOrCreateInstance( this.getApplicationContext(),"yourCompany.yourAppId", Regions.YOUR_REGION, config, cognitoProvider ); EventClient eventClient = analytics.getEventClient(); MobileAnalyticsEvent visitEvent = eventClient.createEvent("speedSet"); eventClient.recordEvent(visitEvent); analytics.getSessionClient().resumeSession(); analytics.getSessionClient().pauseSession(); Analytics.getEventClient().submitEvents();
  26. 26. Integrating  Mobile  Analytics  is  super  simple Initialize   the  AWSMobileAnalytics 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
  27. 27. Process  and  Analyze  Your  Mobile  Data  
  28. 28. Export  to  S3 &  Process  Data  Anywhere mobile client Amazon S3 Amazon  Mobile   Analytics Hadoop/Spark Amazon EMR Amazon Redshift petabyte- scale warehouse Amazon Glacier
  29. 29. Amazon Redshift petabyte-scale warehouse mobile client Amazon S3 Amazon  Mobile   Analytics External   data
  30. 30. Store  and  Deliver  Media:  Amazon  S3
  31. 31. Amazon   KinesisAWS   Mobile   SDK Mobile-­Optimized  Connectors  (AWS  Mobile  SDK) Amazon  S3 Integrated  AWS  Mobile  SDK   Optimized  for  native  OS Multipart  upload  media Fault  tolerant  download Automatic  retries Pause,  resume,  cancel  functions Generic  batching  system handles  intermittent  network   connection   Optimize  battery  utilization Amazon   DynamoDB
  32. 32. Amazon  S3  Connector:  Transfer  Manager S3  Connector Multipart  upload  media  (photos,  videos,  audio) Fault  tolerant  download  (e.g.  assets) No  back  end  required Automatic  retries Pause,  resume,  cancel  functions Optimized  for  native  OS
  33. 33. Amazon  S3  Connector:  Transfer  Manager  in  Android // Creating the transfer manager TransferManager = new TransferManager(credentialProvider); // Upload image Upload upload = transferManager.upload(BUCKET_NAME, fileName, file); // Download image Download download =, mKey, file); // Pause, and Resume try { PersistableDownload = download.pause(); //do something if we didn’t abort } catch(PauseException e) { //do something if we aborted } download = transferManager.resumeDownload(persistableDownload);
  34. 34. Amazon  S3  Connector:  Transfer  Manager  in  iOS // 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];
  35. 35. Mobile  Backend  as  a  Service  (MBass)
  36. 36. Respond  to  events  in  real  time Map  local  functions  to  Lambda  functions  from  within  the  SDK Target,  filter,  and  route  Amazon  SNS  notifications Apply  custom  logic  to  user  preferences  and  game  state Java  support  (coming  soon),  AWS  CloudTrail  integration,  enhanced   metrics  and  logging  via  Amazon  CloudWatch S3  event   notifications DynamoDB   Streams Amazon   Kinesis   events Amazon   Cognito   eventsSNS   events Custom   events AWS  Lambda
  37. 37. Adding  a  Lambda  Back  End  to  Your  Mobile  App   Is  Simple Initialize   the  LambdaFactory   and  define  the  interface  for  the  functions Call  synchronize   on  the  dataset Create/Upload   the  Lambda  function  to  the  AWS  Management  Console lambda = new LambdaInvokerFactory(context, Regions.US_WEST_2, provider); //interface @LambdaFunction(functionName="cloudFunction”) String localFunction(String nameInfo); lambda.localFunction(“Hello From “); // this will output “Hello From Lambda” exports.handler = function(event, context) { context.done(null, event + 'Lambda'); // SUCCESS with message };
  38. 38. Mobile  Push  Notifications:  Amazon  SNS
  39. 39. Amazon SNS Cross-Platform Mobile Push Internet Apple APNS Google GCM Amazon ADM Windows WNS and MPNS Baidu CP With Amazon SNS, developers can send push notifications on multiple platforms and reach mobile users around the world New  features:   Delivery  metrics  via   CloudWatch Trigger  Lambda   functions  from  SNS   notifications 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
  40. 40. Now  Using  Amazon  SNS  Mobile  Push Zero  to  500m+  daily   push  notifications   almost  overnight Highest  available   reliability   and  speed Easy  migration $1  per  million   mobile  push  deliveries 10m 170m 500m Day  1 Day  2 Day  3 Daily  SNS  Mobile  Push   Deliveries  (millions) …Rising
  41. 41. Photo  Sharing  Mobile  Reference  Architecture
  42. 42. AWS Region AUTHENTICATED  (ASSUMED  ROLE) Photo  Sharing AWS   MOBILE  REFERENCE   ARCHITECTURES Download   Photos  & App  Files Session  and  Device  Data,  User  Behavior Social  Content (Tagging,  Likes,   Comments,  etc.) Auto  Export Meta-­data Image  Manipulation Lambda   Function Invoked Multi-­part  Upload User  Login Auth with  Web  Identity  Token,   Custom  Identity  Integration User Friends AWS  Mobile  SDK Session  &  Photo  Metadata Role  Associated With  Identity  Pool Amazon Lambda Amazon CloudFront Amazon Mobile  Analytics Amazon DynamoDB Amazon Cognito Amazon IAM Amazon S3 Image  editing Amazon SNS  Mobile   Push Amazon Redshift Targeted
  43. 43. Mobile  Application  Testing  :  AWS  Device  Farm
  44. 44. Amazon  Mobile  Device  Farm • Test  on  same  devices  your  customers  use • Integrate  test  automation  into  you  CI   workflow • Choose  from  existing  tests  or  build  your   own • Analyze  performance  characteristics  such   as  memory,  CPU • Import  Calabash  tests  for  IOS  and  Android
  45. 45. Development/Testing  Process Develop SCM commit Automated Build trigger Automated UI  Test (Simulators) always Is Milestone ? no Beta  Deploy To Manual   Testers Automated UI  Test (Device  Farm) yes
  46. 46. Build  Mobile  Application  Rapidly  :  Mobile  Hub
  47. 47. The  AWS  Mobile  Hub  (Beta) 1.  Single  integrated  console 2.  Pre-­built  features 3.  Auto-­provisioned   services 4.  Auto-­generated   app Result:  Build  Apps  on  AWS  in  Minutes
  48. 48. Create  a  Project  and  Add  Features
  50. 50. Thank  You