Slide 1

Slide 1 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Danilo Poccia Principal Evangelist, Serverless @danilop Serverless Real-Time Apps: Let’s Build a “Positive Chat”

Slide 2

Slide 2 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Serverless Real-Time What? “The WebSocket protocol enables two-way communication between a client running untrusted code running in a controlled environment to a remote host that has opted-in to communications from that code.” The WebSocket protocol Internet-Draft published by the IETF HyBi Working Group

Slide 3

Slide 3 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark HTTP protocol Client Server Request Response

Slide 4

Slide 4 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark WebSockets protocol GET /chat HTTP/1.1 Host: server.example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw== Sec-WebSocket-Protocol: chat, superchat Sec-WebSocket-Version: 13 Origin: http://example.com HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk= Sec-WebSocket-Protocol: chat Client Server Request Response WebSocket

Slide 5

Slide 5 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Serverless Real-Time Apps – There are a few options • AWS IoT without physical devices • MQTT pub/sub • AWS AppSync • GraphQL subscriptions • Amazon API Gateway • WebSocket connections New

Slide 6

Slide 6 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon API Gateway – WebSocket APIs Amazon API Gateway Connect function Web browser AWS Cloud Region WebSocket connection (stateful) Disconnect Connect By Route Key Default Disconnect function Route Key function Default function API Gateway integration (stateless) SigV4 POST @ConnectionId ConnectionId ConnectionId

Slide 7

Slide 7 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Serverless Real-Time Apps – What to build? • Chat is the mandatory example for WebSockets • Can I build something that can help be a “better” person? • Can we use AI/ML? AI services are super easy to use!

Slide 8

Slide 8 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark FRAMEWORKS AND INTERFACES ML for data scientists KERAS Frameworks Interfaces APPLICATION SERVICES ML for everyone PLATFORM SERVICES ML for engineers NVIDIA Tesla V100 GPUs (14x faster than P2) Machine Learning AMIs INFRASTRUCTURE Powering the ML Intel Xeon Skylake (Optimized for ML) A W S G R E E N G R A S S M L L E X P O L L Y R E K O G N I T I O N I M A G E & V I D E O T R A N S C R I B E T R A N S L A T E C O M P R E H E N D F O R E C A S T P E R S O N A L I Z E A M A Z O N S A G E M A K E R A W S D E E P L E N S S A G E M A K E R G R O U N D T R U T H & M E C H A N IC A L T U R K S P A R K & E M R

Slide 9

Slide 9 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What can a “Positive Chat” do? • Avoid negative sentiment • Reject negative sentences • Positive sentiment gamification • Automatically translate between different languages • Extract “topics” to improve searchability and discoverability • Create and update a chat room “tag cloud” • Search or filter messages by “tag”

Slide 10

Slide 10 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Positive Chat – Serverless architecture Amazon DynamoDB Amazon Cognito Amazon API Gateway WebSocket connection PositiveChat Lambda function Connections table Conversations table Topics table Web browser AWS Cloud S3 bucket for static assets (HTML, CSS, JS) Authentication Authorization To be implemented To be implemented Region Amazon Comprehend Amazon Translate

Slide 11

Slide 11 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Demo

Slide 12

Slide 12 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Positive Chat Demo • https://pchat.demo.danilop.net/ • https://pchat.demo.danilop.net/?room=AWSUGUK

Slide 13

Slide 13 text

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Thank you! @danilop