Until almost a year back, I had not heard of term “Serverless Architecture”. I had been using services like AWS Lambda (one of the biggest contributor in the success and ongoing movement of serverless architecture) and other services like AWS DynamoDB, AWS Elastic Map Reduce (EMR)and many more similar services, however, I didn’t encounter with this term. I had been aware that these services and their features like auto scaling and cost effective at the same time. So with this post, I would try to share my experiences of using serverless architecture in the context of backend development and deployment of related services. I will primarily focus on AWS as cloud service provider. However, the underlying concepts will remain same.
How I started with Serverless for backend services development
In order to architect a website front end and back end, I had been exploring various available options. For front end, the obvious options were angular and react among many other. However, because client wanted to have react based solution, so react was finalized for front end. Coming to backend, the nodejs was selected. Now, the discussion started to use AWS Lambda versus traditional express based middle ware. I was astonished to hear that AWS Lambda functions can act as a backend (despite I used Lambda functions in the context of big data processing etc.). That led me to start exploring serverless. Thereafter, I decided to use serverless as the preferred architecture for backend development.
My findings
This section highlights my findings in terms of tools and other related information which one should know to start working in serverless. There were couple of options available. One was to use AWS SAM (Serverless Application Model)and another to use servereless framework from serverless ( a widely popular framework) itself. I zeroed on serverless framework. This was opted based on number of parameters like easy learning curve, ease of setting up the development environment on desktop/laptop, ease of deployment to name a few. I’ve found that developers are reluctant and hesitant to use servereless framework for one reason or the other. Some of these are discussed in next section.
My Challenges
There were many challenges faced. However, listing down some main challenges which will be detailed along with possible solutions in future articles.
- Setting up the local development environment as either developers are not aware of the developments in this space. It is a lot easy now to setup serverless framework on laptop/desktop. It has been available as couple of npm packages for nodejs developer and support is available for other languages as well. I’ll try to cover this part (setting up it on laptop/desktop) in a separate article. If a developer desires to opt for AWS SAM on windows machine with local testing of lambda functions, it may be a little difficult (as there is a requirement of having docker installed that too on MS windows 10).
- Deployment of code if you are using serverless is another challenge. The first part was to get convinced myself. Then, to convince others that it was easy and quick to deploy serverless functions than traditional way of deploying lambda functions. Details in future article.
- Handling resource limit of 200 resources on AWS. This was also sorted out with some research on internet. A lot of people have faced similar issue and suggested ways to overcome this issue. Details in future article.
Conclusion
I hope that you might have found this article useful. This could be an add on in your knowledge repository. Please share your valuable feedback. This will encourage me to write more on my experiences and knowledge gained over years. Thank you so much for reading thus far and look forward for your views in future articles. You may like to view my other articles on other topics.
Further Reading:
https://www.serverless.com/ documentation and blogs
https://aws.amazon.com/lambda/serverless-architectures-learn-more/