in this video you're going to learn how to make cloud computing great again if you're a software developer that means you're on the Spectrum a spectrum that defines how dependent you are on big cloud platforms like AWS Google cloud and Azure on one end we have the based self Hoster this Dev does a million plus an annual recurring revenue and handles 5,000 requests per second with PHP and jQuery on a $5 FreeBSD VPS the thought of proprietary close Source software triggers their gag reflex and they pity the fools paying for Jeff beus yacht when Lambda
HTTP request at a time but at the other end of the spectrum we have the SAS Som leer this Dev bought a $200 template and now pays $20 a month for website hosting at $50 a month for postgress at $10 a month for a notetaking app and $20,000 for data dog all of which is funded by rewards credit cards instead of customer revenue and they had no idea all the things they were paying for are just rappers of AWS but being on either end of the spectrum is not ideal being two based is timec consuming
and error prone and leads to superiority complex but not being based enough allows the AWS rapper industry to enslave you which will make you poor and reduce your te count luckily there is another path a path where you leverage big cloud at optimal efficiency with amazing DX and zero vendor lockin and there are some amazing open source tools that can help us get there but first why do I even need a tool well if you go on big Cloud's website you'll look around for the right tool for the job end up deploying a massive kubernetes
cluster you don't need then forget about it and end up homeless if you're deploying on big cloud you should never do this and instead use infrastructure as code there are many tools that can get the job done with one of the most popular options being terraform but it's not open- source and requires its own special language a good alternative is palumi which itself is written in go but allows you to write your code in multiple languages like typescript python go the c or just damel taking a declarative approach like this is not only safer but
just far more efficient like in this example here I'm using palumi to create a Google Cloud virtual machine I can Define all the machine settings here like the size and operating system as well as all the network and firewall settings and anything else you can imagine all of which is strongly typed and provides intellisense right here in the IDE now if I want to deploy it I can just do pumi up and it will automatically deploy this stuff to my Google Cloud account and likewise when I want to take it down I can do that
with a single command in addition you can use their dashboard to keep track of all your projects and there's a bunch of templates for the most common use cases it's incredibly powerful but if you like palumi and also like typescript a tool you're really going to like is SST which stands for serverless Shen pans and Tom Foolery when I found out it was a rapper of palumi I thought it was just a scam but actually it's the most optimized IAC tool if you're a fullstack JavaScript developer you define all of your infrastructure and databases in
a single typescript file and what's cool about it is that they've designed specific components or recipes for all the popular Frameworks like nextjs spel kit angular and so on like if I'm deploying a spel kit app I can define a server and then link other resources to it like an S3 storage bucket and now that all that's in place I can easily reference it in my application code because it's also written in typescript we can then deploy the app with a single command or set up the SST console to deploy on get push and it
even works with Frameworks like nextjs which is notorious for trapping developers in a triangle that they can never leave it feels good to get pure uncut product by going directly to the supplier but one of the most powerful techniques to free your app from vendor lockin is containerization with Docker the sponsor of today's video we all use Docker but what you likely don't know about is Docker build Cloud a way to build Docker images way faster both locally and in continuous integration Docker is smart enough to know that when you run the build command it
should only rebuild layers that have changed and use the cach for everything else the problem is that that cash only exists on your machine with build Cloud though this cash becomes available to every machine remotely that means if Bob builds an image in Tokyo Alice can take advantage of that cash in Austin instantly but most importantly it fixes the massively annoying bottleneck of waiting for your CI server to hurry up and fail the shared cach can make complex builds 39 times faster which means more developer happiness for individuals and potentially millions of dollars saved for
a medium-sized company try out Docker build Cloud for free right now with the link below one thing that sucks about the cloud though is that it's utterly useless without an internet connection or credit card the good news is that there's a tool called local stack which emulates all the major services on AWS from a single container that you can run locally that means you can cat up and test all of your buckets lambdas and Dynamo DBS on a flight and then push them to production the moment you land that's impressive because AWS is a massive
collection of stuff you don't need and while local stack doesn't cover everything it does cover a lot of things most importantly though it's a playground where you can over engineer your architecture without any real world consequences what I like to do is first create a diagram of my architecture using a tool like cloudcraft which can visually represent different services in 3D and how they connect to one another like I might have an S3 static website which has a form that triggers a Lambda function that uploads to another bucket which triggers a resizer Lambda which triggers
the simple notification service to send an email with simple email service but to test out my prototype I can now use the AWS local CLI to create all my lambas and buckets locally but once deployed locally I can then go to the local stack dashboard and manage everything just like it was AWS I can even see my uploaded S3 files right here pretty awesome but I've saved the best for last The Encore of this video is a tool named Encore every developer should know how to use infrastructure as code tools but one drawback is that
they're totally decoupled from the code that matters your application code in a perfect world we just build an app click deploy and never worry about it and Encore gets us pretty close to that world it's a tool that can help you provision infrastructure on AWS or Google Cloud but it's also a backend application framework that allows you to write your application code in go or typescript however the infrastructure semantics are built into the application code it can do this because at compile time it creates an application model where all the resources required to run your
app are identified where you can then configure and customize them from Encore development dashboard board you get the benefits of IEC but without having to actually write the code and it automates all the other devops work like continuous integration and deployment observability tracing IM management and more it sounds too good to be true so what are the trade-offs the big trade-off is flexibility it assumes your application code is written in typescript or go that you're using a SQL database like RDS and that you adhere to OnCourse framework conventions in some cases it might be better
to keep your infrastructure code separate it's opinionated but if you agree to those terms you could save yourself thousands of hours of development time and that concludes my Ted Talk on how to make AWS not suck thanks for watching and I will see you in the next one