We have been using AWS EC2 instances for a while now and recently we switched to AWS serverless architecture to build a SaaS application. It seemed a bit difficult in the beginning as we were not much familiar with DynamoDB, Lambda and the whole serverless concept. And things became easier than expected when we started to know AWS more :)
Why we switched to Serverless?
Even though we knew Serverless and success stories of SaaS companies in moving completely to serverless, we thought it would cost more than the regular servers and the implementation would be difficult. Then it was one of our customer who suggested Serverless and asked if we could build some kind of POC on top of AWS Lambda.
We did some research and learned Serverless, the basics behind and made a simple set of functions using Lambda & DynamoDB. Things started getting easier and our team got more familiar with the concepts. There were, of course, a lot of online communities and blogs for help! And now we have just finished our first product MVP completely on serverless architecture.
Here are the things we learned:
- When we say Serverless, it’s not just the backend.
It can even manage your whole front-end code (HTML, CSS, Angular, React whatever).
- The transition from SaaS to FaaS is easy.
Considering every operation as a single Function and adapting our programming structure based on that was easier than we thought.
- AutoScaling - Your Dynamo is there when you need more database capacity :)
Now with DynamoDB, you don’t have to think about things like provisioning servers, performing OS and database software patching, or configuring replication across availability zones to ensure high availability – you can simply create tables and start adding data, and let DynamoDB handle the rest.
- Cloud-watch for the rescue.
Amazon CloudWatch is a monitoring service for the applications we run on AWS. You can use Amazon CloudWatch to collect and track metrics, collect and monitor log files, set alarms, and automatically react to changes in your AWS resources. It's easy to manage and always make sure that you don't go beyond limits tracking the usage.
- Everything related to user & authentication - AWS Cognito.
Cognito can easily control user authentication, social login and access for mobile applications on internet-connected devices. In a few minutes of setup, it ensures that authentication in your application is done right. For a pricing almost negligible (Free for 50,000 active users per month).
- Zero downtime.
Zero Downtime means a site without service interruption. As in serverless everything is managed by them, you don't have to worry about service interruption, which AWS ensures to be 100%.
- Operational cost? What’s that?
One of the main reason we switched to AWS is its operational cost and low need for maintenance. Docker needs maintenance. Serverless doesn’t. And you need to pay only for what you really use, not what you think you will need.
- No. We don’t need a system admin now!
A user of a traditional server has to specify the amount of resources for the application. It still is possible to manually scale the application up or down by changing the number of assigned resources, but mostly this is the responsibility of a developer or system administrator. AWS Serverless just simplifies packaging & deployment and requires no system administration to be done. Auto scaling makes it a bit easier.
- Don’t worry about the scenes behind.
Would you believe that you just have to type a command and hit enter to deploy your code? It is that easy to manage a serverless codebase. You just have to write the code, make it work and run a command to make it live.
- 100+ AWS services in a nutshell.
S3 storage | SES | Cloudwatch | Auto scaling | Cognito | Amplify | API Gateway | Lex | IoT
What not? You will get all AWS services integrated to your application on a click.
Serverless is not yet very common in enterprise product development, might be because people think it's too complex and you won't get many resources if you are stuck. But in the future, you won’t have to worry about the server & infrastructure, as your complete software lifecycle will depend on cloud service providers. If you are enthusiastic to be in the future, here is serverless, you can just work on the business logic and coding. AWS will take care of the complete infrastructure to build that.