1. Journey Through the Cloud
ianmas@amazon.com
@IanMmmm
Ian Massingham — Technical Evangelist
Social & Mobile Apps
2. Journey Through the Cloud
Learn from the journeys taken by other AWS customers
Discover best practices that you can use to bootstrap your projects
Common use cases and adoption models for the AWS Cloud
1
2
3
3. Social & Mobile Apps
Create mobile apps quickly & easily
We manage the backend
You don’t have to provision, scale, or monitor servers
Access a range of services to speed app development
4. Agenda
Why develop mobile apps on AWS?
AWS Mobile SDK & Connectors
Amazon Cognitio
Serverless mobile backends
Analyzing user behavior
Mobile push notifications
Storing and sharing media with Amazon S3
Resources you can use to learn more
7. Authenticate users
Authorize access
Analyze User Behavior
Store and share media
Synchronize data
Deliver media
Store shared data
Stream real-time dataRun Business Logic
Send push notifications
Manage users and
identity providers
Securely access
cloud resources
Sync user prefs , states
across devices
Track active users,
Engagement, retention
Run stateless custom
Code without managing servers
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
Core Functionality
8. 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
to implement 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
What Mobile Developers have told us
9. Amazon Cognito Amazon Mobile Analytics Amazon SNS Mobile Push
Kinesis Recorder DynamoDB 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
Introducing AWS Mobile Services
AWS Lambda
Lambda
Functions
λ λ λ λ
10. Cross-platform Services, Optimized for Mobile
Amazon Cognito Amazon Mobile Analytics Amazon SNS Mobile Push
Kinesis Recorder DynamoDB Mapper S3 Transfer Mgr SQS Client SES Client
AWS Lambda
Lambda
Functions
λ λ λ λ
Not limited to Mobile.
Run stateless Lambda
Functions without any
backend servers to
manage or scale
User identity &
data synchronization
service
Fast cross-platform
Analytics & reporting
Service
Powerful Cross-platform
Push notification service
Recorder that can
handle intermittent
network connection
Send email
reliably from
device
Access
distributed
buffering and
queuing
service
Easily upload,
download to S3
and also pause,
resume, and cancel
these operations
Store any NoSQL
data and also map
mobile OS specific
objects to
DynamoDB tables
11. Your
Mobile
App
Core Functionality
Authenticate users
Authorize access
Analyze User Behavior
Store and share media
Synchronize data
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)
Run Business Logic
AWS Lambda
Send push notifications
Amazon SNS
Mobile Push
13. • 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
Developer
Preview
Download the latest
versions of the SDKs
Fully Integrated AWS Mobile SDK
18. 1 2 3
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
Guest Your own
Auth
19. Amazon Cognito Identity
Identity
Providers
Unique
Identities
Joe Anna Bob
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.
Mobile Analytics S3 DynamoDB Kinesis
20. 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
No Backend
Simple client SDK eliminates need for server side
code
Cognito Cloud Save and Sync
User Data
Storage and
Sync
Any Platform
iOS/Android/FireOS
k/v data
Identity pool
21. Integrating Cognito Sync functionality
Initialize the CredentialsProvider and CognitoClient
Call synchronize on the dataset
Create or open 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);
1
2
3
23. 1 2 3
AWS Lambda
Auto Scaling
(Never under or over provision)
Starting with JavaScript but later
any language, Create threads
and processes, run batch scripts
or other executables
Zero administration Bring your own code
Run stateless functions in the cloud and scale without any servers to manage
Focus on business logic,
not infrastructure. Upload
your code; AWS Lambda
handles everything else
Lambda scales the
infrastructure as needed
to match the event rate
and pay as you go
25. Serverless backends for mobile apps
Amazon
Cognito Sync
Dataset
Amazon
DynamoDB
Table
Map local
functions to
invoke Lambda
Functions
synchronously
Maintain
Intelligence in
the cloud and
not the device
Chain multiple
Functions or call
them in Parallel
☺
AWS Mobile
SDKs
(iOS, Android)
Personalize your
notification for every
user
Pre-process or
validate
data on the fly
pre-process before
persisting
SNS Push
Notification
26. Synchronous Events
Respond to events in real-time
AWS Mobile SDK Integration
Map local functions to cloud functions from within the SDK
Amazon SNS Integration
Target, Filter, and Route Amazon SNS Notifications
Amazon Cognito Integration
Apply Custom Logic to User Preferences and Game State
And much more….
Java Support, CloudTrail integration, Enhanced metrics and logging
via CloudWatch
S3 event
notifications
DynamoDB
Streams
Kinesis
events
Cognito
events
SNS
events
Custom
events
AWS Lambda: Ready for Production at Scale
http://aws.amazon.com/lambda/faqs/
27. Adding a Lambda Backend to your App
Initialize the LambdaFactory and define the Interface for the functions
Call localFunction object to execute Lambda Function
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
};
1
2
3
29. 1 2 3
Amazon Mobile Analytics
Scalable and Generous Free Tier
Data collected are not shared,
aggregated, or reused
Fast Own your data
Simply and cost effectively collect and analyze your application usage data
Focus on metrics that matter.
Usage reports available
within 60 minutes of
receiving data from an app
Scale to billions of
events per day from
millions of users
30.
31. 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
32. Track Custom Events
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
33. Integrating Mobile Analytics
Initialize the MobileAnalyticsManager to get session activity in the AWS 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();
1
2
3
34. Query and Visualize Data
Export to S3/Redshift
Visualize, manage & process data anywhere
mobile
client
Amazon
S3
Amazon
Redshift
Amazon Mobile
Analytics
Augment your data
External data
35. Export to S3, Process Data Anywhere
mobile
client
Amazon
S3
Amazon
Redshift
Amazon Mobile
Analytics
Hadoop/Spark
Amazon EMR
Amazon
Glacier
archive
batch
36. External data
Export to Redshift (Managed)
mobile
client
Amazon
S3
Amazon
Redshift
Amazon Mobile
Analytics
Augment your data
38. Amazon SNS Mobile Push
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
Kindle Fire Devices
Android Phones and Tablets
Apple iPhones, iPads & Mac OS Desktops
iOS & Mac OS
Android Phones and Tablets in China
Windows Desktop and Windows Phone Devices
43. Flexible and Work Better Together
Fully Integrated and easy to get started
Serverless and Scales automatically1
2
3
AWS Mobile Services
44. Mobile Services Working Together
Push Synchronization
SNSCognito
Cognito
Cognito
Auto Export to S3/Redshift
SNS
Cognito Streams to Kinesis
Lambda
Lambda Lambda
Lambda
Any
Analytics S3/Redshift
Kinesis
Trigger based on Streams Trigger based on Sync Events
Securely access AWS Services Update Push Notifications with Functions
DynamoDB
Trigger based on DynamoDB streams
Cognito KinesisLambdaS3
Trigger based on S3 PUTs
45. 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
Mobile-optimized Connectors (AWS Mobile SDK)
Kinesis
AWS Mobile SDK
S3
Kinesis Recorder
DynamoDB Mapper
S3 TransferManager
No Backend Required
DynamoDB
46. Your
Mobile
App
Core Functionality
Authenticate users
Authorize access
Analyze User Behavior
Store and share media
Synchronize data
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)
Run Business Logic
AWS Lambda
Send push notifications
Amazon SNS
Mobile Push
47. Get Started for Free
Amazon
Cognito
Mobile
Analytics
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
AWS
Lambda
Free Tier :
1M free requests per
month
400,000 GB-
seconds of compute
time per month