Server-less Architecture on AWS - For Beginners
Server-less computing offers several advantages over traditional cloud-based or server-centric infrastructure. For many developers, server-less architectures offer greater scalability, more flexibility, and quicker time to release, all at a reduced cost. With server-less architectures, developers do not need to worry about purchasing, provisioning, and managing back-end servers.
The following advantages can be observed while working on server-less architecture:
– No server management is necessary
– Developers are only charged for the server space they use, reducing cost
– Serverless architectures are inherently scalable
– Quick deployments and updates are possible
– Code can run closer to the end-user, decreasing latency
Here is a good read about what you should know before exploring Server less Architecture using AWS Managed Services.
For the purpose of this article, I have taken hospitality startup business(likes of Airbnb) as a use case to explore how AWS Managed Services can be utilized to provide end to end solution without the business worrying of investing in large infrastructure and thus reducing the time to market.
Use Case: Accommodation options in the travel industry are not limited to hotels and resorts. People often look for home-stay options as this model benefits both the parties. Tourists can enjoy home-like comfort while owners can earn reasonable revenues on the rent.
Solution Architecture:
I have used below technical stack to deploy this solution on AWS:
- The web application front-end is created using ReactJS along with AWS AMPLIFY
- Authentication & Profile Management using AWS COGNITO
- ChatBot using LEX and AMPLIFY(Interactions)
- Static website hosting on S3 bucket
- Cloudfront for CDN
- Code repository in CodeCommit
- Backend API’s using Lambda functions(in Python) which will be triggered via API Gateway
- AWS ElastiCache for efficient Search functionality
- DynamoDB database for storing data in key-value pairs
- Static files like images, media are kept in an S3 bucket
- CloudWatch Alarms are being used for monitoring purpose
- AWS SES service for sending email notification to customers(booking details etc)
- AWS Pinpoint and Athena for analytics purpose
Technical Details:
Website hosting with API integration:
The website front end is created using ReactJs and AWS Amplify. This static website is hosted on S3 bucket and Cloudfront is integrated for caching and CDN. User Registration, Login, Password Management, Logout and Session management is achieved using AWS Cognito. LEX for creating chatbot and integrating with website using Amplify-Interactions. Front end is integrated with backend API’s deployed using API Gateway and fetching data from database via Lambda functions. AWS pinpoint is used for tracking user activity on the website and using it for analytics and notifications.
Deployment:
Code Repository Management: Website & API's repository is maintained using AWS Code Commit.
CI/CD: AWS Code Pipeline for website deployment by creating different environment(dev, stage & prod). As per deployment stage, when code gets pushed, Code Pipeline pushes it to relevant S3 bucket.
Monitoring and Metrics
Cloud Watch logs and Metrics are used for debugging and troubleshooting purpose using various tags. Alarms have been set up for proactive monitoring and sending alerts when any service reaches threshold level.
Billing
Last but not the least is the billing section. AWS provides a free tier for almost all the services used in this solution. If you have exhausted your free tier then you can set up "Budget" under "Billing" service to set your monthly expenditure limit and monitor it.
Tip: Use appropriate roles and policies under IAM for each of the service used.
And voila, your setup is done. This model provides scalability, redundancy & resiliency as per your business demands without any worry of heavy infrastructure changes, provisioning and expenditure.
That's all folks!! Thank you for reading. Appreciate your feedback :)
Strategy at EY-Parthenon| 10 years of experience in Corporate strategy, Growth strategy, Go-to-Market (GTM), Value creation, Market research, Competitive intelligence, Product & pricing strategy and Financial modeling
4 年Shreya S. Good for beginners like me to better understand Amazon Web Services (AWS). I hope many will make use of your work. Looking for more such articles from you.