How to learn serverless development in 2020
#Serverless is one of the great things happened to the tech community in the recent past.
Serverless is a buzzword everywhere these days. Hundreds and thousands startups have their infrastructures setup just in the cloud and operating their SaaS (Software as a Service) businesses online.
Let’s examine what is serverless computing first and then find out what it takes to learn development serverless way in 2020.
What is #Serverless computing?
Regardless of the cloud computing providers (AWS, Azure, Google Cloud), you plan to use - programming serverless way allows you to focus on writing just the piece of logic you want to see in action.
What happens behind the hood is cloud provider runs the server and dynamically manages the allocation of machine resources. Pricing is generally based on the actual amount of resources consumed by an application, rather than on pre-purchased units of capacity and that is the biggest factor of growing cloud demands.
Why Serverless?
(1) You don’t have to beg “Infrastructure Team” to give you a hardware and the necessary infrastructures. :-]
(2) You are not worrying about the infrastructure scalability on the daily basis.
Humours aside, serverless frees you from the most menial parts of building an application, leaving us developers free to actually spend their time; their ultimate passion “beautiful code”. What this means is that you as a developer can single-handedly build apps that handle production-ready traffic and don’t have to actively manage scaling.
Where do I start?
It is very important that, you get yourself familiarize with microservices architecture first. This should be your first step towards Serverless journey.
Choose one Cloud provider under you want to build your serverless applications. Once you have chosen the cloud provider, pick the programming language that you are comfortable with.
Under serverless, you are not managing any servers, however you still need to code and hope it makes sense. Let’s talk about AWS Serverless journey in this post.
Recommended way to learn serverless should be to get your hands dirty straight in. Start from building a simple web application that AWS made available for all its serverless learners from this github repo (https://github.com/aws-samples/aws-serverless-workshops/tree/master/WebApplication). This is really a good way to start serverless in AWS.
Once you are comfortable building a simple application mentioned above, pick one serverless framework to build the same application locally; either by using Serverless framework (https://serverless.com/) or AWS SAM (https://aws.amazon.com/serverless/sam/).
AWS provides an editor in cloud called cloud9, however it is useful for learning or building a sample application or if you want to make changes online where you don’t have access to your repository.
Serverless framework or AWS SAM allows you to develop the same way, you know (except setting up configurations in serverless.yml in case of serverless framework). Using one of these frameworks makes sure that you can and you should write your unit and integration tests.
Recommendation is to build the same application you built without using any framework. One of the biggest advantages of using one of these frameworks is the ability to build and deploy your code directly in the cloud. You can test your endpoints (AWS API Gateway gives you api endpoints that your client application would consume after deployment) right after your deployment. You can automate this process too.
Once you are comfortable with any of these frameworks, you should think about building a pipeline and you should learn to continuous delivery your serverless code. AWS has got a very good hands on workshop (https://github.com/aws-samples/aws-serverless-workshops/tree/master/DevOps) where you learn about DevOps and you can build your own pipeline.
Next recommendation is to learn “how to secure your serverless app” and this should be your number one priority for any software development. Again AWS has got a very good hands on workshop (https://github.com/aws-samples/aws-serverless-workshops/tree/master/DevOps) where you learn about “secure a serverless application built with AWS Lambda, Amazon API Gateway and RDS Aurora”. Amazon Aurora is fully managed and serverless. Isn’t it amazing?
Finally, you should learn about debugging and monitoring your serverless applications in the cloud. Spend some time learning about CloudWatch (https://aws.amazon.com/cloudwatch/), CloudTrail (https://aws.amazon.com/cloudtrail/) and X-Ray (https://aws.amazon.com/xray/). X-Ray is the distributed tracing system from AWS and it is directly works with AWS Lambda.
Once you have assimilated everything mentioned above, you are good to go.
However 2020 expects you to learn AWS CDK (https://aws.amazon.com/cdk/) to keep you ahead of serverless development with continuous delivery, continuous monitoring and integration with other serverless queue system (for example SQS — Simple Queue Service) and notification systems (for example SNS — Simple Notification System).
The biggest factors to consider serverless development is (a) no infrastructure overhead (b) optimal operating cost (with serverless, you save massive) (c ) quick time to market.
Finally, practice makes a man perfect. Follow 10 things every serverless developers and architects should know https://aws.amazon.com/blogs/architecture/ten-things-serverless-architects-should-know/)
Must read AWS Serverless white paper https://d1.awsstatic.com/whitepapers/architecture/AWS-Serverless-Applications-Lens.pdf and best practices form AWS (https://d1.awsstatic.com/whitepapers/architecture/AWS_Well-Architected_Framework.pdf).
This will make sure you are ready for serverless development in 2020 without having to manage any servers.
Happy serverless development :-].