social & mobile apps journey through the cloud

55
Journey Through the Cloud [email protected] @IanMmmm Ian Massingham — Technical Evangelist Social & Mobile Apps

Upload: ian-massingham

Post on 06-Aug-2015

56 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Social & Mobile Apps   journey through the cloud

Journey Through the Cloud

[email protected]@IanMmmm

Ian Massingham — Technical Evangelist

Social & Mobile Apps

Page 2: Social & Mobile Apps   journey through the cloud

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

Page 3: Social & Mobile Apps   journey through the cloud

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

Page 4: Social & Mobile Apps   journey through the cloud

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

Page 5: Social & Mobile Apps   journey through the cloud

WHY DEVELOP MOBILE APPS ON AWS?

Page 6: Social & Mobile Apps   journey through the cloud

Enterprises & Startups Running Mobile Apps on AWS

Page 7: Social & Mobile Apps   journey through the cloud

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

Page 8: Social & Mobile Apps   journey through the cloud

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

Page 9: Social & Mobile Apps   journey through the cloud

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

λ λ λ λ

Page 10: Social & Mobile Apps   journey through the cloud

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

Page 11: Social & Mobile Apps   journey through the cloud

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

Page 12: Social & Mobile Apps   journey through the cloud

AWS MOBILE SDKAND CONNECTORS

Page 13: Social & Mobile Apps   journey through the cloud

• 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

Page 14: Social & Mobile Apps   journey through the cloud

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

Page 15: Social & Mobile Apps   journey through the cloud

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

Page 16: Social & Mobile Apps   journey through the cloud

AMAZON COGNITO

Page 17: Social & Mobile Apps   journey through the cloud

AUTHENTICATE USERS AND SAVE APP SETTINGS

Page 18: Social & Mobile Apps   journey through the cloud

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

Page 19: Social & Mobile Apps   journey through the cloud

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

Page 20: Social & Mobile Apps   journey through the cloud

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

Page 21: Social & Mobile Apps   journey through the cloud

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

Page 22: Social & Mobile Apps   journey through the cloud

SERVERLESS MOBILE BACKENDS

Page 23: Social & Mobile Apps   journey through the cloud

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

Page 24: Social & Mobile Apps   journey through the cloud

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

Page 25: Social & Mobile Apps   journey through the cloud

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

Page 26: Social & Mobile Apps   journey through the cloud

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/

Page 27: Social & Mobile Apps   journey through the cloud

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

Page 28: Social & Mobile Apps   journey through the cloud

ANALYZING USER BEHAVIOR

Page 29: Social & Mobile Apps   journey through the cloud

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

Page 30: Social & Mobile Apps   journey through the cloud
Page 31: Social & Mobile Apps   journey through the cloud

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

Page 32: Social & Mobile Apps   journey through the cloud

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

Page 33: Social & Mobile Apps   journey through the cloud

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

Page 34: Social & Mobile Apps   journey through the cloud

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

Page 35: Social & Mobile Apps   journey through the cloud

Export to S3, Process Data Anywhere

mobile client

Amazon S3

Amazon Redshift

Amazon Mobile Analytics

Hadoop/Spark Amazon EMR

Amazon Glacier

archive

batch

Page 36: Social & Mobile Apps   journey through the cloud

External data

Export to Redshift (Managed)

mobile client

Amazon S3

Amazon Redshift

Amazon Mobile Analytics

Augment your data

Page 37: Social & Mobile Apps   journey through the cloud

MOBILE PUSH NOTIFICATIONS

Page 38: Social & Mobile Apps   journey through the cloud

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

Page 39: Social & Mobile Apps   journey through the cloud

STORING AND SHARING MEDIA WITH AMAZON S3

Page 40: Social & Mobile Apps   journey through the cloud

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

Page 41: Social & Mobile Apps   journey through the cloud

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

Page 42: Social & Mobile Apps   journey through the cloud

SUMMARY

Page 43: Social & Mobile Apps   journey through the cloud

Flexible and Work Better Together

Fully Integrated and easy to get started

Serverless and Scales automatically123

AWS Mobile Services

Page 44: Social & Mobile Apps   journey through the cloud

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

Page 45: Social & Mobile Apps   journey through the cloud

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

Page 46: Social & Mobile Apps   journey through the cloud

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

Page 47: Social & Mobile Apps   journey through the cloud

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

Page 48: Social & Mobile Apps   journey through the cloud

aws.amazon.com/free

Page 49: Social & Mobile Apps   journey through the cloud

RESOURCES YOU CAN USETO LEARN MORE

Page 50: Social & Mobile Apps   journey through the cloud

aws.amazon.com/mobile

Page 51: Social & Mobile Apps   journey through the cloud

mobile.awsblog.com/

Page 52: Social & Mobile Apps   journey through the cloud

aws.amazon.com/mobile/sdk

www.twitter.com/awsformobile

aws.amazon.com/lambda

aws.amazon.com/kinesis

aws.amazon.com/redshift

Page 53: Social & Mobile Apps   journey through the cloud

aws.amazon.com/architecture/

Page 54: Social & Mobile Apps   journey through the cloud

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

Page 55: Social & Mobile Apps   journey through the cloud

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