real-time chat backend on aws iot 20160422

16
1 Real-time Chat Backend on AWS IoT Amazon Web Services Solutions Architect Akihiro Tsukada @akitsukada

Upload: akitsukada

Post on 15-Apr-2017

2.033 views

Category:

Technology


3 download

TRANSCRIPT

1

Real-time Chat Backendon AWS IoT

Amazon Web Services Solutions Architect

Akihiro Tsukada @akitsukada

2

Who am I

• @akitsukada

• AWS Startup Solutions Architect• Mobile Ninja #3

3

Real-time Chat System

• WebSocket ? Polling ?• Scalability ? • Architecture ?

4

Dispatcher pattern

http://www.slideshare.net/AmazonWebServicesJapan/socket-15753751

5

Dispatcher pattern is scalable and extensibleBut complex…

6

AWS IoTprovides managed WebSocket

( on JavaScript/iOS SDK )

Demohttp://j.mp/mogumogu_websocket

7

Simple, Scalable, Extensible

client

mobile client

8

Simple, Scalable, Extensible

client

mobile client

AmazonCognito

// <iOS> // Connect to Cognito

func application(application: UIApplication, didFinishLaunchingWithOptionslaunchOptions: [NSObject: AnyObject]?) -> Bool {

AWSLogger.defaultLogger().logLevel = .Verbose

// Initialize AWSlet credentialsProvider = AWSCognitoCredentialsProvider(

regionType: .APNortheast1,identityPoolId: CognitoIdentityPoolIdForTokyo)

let configuration = AWSServiceConfiguration(region: .APNortheast1,credentialsProvider: credentialsProvider)

AWSServiceManager.defaultServiceManager().defaultServiceConfiguration= configuration

return true}

9

AWS IoT

Simple, Scalable, Extensible

IoTtopic

client

mobile client

AmazonCognito

// Subscribe to TopiciotDataManager.connectUsingWebSocketWithClientId(NSUUID().UUIDString, cleanSession: true) { (mqttStatus:AWSIoTMQTTStatus) -> Void in

switch mqttStatus {case .Connected:

self.iotDataManager.subscribeToTopic(TopicName,qos: 0,messageCallback:

{ (data:NSData!) -> Void in// received!

})

default:print(mqttStatus.rawValue)

} }

// Send messageiotDataManager.publishString(textField.text, onTopic: TopicName)

10

AWS IoT

Simple, Scalable, Extensible

IoTtopic

client

mobile client

AmazonCognito

IoTrule

RuleActions

ex)SELECT * FROM 'Test/Topic’WHERE temperature > 75

11

AWS IoT

Simple, Scalable, Extensible

IoTtopic

client

mobile client

AmazonCognito

IoTrule

AmazonDynamoDB

Amazon CloudWatch

AWSLambda

AmazonS3

Amazon Kinesis

AmazonSQS

AmazonSNS

alarm

Amazon Elasticsearch

Service

RuleActions

ex)SELECT * FROM 'Test/Topic’WHERE temperature > 75

IoTtopic

12

AWS IoT

Simple, Scalable, Extensible

IoTtopic

client

mobile client

AmazonCognito

IoTrule

AmazonDynamoDB

Amazon CloudWatch

AWSLambda

AmazonS3

Amazon Kinesis

AmazonSQS

AmazonSNS

alarm

Amazon Elasticsearch

Service

RuleActions

ex)SELECT * FROM 'Test/Topic’WHERE temperature > 75

Mobile Push

IoTtopic

13

Simple, Scalable, Extensible

14

One more thing…

15

http://www.slideshare.net/AmazonWebServicesJapan/aws-summit-chicago-2016

Over 10 new features @ AWS Summit Chicago !!

16

Thanks !!Amazon Web Services Solutions Architect

Akihiro Tsukada @akitsukada