aws deck templateaws-de-media.s3.amazonaws.com/images/aws summit... · pause, resume, cancel...
TRANSCRIPT
BERLIN
©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved
Danilo Poccia
AWS Technical Evangelist
@danilop
Build Your Mobile App Fasterwith AWS Mobile Services
Jan Metzner
AWS Solutions Architect
@janmetzner
What You’ll Get Out of This Session
• What AWS offers for mobile application development
• Easier to architect your mobile application
• Write cross platform mobile applications with AWS services
We asked two questions to our mobile customers:
What makes your mobile apps unique?
Where are you spending most of your time?
We asked two questions to our mobile customers:
What makes your mobile apps unique?
Where are you spending most of your time?
How to build a mobile app today?
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
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
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 dataAmazon DynamoDB
(Object Mapper)
Stream real-time dataAmazon Kinesis
(Recorder)
Run Business Logic
AWS Lambda
Send push notificationsAmazon SNS
Mobile Push
Your
Mobile
App
Authenticate users: Amazon Cognito
Amazon Cognito
Simplifies Identity and
Access Management
Securely access all
AWS services from
Mobile device
Cross-device and
Cross-platform SyncImplement 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
Identity
Providers
Unique
IdentitiesJoe Anna Bob
Any Device
Any Platform
Any AWS
Service
Helps implement security best
practicesSecurely access any AWS Service from mobile
device. It simplifies the interaction with AWS
Identity and Access Management
Support Multiple Login ProvidersEasily integrate with major login providers for
authentication.
Unique Users vs. DevicesManage unique identities. Automatically
recognize unique user across devices and
platforms.
Amazon Cognito Identity
Mobile
AnalyticsS3 DynamoDB Kinesis
Amazon Cognito for Unauthenticated Identities
Unique Identifier for Your “Things”“Headless” connected devices can also
securely access cloud services.
Save Data to the CloudSave app and device data to the cloud and
merge them after login
Guest User AccessSecurely 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
Access Policy Restriction
(Policy Variables)
{
"Effect": "Allow”,
"Action": ["s3:GetObject", "s3:PutObject”],
"Resource": ["arn:aws:s3:::
myBucket/amazon/snakegame/
${cognito-identity.amazonaws.com:sub}"]
}
Allow
Actions:
S3 Get/Put operations
Resource:
Only to a specific part
of bucket to that identity
Access Policy Restriction
(Policy Variables)
{
"Effect": "Allow",
"Action": [
"dynamodb:PutItem",
"dynamodb:UpdateItem",
"dynamodb:DeleteItem”
],
"Resource": [
"arn:aws:dynamodb:<region>:<account>:table/<table>"
],
"Condition": {
"ForAllValues:StringEquals":
{
"dynamodb:LeadingKeys":
[ "${cognito-identity.amazonaws.com:sub}" ]
}
}
}
Allow
Actions:
DynamoDB “write” ops
Resource:
Only if your identity
is in the hash key
Synchronize data across devices : Amazon Cognito (Sync)
Cognito Cloud Save and Sync
User Data
Storage and
Sync
Any Platform
iOS/Android/FireOS
Store App Data, Preferences and StateSave 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 OfflineData always stored in local SQLite DB first.
Works seamlessly when intermittent or no
connectivity
k/v data
Identity pool
No BackendSimple client SDK eliminates need for server
side code
Synchronize data across devices with Cognito
Sync Game States
Across OS/devices State Transition
(link multiple accounts)Sync User Profiles
across OS/devices/web
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
Synchronize dataAmazon Cognito
(Sync)
AWS Identity and
Access Management
Amazon Cognito
(Identity Broker)
Analyze User Behavior
Run Business Logic
Track active users,
Engagement, retention
Run stateless custom
Code without managing servers
Analyze User Behavior: Amazon Mobile Analytics
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
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
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
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
Run custom queries
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)
Run Business LogicRun stateless custom
Code without managing servers
Serverless Backend Optimized for Mobile
AWS Lambda
Auto Scaling
(Never under or over
provision)
Focus on business logic,
not infrastructure. Upload
your code; AWS Lambda
handles everything else
Zero Administration
Lambda scales the
infrastructure as needed
to match the event rate
and pay as you go
Bring Your Own Code
“Run your code in the cloud in response to events and scale without any
servers to manage”
Starting with JavaScript but
later any language, Create
threads and processes, run
batch scripts or other
executables,
Java
How can you put AWS Lambda to work?
Stream
processing
Data triggersBack-end
service
Mobile/IoT Indexing &
synchronization
Case Study: Social Media Aggregation
CommandPost is CMP.LY’s patented
Monitoring, Measurement & Insights (MMI)
tool for managed social communications.
Increase the amount of data
processed while reducing(!)
the resources (instances)
required to do it
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, CloudTrail integration,Enhanced metrics and logging via CloudWatch
S3 event
notification
s
DynamoDB
Streams
Kinesis
events
Cognito
events
SNS
events
Custom
events
AWS Lambda Now Ready for Production at Scale
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
SNS Push
notification
Personalize your
notification for
every user
Adding a Lambda Backend 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
};
Authenticate users
Authorize access
Analyze User Behavior
Synchronize data
AWS Mobile SDK
Amazon Mobile
Analytics
Amazon Cognito
(Sync)
AWS Identity and
Access Management
Amazon Cognito
(Identity Broker)
Run Business Logic
AWS Lambda
Your
Mobile
App
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
KinesisAWS
Mobile SDK
Mobile-optimized Connectors (AWS Mobile
SDK)
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
DynamoDB
Store and share media: Amazon S3
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
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)
Run Business Logic
AWS Lambda
Your
Mobile
App
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
Send Push Notifications: Amazon SNS Mobile Push
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.
Each platform works differently, and push gets even more
complex as you scale to support millions of devices.
Cloud App
Platform Services Mobile Apps
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
Mac OS desktops
VoIP appson iOS devices
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
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)
Run Business Logic
AWS Lambda
Send push notificationsAmazon SNS
Mobile Push
Your
Mobile
App
Store shared data
Stream real-time data
Store and query fast NoSQL data
across users and devices
Collect real-time clickstream logs
and take actions quickly
Store Shared Data: Amazon DynamoDB
Joe Anna Bob
High Scores
Joe 1500
Anna 800
Bob 750
Amazon DynamoDB Connector: Object Mapper
Simplifies access to Amazon
DynamoDB in you app
Map client-side classes to Amazon
DynamoDB tables
Removes the need to transform
objects into tables and vice versa
Amazon DynamoDB: Example @DynamoDBTable(tableName = "Bookstore")
public static class Book {
private int id;
private String isbn, title;
private Boolean hardCover;
@DynamoDBHashKey(attributeName = "id")
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@DynamoDBAttribute(attributeName="isbn")
public String getIsbn() {
return isbn;
}
...
}
Id isbn Title hardCover
1 22-22222 My First Book Yes
2 43-43234 My Favorite Book No
3 55-12345 My New Book Yes
Table: Bookstore
Amazon DynamoDB: Example// Build a book object
Book book = new Book();
book.setId(17);
book.setIsbn("222-2222222222");
book.setTitle("Some Title");
book.setHardCover(true);
// Save book object to dynmaoDB
mapper.save(book);
// Update item and save object again
book.setTitle("Updated Title");
book.setHardCover(false);
mapper.save(book);
// Load another book
Book anotherBook = mapper.load(Book.class,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 dataAmazon DynamoDB
(Object Mapper)
Run Business Logic
AWS Lambda
Send push notificationsAmazon SNS
Mobile Push
Your
Mobile
App
Stream real-time data
Collect real-time clickstream logs
and take actions quickly
Collect real-time click-stream data: Amazon Kinesis Mobile
Connector
Amazon Kinesis
RedshiftS3Kinesis enabled Apps on EC2
AWS Mobile SDK
Amazon Kinesis Connector for Mobile Apps
For sophisticatedUser Behavior
Real-time Analysis
Integrated AWS Mobile SDK
Generic batching system that handles intermittent network connection and also optimize
battery utilization
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 dataAmazon DynamoDB
(Object Mapper)
Stream real-time dataAmazon Kinesis
(Recorder)
Run Business Logic
AWS Lambda
Send push notificationsAmazon SNS
Mobile Push
Your
Mobile
App
Example: Putting it all together (Demo)
Summary
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
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
Get Started for Free!
http://aws.amazon.com/mobile
AWS
Lambda
Free Tier : 1M free
requests per month
400,000 GB-
seconds of compute
time per month
Jan Metzner@janmetzner
Danilo Poccia@danilop
BERLIN
©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved