leadership session: innovations in mobile

66

Upload: others

Post on 13-Jun-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Leadership session: Innovations in mobile
Page 2: Leadership session: Innovations in mobile

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Leadership session: Innovations in mobile & web app development

Mohit Srivastava

M O B 3 0 6 - L

Senior Manager, PM

Amazon Web Services

Richard Threlkeld

Senior Engineer

Amazon Web Services

Frank Sconzo

Distinguished Software Engineer

Dow Jones

Alexander Graebe

Head of DX

HyperTrack

Page 3: Leadership session: Innovations in mobile

The market is growing. How will you innovate?

Mobile internetusers by 2025

Apps abandonedafter first use

Apps publishedto global app stores

you need to competewith for mindshare

Monthly mobile datausage per subscriber

by 2024

Daily time onmobile per user

Source: GSMASource: GSMA Source: Mary Meeker’sInternet Trends 2019

Page 4: Leadership session: Innovations in mobile

To meet and exceed user expectations, the modern mobile/web app must solve numerous challenges

Platform(s)

Native mobile and web app?

Differentiation

Innovative & new ways to interact

How can your app stand out?

Screen & mobility

Responsive & progressive

Always available, even offline

Security

AuthN and AuthZ by default

Data layer

Instantaneous, with real-time feedback

Network friendly (less calls / more data / just right)

Time to market

Iterative, full stack development

Developer productivity & team workflows

Page 5: Leadership session: Innovations in mobile

AWS provides developers the capabilities to exceed user expectations

Page 6: Leadership session: Innovations in mobile

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 7: Leadership session: Innovations in mobile

AWS Amplify overview

Broad support for the most popular OS platforms and frameworks

Developer tools for building, testing, deploying, and hosting the entire app –frontend and backend

The Amplify Framework, an open-source client framework, includes libraries, a CLI toolchain, and UI components

The CLI toolchain enables easy integration with AWS services such as Amazon Cognito, AWS AppSync, and Amazon Pinpoint

Page 8: Leadership session: Innovations in mobile

Amplify Framework

✓ Open-source(top 5 fastest growing project on GitHub)

✓ Opinionated

✓ Categories-based high-level abstractions

✓ Declarative

✓ Best practices built-in

✓ Escape hatches

Page 9: Leadership session: Innovations in mobile

Amplify Framework

Analytics

Track user sessions, custom

user attributes and in-app

metrics

API

HTTP requests using REST

and GraphQL with support

for real-time data

Auth

AuthN + AuthZ library with

prebuilt UI components for

your app

DataStore

On-device persistent storage

that automatically

synchronizes data between

you apps and the cloud

Interactions

Conversational bots

powered by deep learning

technologies

PubSub

Connect your app to

message-oriented

middleware on the cloud

Notifications

Push notifications with

campaign analytics and

targeting

XR

Work with augmented

reality and virtual reality

content in your apps

Predictions

Add MI/ML capabilities to

your app powered by cloud

services

Storage

Manage user content securely

in public, protected, and

private storage

Lau

nch

ing

th

is w

eek

Page 10: Leadership session: Innovations in mobile

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 11: Leadership session: Innovations in mobile

Amplify Clients

Use-case centric

Declarative abstractions

Xcode/Android Studio integration

(E.g., Storage.put())

AWS Mobile SDKs

AWS service-centric

Low-level generated

(E.g., AWSS3TransferUtilityUploadExpression)

Both can be used in the same app

What’s new?

Page 12: Leadership session: Innovations in mobile

import Amplify

let storagePlugin = AWSS3StoragePlugin()try! Amplify.add(plugin: storagePlugin)

Amplify.Storage.putData(key: filename, data: uploadData, options: options)

pod ‘amplify-tools’

pod ’Amplify’

pod 'AmplifyPlugins/AWSS3StoragePlugin'

Setup (Cocoapods)

Usage

Amplify iOS

Page 13: Leadership session: Innovations in mobile

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 14: Leadership session: Innovations in mobile

✓ Easily add AI/ML use cases powered by Amazon AI/ML services

✓ No machine learning experience required

✓ Few lines of code

✓ Support for custom models through Amazon SageMaker

✓ Apple CoreML Vision Framework support for iOS

✓ @predictions to orchestrate multiple AI/ML actions using GraphQL

Predictions category

Amplify iOS

Page 15: Leadership session: Innovations in mobile

Predictions category use cases

✓ Translating text

✓ Text to speech

✓ Text recognition

✓ Entities recognition

✓ Label real-world objects

✓ Interpretation of text

✓ Uploading images for automatic training

✓ Transcribing text

Amplify iOS

Page 16: Leadership session: Innovations in mobile

CoreML Models

Pre-trained Models

Amplify iOS: Predictions

Union of result sets that have the highest accuracy

Network connectivity detection seamlessly switches between online and offline inferences

Amplify iOS: Predictions

Page 17: Leadership session: Innovations in mobile

Amplify Framework: Other recent launches

• New “amplify pull” for pulling down backend updates

• Local mocking

• Create sandboxes or share your Amplify project with multiple teams using environments

• Easily set up fine-grained permissions on groups and add user management to your app

• New authentication features for iOS- and Android-native apps

• Add Lambda functions or custom indexes for your Amazon DynamoDB tables with the @function and @key directives in the GraphQL Transform

Page 18: Leadership session: Innovations in mobile

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 19: Leadership session: Innovations in mobile

AWS Amplify Console

Page 20: Leadership session: Innovations in mobile

AWS Amplify Console

Page 21: Leadership session: Innovations in mobile

Amplify Console: Full-stack deployments (new)

Page 22: Leadership session: Innovations in mobile

Amplify Console: Full-stack deployments (new)

Page 23: Leadership session: Innovations in mobile

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 24: Leadership session: Innovations in mobile

AWS AppSync: Real-time and offline data with GraphQL

Real-time

collaboration

Fine-grained access

control

Offline

programming model

with sync

Multiple data

sources

HTTP Data Source

Page 25: Leadership session: Innovations in mobile

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 26: Leadership session: Innovations in mobile

Modern app requirements

Low-latency messages

- Banking alerts

- News stories

- Multi-player games

- Chat applications

- Shared whiteboards

- AR/VR experiences

- Document collaboration

Offline sync

- Financial transactions

- New articles

- Games

- Chat

- Document collaboration

Page 27: Leadership session: Innovations in mobile

Mental model: App data

Page 28: Leadership session: Innovations in mobile

Amplify DataStoreIntroducing

Multi-platform (iOS/Android/React Native/Web) on-device persistent

storage engine that automatically synchronizes data between

mobile/web apps and the cloud using GraphQL

Page 29: Leadership session: Innovations in mobile

Data modeling with GraphQL

Page 30: Leadership session: Innovations in mobile

Amplify DataStore API

Page 31: Leadership session: Innovations in mobile

Amplify DataStore architecture

Page 32: Leadership session: Innovations in mobile

DataStore provisioning workflow

Page 33: Leadership session: Innovations in mobile

GraphQL powers Amplify DataStore

“Sync-enabled Resolvers”

Conflict Detection

Conflict Resolutiona) Optimistic Concurrency

b) Lambda

c) Automerge

Page 34: Leadership session: Innovations in mobile

ds_pk ds_sk Name Title … _lastChangedAt _TTL

Post-xxx2019 02:12:07.123:1 Nadia Hello World 1541884315162 1541884320

Post-yyy2019 24:11:07.2:1 Pancho I’m Sleepy 1541884359527 1541884364

Post-zzz2019 24:11:07.3:3 Shaggy Running in the

park

1541884404015 1541884409

ID Name Title …

123 Nadia Hello World

2 Pancho I’m Sleepy

3 Shaggy Running in

the park

Sync-enabled resolver

createPost(input: CreatePostInput!): Post

GraphQL schema

DataStore.save(new Post(Name:”Nadia” Title:“Hello World” )

);

Page 35: Leadership session: Innovations in mobile

Automerge

Page 36: Leadership session: Innovations in mobile

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Richard Threlkeld

Senior Engineer

Amazon Web Services

Page 37: Leadership session: Innovations in mobile

AWS AppSync: Other recent launches

• Server-side caching (new) capabilities for any supported data source, improving the performance of latency-sensitive and high-throughput applications

• Local mocking, run AppSync in your laptop using the Amplify CLI

• Multi-authorization, define multiple authorization providers for fields, types and operations directly from the GraphQL schema

• Visualize your API activity (latency, frequently invoked resolvers, top requests, etc.) with the CloudWatch Log Insights integration

• Generate a GraphQL schema based on an Aurora Serverless SQL database

• Invoke any AWS service from AWS AppSync using HTTP resolvers

Page 38: Leadership session: Innovations in mobile

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Frank Sconzo

Distinguished Software Engineer

Dow Jones

Page 39: Leadership session: Innovations in mobile

Agenda

Business overview

• Introduction

• News planning

• Design sprints

• NewsGrid demo

Technical implementation

• Why AWS AppSync?

• Technology stack

• Architecture diagram

• Authentication/authorization

• Summary

Page 40: Leadership session: Innovations in mobile
Page 41: Leadership session: Innovations in mobile

News planning

Page 42: Leadership session: Innovations in mobile

News planning: personas

Page 43: Leadership session: Innovations in mobile

News Planning – A Wider View

EdGeorge

Isabel

Carol

Joanna

Fran

AthensNY

Helen

Dave Bob

Alice

News staff communication

Page 44: Leadership session: Innovations in mobile

Design sprint summary

Notify me when something changes

Maintain tight control at first Find “what I’ve worked on”

Who has touched “stuff I’ve worked on”?

Page 45: Leadership session: Innovations in mobile

Design sprint summary

Notify others and collaborate Work from my mobile device

Organize media in one tool

+++

Page 46: Leadership session: Innovations in mobile

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 47: Leadership session: Innovations in mobile
Page 48: Leadership session: Innovations in mobile

Why AWS AppSync?

Helpful toolingBuild quickly

Scale as needed

Lightweight payloads

Support unique client use cases

Page 49: Leadership session: Innovations in mobile

us-west-2 (Oregon)

us-east-1 (Virginia)

Amazon Simple

Storage Service

Amazon EC2

Auto Scaling

Amazon Cognito

Elastic Load

Balancing

ReactJS

Application

Amazon

Route 53

Amazon EC2

Amazon EC2

Amazon

DynamoDB

AWS Lambda AWS Lambda

AWS Lambda

AWS Lambda

Amazon Elasticsearch

Service

AWS AppSync

subscription events mutationsqueries

searches

reorder

clearEvent

synchronize

events & history

validate jwt

crea

teH

isto

ry m

uta

tio

n

up

da

teS

tory

mu

tati

on

clea

rEven

t m

uta

tio

n

Dow Jones APIs

NewsCorp Okta

global table replication

Architecture

Page 50: Leadership session: Innovations in mobile

Authentication: AWS AppSync

Types of authorization

• API_KEY

• AWS_IAM

• OPENID_CONNECT

• AMAZON_COGNITO_USER_POOLS

NewsGrid default authorization mode

• Amazon Cognito user pool

• AWS AppSync pool Id matches AWS ALB pool Id

• Leverages JWT set by AWS ALB

Additional authorization mode

• AWS Identity and Access Management for AWS Lambda

Page 51: Leadership session: Innovations in mobile

Authentication: additional providers

Schema annotations

Lambda execution role

type Story @aws_iam @aws_cognito_user_pools {

storyId: ID

slug: String!

}

type Query @aws_iam @aws_cognito_user_pools {

getStory(storyId: ID!): Story

}

{

"Effect": "Allow",

"Action": [ "appsync:GraphQL” ],

"Resource": ["arn:aws:appsync:<region>:<accountId>:apis/<apiId>/types/Query/fields/getStory" ]

}

Page 52: Leadership session: Innovations in mobile

Authentication: AWS AppSync resolver

{

“version”: “2018-05-29”

“operation”: “PutItem”

#if ( $ctx.identity )

#set ( $parts = $ctx.identity.username.toLowerCase().split("_", 2) )

#set ( $userName = $parts[1] )

#set ( $providerName = $parts[0] )

#else

$util.unauthorized()

#end

}

Page 53: Leadership session: Innovations in mobile

Summary

Page 54: Leadership session: Innovations in mobile

AWS AppSync: New real-time features

• Pure WebSockets support for GraphQL subscriptions

• Higher maximum payload size (240 KB vs. 128 KB)

• Enhanced connection and broadcast rates

• CloudWatch Metrics

• Selection set filtering

Page 55: Leadership session: Innovations in mobile

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Alexander Graebe

Head of Developer Experiences

HyperTrack

Page 56: Leadership session: Innovations in mobile

Live location as a service

Page 57: Leadership session: Innovations in mobile

RedBus built ride-sharing with HyperTrack

Page 58: Leadership session: Innovations in mobile

Seven Lakes built Just-in-Time Resourcing with HyperTrack

Page 59: Leadership session: Innovations in mobile

A&B Courier-Built Delivery Management with HyperTrack

Page 60: Leadership session: Innovations in mobile

Real-time, serverless, and multi-tenant

Views Components SDKs

Page 61: Leadership session: Innovations in mobile

Event stream ingestion

Day in the life of a live location

HyperTrack

SDK JWT authGateway Event stream ConsumeRaw events

Core processing

Process SnapshotProcessed events

Snapshots

1 2

3

Page 62: Leadership session: Innovations in mobile

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

“I took a bite off the falafel wrap with my left hand and searched Google for ‘connect dynamodb with react graphql’ with my right. Out came AWS AppSync.”

Alexander Kishinevsky

VP of Engineering

Page 63: Leadership session: Innovations in mobile

REST APIs

Day in the life of a live location (continued)

Basic authGateway Transformation

Consumer

backend

Notification

Components

GraphQL APIs

AWS AppSync

4

5

Amazon

Cognito

Snapshots

3

SDKs

Page 64: Leadership session: Innovations in mobile

Focus on what you do best, let AWS do the rest

Page 65: Leadership session: Innovations in mobile

Thank you!

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Mohit Srivastava

Twitter: @mohit

Richard Threlkeld

Twitter: @undef_obj

Page 66: Leadership session: Innovations in mobile

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.