Did I Just Build A Faster AWS Lambda With WASM?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's good everyone I am so excited to share a project that I'm working for a project that I'm basically investigating for quite a while now and it's actually up to a point it's still rough on the edges but it's up to a point where I can give you a live demo and the project is called Raptor and it's built on top of my Hollywood actor model framework um and it basically is an a way to deploy your app to deploy any application in the cloud on the edge right so it's basically an AWS Lambda a better version of AWS L uh maybe even a better version than cloudflare workers uh fly iio and all these other um function as a service platforms and I'm going to show you um why it's basically built with wasm technology right so I'm running basically a VM I'm run I'm running wero a waso virtual machine and it's cap capable of Distributing um so Raptor built on top of Hollywood is able to distribute these VMS in a cluster right so we can scale this um to Infinity so basically how it works is very simple so it's currently supports goang and JavaScript as the languages of course more languages will be added in the future so let me open up some example yes so uh I have this uh simple JavaScript uh stuff um which basically is going to respond with an H1 from my rep replication right so and we going to deploy that so the first thing we need to do is create an um endpoint so we're going to do that with a CLI so I'm going to say uh Slash bin Raptor and I'm going to say endpoints and this endpoint is going to have a name and I'm going to call this my GS application right and the run time is going to be JavaScript right so you need to provide a run time so I'm going to press enter and it's going to respond us with an endpoint ID right so I'm going to copy this endpoint and I'm going to show you what's going to happen if we visit that uh so it's going to be a local host um uh live and I'm going to paste that in press enter so you're going to see that it's telling us endpoint does not have any publish deploys because you're going to just have uh created an endpoint you can set environment variables for your endpoint and all that stuff right so the next thing we're going to do is actually create a deploy so we're going to say uh Bin Raptors I'm going to say deploy and I'm going to uh specify for which endpoint I want to deploy this and it's going to be this endpoint did I copy this I think so boom boom and then I'm going to say uh file so I'm going to point it to a file for JavaScript you only need to specify your es uh bundled index uh specifically for goang you need to uh specify an wasm right goang you need to compile goang to wasm but JavaScript you just can give your uh GS file why because what I'm doing is I have uh a spider monkey buildt which is basically Firefox um JavaScript runtime uh for example um I think um Chrome uses V8 and Firefox uses spider monkey right so what I did is basically I compiled spider monkey to WM and what it's going to do is is it's going to spin up a runtime uh virtual uh wasm virtual machine and with that compiled spider monkey wasm blob and it's going to interpret your code right all in one batch isolated each request right so uh I'm going to specify examples y index.js I'm going to press enter so it's going to give us a deploy um ID here so if I go to my live you see that it's still uh not nothing is still there because we didn't publish it yet we only have a preview link which is the same concept that versal has if you click that you're G to see that we get a response here from my Raptor application which is a preview version uh that you can share across your colleagues or whatever or clients um and they can just view a preview version of your application right so if I'm going to deploy that uh to life I need to do uh SL bin Raptor I'm going to publish this uh I'm going to say that the deploy ID is going to be this deploy ID right I'm going to press I think I can just do this yeah and now if I go to my live version it's going to have this uh live right of course these URLs are a little bit weird but if you want to build on top of this which what I'm going to do right so I'm going to build a cloud hosted version um region based so it's can it's going to basically uh surf your applications you deploy to Raptor or whatever name is going to be the hosted version it's going to serve that on the edge right and it's all possible with Hollywoods and I will make a follow-up video where I'm going to explain how this is going to get Scaled right that's for the next video so now it's live right so that's cool um but let's say we want to do some changes right so for example I'm going to say here uh BR and I'm going to say um some other stuff here right I'm going to slbr here boom boom and now I'm going to deploy this so I'm going to go back to deploy the same file press enter so it's going to have a new deployment cre it so if I go to my live here and I'm press and I'm refreshing it's still going to be the live version but if I open up this preview link I'm going to have um some other stuff here right so uh that's cool and if I open up my other preview link it's going to stay the same right you see so you're going to have versions you can basically preview versions you can share right so now we're going to basically um deploy that to life how do we do that we're going to publish this and we going going to give this basically a new ID boom boom press enter and if I refresh that now it's live right you made a mistake that's no problem what you can do is you can basically copy the previous version and deploy that roll back your application in a blink of an eye so we're going to publish this press that refresh and it's have the previous version simple right um cool so let me basically publish back this one boom and we have the the new version live again so it's super fast it's super easy I don't think something is capable in uh an existence that can do this so fast correct me if I'm wrong of course I'm still it's still in development still Riv on the edges uh I'm going to add more Futures on top so uh hey we can also do go line right so let me open up uh applications uh go right so I have this beautiful um Chi application where I have a handle login I have a handle dashboard we're going to create a new M and then we're going to just say run uh which is this should actually be uh Raptor because I changed name so I'm going to say raptors um and I'm going to call this Raptor boom which is the SDK and you're just going to say handle pass in your router and call it a DAT right so I'm going to compile this example go make go example here I'm going to create a new endpoint right for our cooline actually to go honest let me clear the screen real quick um like that clear uh Bin Raptor uh end point uh yeah end points um name go Line app run time is going to be go press enter um this is going to be the live URL so I'm going to paste that in boom and what is this did I make a mistake I probably did Okay cool so uh endpoint does not have any uh deployments so what we going to do is we're going to create a deployment here Raptor uh deploy end point let's copy this thing here paste that in um file is going to be go ex examples Go app wasm press enter uh open up the preview link of course it's going to say page not found because we have routing so we're going to say login press enter hello from the loging Handler and we also have dashboards press enter hello from the dashboard Handler right pretty cool so let's publish this to live uh do we have a publish thing yeah that's here so I'm going to do this copy this deployment ID paste that in and then I go to my live here refresh and then now it's live and we can do login boom you see and it's from the loging Handler and we can deploy new stuff and all that things just like JavaScript that's basically it uh the stuff is this is all open source so it's basically here um in the Raptor and I will put the links down in the description it's still rough on the edges there is still the documentation is is not up to date and all that stuff but I'm just want to already share this to you right and it's built on top of Hollywood uh which is prodution ready um check that out as well so so I'm very curious to hear your opinions about this um are you going to use something like that if it's if it's in the cloud I'm going to make a hosted version um with a beautiful UI and and and all that stuff so you can with metric and log logs for your application um Su the development the developer experience will be topnotch that's actually the goal um yeah I'm also building this kind of live on my patreon page so if you want to see some more internals on how this is getting built um go to my patreon page Link in the description and for the people I want to level up that is also the full-time godev uh course I made if you really want to uh get to the details of goaling right so let me know what you think about this join the Discord Community all links in the description thanks for watching and I will follow up with a video um with how this is going to going to get Scaled in the cluster right um see you in the next one
Info
Channel: Anthony GG
Views: 8,424
Rating: undefined out of 5
Keywords: aws lambda, golang, go programming, go language, how to golang, software, software developer, software engineer, js, javascript, react, vscode, vim, neovim, coding, system design, programming, lambda, cloud computing, actor model, distributed systems, distributed computing, golang tutorial, software engineering, go programming language, golang for beginners, software development, webdev, app development, wasm, webassembly, wasi
Id: DivENcC7gbg
Channel Id: undefined
Length: 10min 25sec (625 seconds)
Published: Mon Jan 08 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.