 Hello and welcome everybody to the holy web socket revival. Thank you all so much for taking the time to be here with me today Thank you to the open JS world organizers for all their hard work to amplify my work and the diverse work of all the other presenters I've only got five minutes. So let's get cracking My name is Paul chin jr. And I work at begin.com the fastest CICD platform for serverless apps in addition to developer relations for Begin I am also the prophet of the one true god of the internet Nicholas Cage and today's presentation was inspired by him I was inspired to talk about the need for true human connection and how we as web developers Can enable people around the world to collaborate like never before Now web sockets aren't new they've been around for a decade and if you aren't familiar with them They enable a persistent connection between the client and the server clients can push and receive data from the server in near Real-time your favorite chat app probably uses web sockets So what's so exciting about web sockets today? Well now we can do it serverlessly in 2018 AWS added the web socket protocol to HPI gateway Now if you're new to serverless, no problem It's an event-driven architecture that just uses cloud services to do the same things that we're already doing But with less direct management of the infrastructure. So let's take a look at this awesome diagram. There's always boxes And for the full stack of this upcoming demo, you notice that the data will flow up and down a Client opens a socket connection sends data through the API gateway that goes to different lambda functions for processing This demo only has five lambda functions that will do everything it needs to we also use Dynamo DB to persist the state of all the connections because lambda functions are stateless That's really fine because Dynamo DB is built for this kind of thing and I don't have to worry about managing connection pools or Admin keys to a database because there's cloud security policies in place that are scoped to the individual functions Let's take a quick peek at some code On the client we open a web socket with the browser API Send a message to the back end then the lambda function saves the message data iterates over all the connections and sends it back to the connected clients This way when someone joins they can get the latest state of all their connections then back on the client There's a click handler to send the new message to the server Which is saved pushed out again to all the updated clients And then when someone disconnects their connection is removed in database and another state change is pushed out to the remaining clients For a single user it looks a lot like a rest request response pattern But the magic of sockets is that it enables connections between clients See web sockets enable users to send their data to each other in a single connected Experience and that's what's important and that's what I urge all of us to explore some more So now it is time to praise cage go ahead and navigate your Favorite mobile device to bitly slash open JS 2020 and now watch as we all become cage And I know this is Pre-recorded and you're watching it right now I'm also going to be on this site and if I time this just right You're still with me Praise cage believe in the power that everybody click on the left button in one two three click left great Now one more time click on the right button in one two three click right hopefully Sometime in the future. I will see a dozen or more heads all synced in unison all together here with the power of Cage and web sockets and JavaScript Now for the sermon connections are important It's the only way that we can grow we find out exactly who we are in the relationships that we make and as web developers We have an opportunity a responsibility and a gift to make the experiences and portals for every human on the planet to connect with each other We can enhance this much-needed connection that we are all striving for right now We have the privilege to use the internet to make Connections matter to build real connections in our lives in our organizations and our communities and our businesses So thank you all you are all my national treasure This has been an absolute pleasure. There's a picture of me Please check out begin comm to spin up a serverless app in 30 seconds with only a github account. That's right You'll be using real AWS services We're always looking for contributors to architect architect is the open source serverless framework that this demo was built on and Special shout out to my hometown community Norfolk JS. I am forever grateful for their guidance and mentorship Thank you. Have a great day and praise Cage