SlideShare a Scribd company logo
Cloud-powered Cross-platform
Mobile Apps on AWS
Danilo Poccia ‒ AWS Technical Evangelist
@danilop
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 dataTrack Retention
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
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
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
AWS Mobile Services
AWS Lambda
Lambda
Functions
λ λ
λ
λ
Cross-platform, Optimized for Mobile
User identity &
data synchronization
service
Store any NoSQL
data and also map
mobile OS specific
objects to
DynamoDB tables
Fast cross-platform
Analytics & reporting
Service
Powerful Cross-platform
Push notification service
Recorder that can
handle intermittent
network connection
Easily upload,
download to S3 and
also pause, resume,
and cancel these
operations
Send email
reliably from
device
Access
distributed buffering
and queuing
service
Amazon Cognito Amazon Mobile Analytics Amazon SNS Mobile Push
Kinesis Recorder DynamoDB Mapper S3 Transfer Mgr SQS Client SES ClientAWS Lambda
Lambda
Functions
λ λ
λ
λ
Not limited to Mobile.
Run stateless cloud
Functions without any
Backend servers to
Manage or scale
Fully Integrated AWS Mobile SDK
• Common authentication mechanism across all
services
• Automatically handle intermittent network
connections
• Cross-platform Support:

Android, iOS, Fire OS, Unity, Xamarin (beta)
• 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
Authenticate users: Amazon Cognito
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
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. 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
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
Amazon Cognito Security Architecture
End Users
App with AWS
Mobile SDK Access
to AWS Services
Login OAUTH/OpenID
Access Token
Cognito ID,
Temp
Credentials
Access Token
Pool ID
Role ARNs
Cognito ID
(Temp
Credentials)
DynamoDB
Developer
Cognito Identity
Broker
S3
Mobile Analytics
Cognito Sync
Store
AWS
Management
Console
Authorize access: Amazon Cognito +AWS IAM + Fine-grained access control
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
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:us-west-2:<AWS_ACCOUNT_ID>:

table/<TABLE_NAME>"
],
"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 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
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
Use case: Game State
Concrete Software builds cross platform mobile games
Concrete Software has been making hit mobile games
like Jellyflop and PBA Bowling Challenge since 2003.
With Amazon Cognito, We can
build games much faster and
provide great user experience
to our customers.
Keith A. Pichelman
CEO, Concrete Software
”
“
• Provide a seamless user experience across devices
and platforms to our users.
• Store save games in the cloud and synchronize them
across all of a user’s devices without creating or
hosting a backend.
The Challenge
The solution
• Amazon Cognito helps us securely access our AWS
resources.
• Cognito Sync gives us flexibility to save data in the
cloud, and cache it on a user’s devices, without
managing any backend infrastructure.
Just Launched: Javascript Sync
Unique identity across web and mobile
Uniquely identify your user on your website and mobile
devices
Sync your profiles across web and mobile
Sync user data and preferences across web and
devices with one line of code
JS/HTML5 Mobile Applications
Data always stored in local SQLite DB first. Works
seamlessly when intermittent or no connectivity
Use Case: Unique Identity across the web and mobile
Analyze User Behavior
Store and share media
Deliver media
Store shared data
Stream real-time dataTrack Retention
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)
Analyze User Behavior: Amazon MobileAnalytics
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
Cloud-powered Cross-platform Mobile Apps on AWS
28Live score VotingPush notifications
AMAZON MOBILE ANALYTICS + REDSHIFT
VISUALIZE DATA THAT MATTERS TO YOU
SEGMENTATIONBASEDONACTIVITY
WE WANT TO SEE WHICH GROUP USE EACH FUTURE
30
Low activity
Medium
activity
High activity
1-4 days 5-12 days 13-14 days
DEVICES
IN FORZA FOOTBALL
31
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
Run Stateless Cloud Functions
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 stateless functions in the cloud and scale without any servers to manage”
Starting with Javacript but later
bring your own code, Create
threads and processes, run
batch scripts or other
executables,
Endless possibilities - not just for mobile
Data
Triggers
Stream
Processing
Indexing &
Synchronization
Server-free
Back-end
IoT
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
Outplay Entertainment –Amazon S3 Connector viaAWS Mobile SDK
Outplay Entertainment is mobile-focused game developer
on a mission to deliver fun, free and innovative games for
smartphones, tablets, and social networks.
With Amazon S3 connector, we can
improve the users experience by
dynamically downloading game assets
in the background. No long up-front
delays for our users.
Douglas Hare
CEO, Outplay Entertainment
”
“ • Improved User Experience. Using the Mobile SDK,
they can download the game assets in background
while the user starts playing the game. No limits on
downloading extra assets.
• Dynamic updates. They can update the assets
dynamically and avoid AppStore release cycles.
• Unquestioned Scalability. Different assets for
multiple screen densities go up to 170 MB+. By storing
this data on S3 and directly downloading to the mobile
device, they can scale seamlessly.
• Excellent Performance. Highest resolution devices
end up downloading about 90MB of extra content.
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)
Send Push Notifications: Amazon SNS Mobile Push
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:
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
Mobile push lets our users live life
together in the moment, even
when they are miles apart.
Founded in San Francisco
in 2010
Social networking and
messaging designed for
close friends and family
Two apps, Three platforms,
20 languages
5M+ DAU worldwide
creating billions of monthly
impressions
Reliable push at scale takes constant work
35 AWS EC2 m3.xlarge instances
Home-rolled code based on Tornado
6 Load
Balancers
Constantly trying to
scale out, both at
process level and server
level
Fighting to maximize
throughput at packets
per second level
Never certain how many
pushes we were
sending or dropping
Now Path Uses SNS Mobile Push
Amazon SNS

Mobile Push
Store Shared Data: Amazon DynamoDB
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);
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 sophisticated
User Behavior
Real-time
Analysis
Integrated AWS Mobile SDK
Generic batching system that
handles intermittent network
connection and also optimize
battery utilization
Hardlight (ASEGANetworks Studio) –Amazon Kinesis
Hardlight (SEGA) is known for bringing SEGA’s much
loved blue mascot to the mobile domain. AWS Mobile SDK Amazon Kinesis
Sonic Series
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
Demo - Sample App
Put your notes on a map,
add a picture,
share them
Summary
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
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
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!
http://aws.amazon.com/mobile
@danilop

More Related Content

Similar to Cloud-powered Cross-platform Mobile Apps on AWS (20)

PDF
Build high performing mobile apps, faster with AWS
Shiva Narayanaswamy
 
PDF
Social & Mobile Apps journey through the cloud
Ian Massingham
 
PDF
AWS Innovate 2016: Build Mobile Apps using AWS SDKs and Mobile Hub- Oliver Klein
Amazon Web Services Korea
 
PDF
Gaming on AWS - 8. 서버 없이 게임 만들기 - Serverless Architecture
Amazon Web Services Korea
 
PDF
Scaling your Mobile App Development in the Cloud - DevNexus
Tara Walker
 
PDF
4. Carlos Conde - Amazon Web Services
MobCon
 
PDF
AWS 모바일 허브에서 모바일 프로그래밍하기 - 박선용 :: 2015 리인벤트 리캡 게이밍
Amazon Web Services Korea
 
PDF
AWS Mobile Hub Overview
Danilo Poccia
 
PPTX
Building mobile apps that can automatically scale globally to millions of use...
AWS Germany
 
PDF
Amazon Cognito Principles.pdf
hayhadiabbas
 
PPTX
Extending on premise applications to the cloud
Intechnica
 
PDF
Comenzando con AWS Mobile Services
Amazon Web Services LATAM
 
PDF
amazon-cognito-auth-in-minutes
Vladimir Budilov
 
PDF
Building Event-Driven Serverless Applications - AWS - Danilo Poccia
IT Talent College
 
PDF
CIS14: Identity Management for the Cloud
CloudIDSummit
 
PDF
APAC Webinar Apr 10 - Architecting your Mobile App for the Cloud
8KMiles Software Services
 
PDF
윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션
Amazon Web Services Korea
 
PDF
Cloud-powered Mobile Apps
Danilo Poccia
 
PPTX
Codestrong 2012 keynote jonathan rende, appcelerator's vp of products
Axway Appcelerator
 
PDF
Building event driven serverless apps by Danilo Poccia at Codemotion Dubai
Codemotion Dubai
 
Build high performing mobile apps, faster with AWS
Shiva Narayanaswamy
 
Social & Mobile Apps journey through the cloud
Ian Massingham
 
AWS Innovate 2016: Build Mobile Apps using AWS SDKs and Mobile Hub- Oliver Klein
Amazon Web Services Korea
 
Gaming on AWS - 8. 서버 없이 게임 만들기 - Serverless Architecture
Amazon Web Services Korea
 
Scaling your Mobile App Development in the Cloud - DevNexus
Tara Walker
 
4. Carlos Conde - Amazon Web Services
MobCon
 
AWS 모바일 허브에서 모바일 프로그래밍하기 - 박선용 :: 2015 리인벤트 리캡 게이밍
Amazon Web Services Korea
 
AWS Mobile Hub Overview
Danilo Poccia
 
Building mobile apps that can automatically scale globally to millions of use...
AWS Germany
 
Amazon Cognito Principles.pdf
hayhadiabbas
 
Extending on premise applications to the cloud
Intechnica
 
Comenzando con AWS Mobile Services
Amazon Web Services LATAM
 
amazon-cognito-auth-in-minutes
Vladimir Budilov
 
Building Event-Driven Serverless Applications - AWS - Danilo Poccia
IT Talent College
 
CIS14: Identity Management for the Cloud
CloudIDSummit
 
APAC Webinar Apr 10 - Architecting your Mobile App for the Cloud
8KMiles Software Services
 
윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션
Amazon Web Services Korea
 
Cloud-powered Mobile Apps
Danilo Poccia
 
Codestrong 2012 keynote jonathan rende, appcelerator's vp of products
Axway Appcelerator
 
Building event driven serverless apps by Danilo Poccia at Codemotion Dubai
Codemotion Dubai
 

More from Danilo Poccia (20)

PDF
Get Value from Your Data
Danilo Poccia
 
PDF
Building Event-Driven Serverless Applications
Danilo Poccia
 
PDF
Connecting the Unconnected: IoT Made Simple
Danilo Poccia
 
PDF
Building Event-driven Serverless Apps
Danilo Poccia
 
PDF
An Introduction to AWS IoT
Danilo Poccia
 
PDF
Event-driven (serverless) Applications
Danilo Poccia
 
PDF
Machine Learning for Developers
Danilo Poccia
 
PDF
Masterclass Advanced Usage of the AWS CLI
Danilo Poccia
 
PDF
Get Value From Your Data
Danilo Poccia
 
PDF
Amazon Elastic File System (Amazon EFS)
Danilo Poccia
 
PDF
Data Analytics on AWS
Danilo Poccia
 
PDF
Managing Containers at Scale
Danilo Poccia
 
PDF
Amazon API Gateway and AWS Lambda: Better Together
Danilo Poccia
 
PDF
Amazon Aurora Let's Talk About Performance
Danilo Poccia
 
PDF
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Danilo Poccia
 
PDF
Amazon Aurora: Amazon’s New Relational Database Engine
Danilo Poccia
 
PDF
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Danilo Poccia
 
PDF
Infrastructure as Code: Manage your Architecture with Git
Danilo Poccia
 
PDF
Infrastructure as Code: Manage your Architecture with Git
Danilo Poccia
 
PDF
Building a Scalable and Highly Available Web Service with AWS: A Live Demo
Danilo Poccia
 
Get Value from Your Data
Danilo Poccia
 
Building Event-Driven Serverless Applications
Danilo Poccia
 
Connecting the Unconnected: IoT Made Simple
Danilo Poccia
 
Building Event-driven Serverless Apps
Danilo Poccia
 
An Introduction to AWS IoT
Danilo Poccia
 
Event-driven (serverless) Applications
Danilo Poccia
 
Machine Learning for Developers
Danilo Poccia
 
Masterclass Advanced Usage of the AWS CLI
Danilo Poccia
 
Get Value From Your Data
Danilo Poccia
 
Amazon Elastic File System (Amazon EFS)
Danilo Poccia
 
Data Analytics on AWS
Danilo Poccia
 
Managing Containers at Scale
Danilo Poccia
 
Amazon API Gateway and AWS Lambda: Better Together
Danilo Poccia
 
Amazon Aurora Let's Talk About Performance
Danilo Poccia
 
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Danilo Poccia
 
Amazon Aurora: Amazon’s New Relational Database Engine
Danilo Poccia
 
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Danilo Poccia
 
Infrastructure as Code: Manage your Architecture with Git
Danilo Poccia
 
Infrastructure as Code: Manage your Architecture with Git
Danilo Poccia
 
Building a Scalable and Highly Available Web Service with AWS: A Live Demo
Danilo Poccia
 
Ad

Cloud-powered Cross-platform Mobile Apps on AWS

  • 1. Cloud-powered Cross-platform Mobile Apps on AWS Danilo Poccia ‒ AWS Technical Evangelist @danilop
  • 2. How to build a mobile app today?
  • 3. Authenticate users Authorize access Analyze User Behavior Store and share media Synchronize data Deliver media Store shared data Stream real-time dataTrack Retention 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. 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
  • 5. 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 AWS Mobile Services AWS Lambda Lambda Functions λ λ λ λ
  • 6. Cross-platform, Optimized for Mobile User identity & data synchronization service Store any NoSQL data and also map mobile OS specific objects to DynamoDB tables Fast cross-platform Analytics & reporting Service Powerful Cross-platform Push notification service Recorder that can handle intermittent network connection Easily upload, download to S3 and also pause, resume, and cancel these operations Send email reliably from device Access distributed buffering and queuing service Amazon Cognito Amazon Mobile Analytics Amazon SNS Mobile Push Kinesis Recorder DynamoDB Mapper S3 Transfer Mgr SQS Client SES ClientAWS Lambda Lambda Functions λ λ λ λ Not limited to Mobile. Run stateless cloud Functions without any Backend servers to Manage or scale
  • 7. Fully Integrated AWS Mobile SDK • Common authentication mechanism across all services • Automatically handle intermittent network connections • Cross-platform Support:
 Android, iOS, Fire OS, Unity, Xamarin (beta) • 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
  • 9. 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
  • 10. 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. 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. 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. Amazon Cognito Security Architecture End Users App with AWS Mobile SDK Access to AWS Services Login OAUTH/OpenID Access Token Cognito ID, Temp Credentials Access Token Pool ID Role ARNs Cognito ID (Temp Credentials) DynamoDB Developer Cognito Identity Broker S3 Mobile Analytics Cognito Sync Store AWS Management Console
  • 13. Authorize access: Amazon Cognito +AWS IAM + Fine-grained access control
  • 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. 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
  • 16. Access Policy Restriction (Policy Variables) { "Effect": "Allow", "Action": [ "dynamodb:PutItem", "dynamodb:UpdateItem", "dynamodb:DeleteItem" ], "Resource": [ "arn:aws:dynamodb:us-west-2:<AWS_ACCOUNT_ID>:
 table/<TABLE_NAME>" ], "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
  • 17. Synchronize data across devices : Amazon Cognito (Sync)
  • 18. 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
  • 19. 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
  • 20. Use case: Game State
  • 21. Concrete Software builds cross platform mobile games Concrete Software has been making hit mobile games like Jellyflop and PBA Bowling Challenge since 2003. With Amazon Cognito, We can build games much faster and provide great user experience to our customers. Keith A. Pichelman CEO, Concrete Software ” “ • Provide a seamless user experience across devices and platforms to our users. • Store save games in the cloud and synchronize them across all of a user’s devices without creating or hosting a backend. The Challenge The solution • Amazon Cognito helps us securely access our AWS resources. • Cognito Sync gives us flexibility to save data in the cloud, and cache it on a user’s devices, without managing any backend infrastructure.
  • 22. Just Launched: Javascript Sync Unique identity across web and mobile Uniquely identify your user on your website and mobile devices Sync your profiles across web and mobile Sync user data and preferences across web and devices with one line of code JS/HTML5 Mobile Applications Data always stored in local SQLite DB first. Works seamlessly when intermittent or no connectivity
  • 23. Use Case: Unique Identity across the web and mobile
  • 24. Analyze User Behavior Store and share media Deliver media Store shared data Stream real-time dataTrack Retention 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)
  • 25. Analyze User Behavior: Amazon MobileAnalytics
  • 26. 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
  • 28. 28Live score VotingPush notifications
  • 29. AMAZON MOBILE ANALYTICS + REDSHIFT VISUALIZE DATA THAT MATTERS TO YOU
  • 30. SEGMENTATIONBASEDONACTIVITY WE WANT TO SEE WHICH GROUP USE EACH FUTURE 30 Low activity Medium activity High activity 1-4 days 5-12 days 13-14 days
  • 32. 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
  • 33. Run Stateless Cloud Functions
  • 34. 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 stateless functions in the cloud and scale without any servers to manage” Starting with Javacript but later bring your own code, Create threads and processes, run batch scripts or other executables,
  • 35. Endless possibilities - not just for mobile Data Triggers Stream Processing Indexing & Synchronization Server-free Back-end IoT
  • 36. Store and share media: Amazon S3
  • 37. 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
  • 38. Outplay Entertainment –Amazon S3 Connector viaAWS Mobile SDK Outplay Entertainment is mobile-focused game developer on a mission to deliver fun, free and innovative games for smartphones, tablets, and social networks. With Amazon S3 connector, we can improve the users experience by dynamically downloading game assets in the background. No long up-front delays for our users. Douglas Hare CEO, Outplay Entertainment ” “ • Improved User Experience. Using the Mobile SDK, they can download the game assets in background while the user starts playing the game. No limits on downloading extra assets. • Dynamic updates. They can update the assets dynamically and avoid AppStore release cycles. • Unquestioned Scalability. Different assets for multiple screen densities go up to 170 MB+. By storing this data on S3 and directly downloading to the mobile device, they can scale seamlessly. • Excellent Performance. Highest resolution devices end up downloading about 90MB of extra content.
  • 39. 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)
  • 40. Send Push Notifications: Amazon SNS Mobile Push
  • 41. Each platform works differently, and push gets even more complex as you scale to support millions of devices. Cloud App Platform Services Mobile Apps
  • 42. 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: 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
  • 43. Mobile push lets our users live life together in the moment, even when they are miles apart. Founded in San Francisco in 2010 Social networking and messaging designed for close friends and family Two apps, Three platforms, 20 languages 5M+ DAU worldwide creating billions of monthly impressions
  • 44. Reliable push at scale takes constant work 35 AWS EC2 m3.xlarge instances Home-rolled code based on Tornado 6 Load Balancers Constantly trying to scale out, both at process level and server level Fighting to maximize throughput at packets per second level Never certain how many pushes we were sending or dropping
  • 45. Now Path Uses SNS Mobile Push Amazon SNS
 Mobile Push
  • 46. Store Shared Data: Amazon DynamoDB
  • 47. 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
  • 48. 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);
  • 49. Collect real-time click-stream data: Amazon Kinesis Mobile Connector
  • 50. Amazon Kinesis RedshiftS3Kinesis enabled Apps on EC2 AWS Mobile SDK Amazon Kinesis Connector for Mobile Apps For sophisticated User Behavior Real-time Analysis Integrated AWS Mobile SDK Generic batching system that handles intermittent network connection and also optimize battery utilization
  • 51. Hardlight (ASEGANetworks Studio) –Amazon Kinesis Hardlight (SEGA) is known for bringing SEGA’s much loved blue mascot to the mobile domain. AWS Mobile SDK Amazon Kinesis Sonic Series
  • 52. 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
  • 53. Demo - Sample App Put your notes on a map, add a picture, share them
  • 55. 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
  • 56. 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
  • 57. 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! http://aws.amazon.com/mobile