social & mobile apps journey through the cloud
TRANSCRIPT
Journey Through the Cloud
[email protected]@IanMmmm
Ian Massingham — Technical Evangelist
Social & Mobile Apps
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 Cloud123
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
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
WHY DEVELOP MOBILE APPS ON AWS?
Enterprises & Startups Running Mobile Apps on AWS
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
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 CodeUser 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
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 AppAWS Mobile SDK, API Endpoints, Management Console
Compute Storage Networking Analytics Databases
Integrated SDK
Introducing AWS Mobile Services
AWS Lambda
Lambda Functions
λ λ λ λ
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 ClientAWS 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
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 dataAmazon DynamoDB (Object Mapper)
Stream real-time dataAmazon Kinesis (Recorder)
Run Business LogicAWS Lambda
Send push notificationsAmazon SNS Mobile Push
AWS MOBILE SDKAND CONNECTORS
• 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
https://github.com/aws/aws-sdk-unity
Supported AWS Services
Amazon Cognito Amazon DynamoDB Amazon Mobile Analytics Amazon SNS Amazon S3
AWS Mobile SDK for Unity
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)
KinesisAWS Mobile SDK
S3
Kinesis Recorder
DynamoDB Mapper
S3 TransferManager
No Backend Required
DynamoDB
AMAZON COGNITO
AUTHENTICATE USERS AND SAVE APP SETTINGS
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
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
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 BackendSimple 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
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);
123
SERVERLESS MOBILE BACKENDS
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
How can you AWS Lambda to work?
Data triggers Stream processing Indexing & synchronization
1100
111 1
1
00
00
0 1100
111 1
1
00
00
01100
111 1
1
00
00
0 1100
111 1
1
00
00
0
IoT Server-free back-end
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
Synchronous EventsRespond to events in real-timeAWS Mobile SDK IntegrationMap local functions to cloud functions from within the SDK
Amazon SNS IntegrationTarget, Filter, and Route Amazon SNS NotificationsAmazon 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/
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
};
123
ANALYZING USER BEHAVIOR
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
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 Custom EventsGet 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
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();
123
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
Export to S3, Process Data Anywhere
mobile client
Amazon S3
Amazon Redshift
Amazon Mobile Analytics
Hadoop/Spark Amazon EMR
Amazon Glacier
archive
batch
External data
Export to Redshift (Managed)
mobile client
Amazon S3
Amazon Redshift
Amazon Mobile Analytics
Augment your data
MOBILE PUSH NOTIFICATIONS
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
STORING AND SHARING MEDIA WITH 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
Amazon S3 Connector: Transfer Manager
Creating the transfer manager
Pause & resume transfers
Upload & download image
TransferManager transferManager = new TransferManager(credentialProvider);
try { PersistableDownload persistableDownload = download.pause(); //do something if we didn’t abort} catch(PauseException e) { //do something if we aborted}download = transferManager.resumeDownload(persistableDownload);
Upload upload = transferManager.upload(BUCKET_NAME, fileName, file); Download download = transferManager.download(BUCKET_NAME, mKey, file);
123
SUMMARY
Flexible and Work Better Together
Fully Integrated and easy to get started
Serverless and Scales automatically123
AWS Mobile Services
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
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)
KinesisAWS Mobile SDK
S3
Kinesis Recorder
DynamoDB Mapper
S3 TransferManager
No Backend Required
DynamoDB
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 dataAmazon DynamoDB (Object Mapper)
Stream real-time dataAmazon Kinesis (Recorder)
Run Business LogicAWS Lambda
Send push notificationsAmazon SNS Mobile Push
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
aws.amazon.com/free
RESOURCES YOU CAN USETO LEARN MORE
aws.amazon.com/mobile
mobile.awsblog.com/
aws.amazon.com/mobile/sdk
www.twitter.com/awsformobile
aws.amazon.com/lambda
aws.amazon.com/kinesis
aws.amazon.com/redshift
aws.amazon.com/architecture/
Certification
aws.amazon.com/certification
Self-Paced Labs
aws.amazon.com/training/self-paced-labs
Try products, gain new skills, and get hands-on practice working
with AWS technologies
aws.amazon.com/training
Training
Validate your proven skills and expertise with the AWS platform
Build technical expertise to design and operate scalable, efficient applications on AWS
AWS Training & Certification
Follow us fo
r more
events
& webina
rs
@AWScloud for Global AWS News & Announcements
@AWS_UKI for local AWS events & news
@IanMmmmIan Massingham — Technical Evangelist