Build your app with the mindset of AWS Well-Architected Framework
Introduction
AWS Well-Architected Framework is a great way to design your platform. It's a set of best practices and helps you to understand the pros and cons of your architecture. By understanding the pros and cons, you can make better decisions to reduce security risks, increase performance, and make your platform cost-effective.
There're six pillars in the AWS Well-Architected Framework. We'll review each of them and see how the Scale to Zero AWS kit is designed to be Well-Architected.
1. Operational Excellence
The operational excellence pillar focuses on adding new features, fixing bugs quickly and reliably and having eyes on the system all the time. For example, you should have a CI/CD pipeline that automatically tests and deploys your code. You should also have a monitoring system that alerts you when something goes wrong.
Scale to Zero AWS kit is designed to be Well-Architected. It has CI/CD pipeline, monitoring, logging etc. All infrastructure is coded. Automatic rollback in case of infrastructure failure.
2. Security
One of the most important concepts, yet the most overlooked one is security. This topic itself is very broad. You can start by only giving the minimum permissions to the services or the users. For example, if your lambda only reads from the DynamaoDB, only give the read permission on the command that it uses.
Read the Scale to Zero AWS kit docs to learn how to secure your root account and create environments (prod, dev) and users.
In the Scale to Zero AWS kit, all services have minimum permissions. The root account is secured and not used. Prod and Dev environments are separated.
3. Cost Optimization
You have to pay attention to this pillar unless you have some money in your pocket to burn. Two simple advice to start with:
a. Always start with setting AWS Budget Alerts. It just takes a few seconds.
b. Do the math.
In the kit, we already have the budget alerts. There's no idle resources since everything is serverless. You only pay for what you use.
4. Reliability
The reliability pillar focuses on how your system can recover from failures. For example, if your lambda fails, how can you recover it? If your DynamoDB table is deleted, how can you restore it? You should have a backup plan for everything (if possible).
In the kit, all critical services have deletion protection and backup in the prod account. Automatic rollback in case of infrastructure failure is a big plus.
5. Performance Efficiency
This pillar is about how efficiently you use the resources. Is your instance idle most of the time? Have you overscaled your resources?
Besides the money you spend, it's also a waste of resources. Serverless is a great way to achieve this pillar. Of course, the serverless architecture is not the only way to achieve this pillar, but it's a great way to start.
As the kit name suggests, it's serverless in the first place. It's continuously updated and optimized. They will also scale up and down based on the load
6. Sustainability
It's about how sustainable your platform is. For example, have you chosen a region that is close to your users? Are you using the minimum amount of hardware for your needs? If you're using EC2 instances, you can choose AWS Graviton processors to reduce the cost and increase the performance. It can be 20% cheaper compared to the x86 processors.
In the kit, all lambdas are using arm64 (for the AWS Graviton2 processor). They're faster and cheaper. Performance efficiency is also achieved.
Conclusion
AWS Well-Architected Framework is not only making your platform better but also making you a better engineer. By understanding the pros and cons of your architecture, you can make better decisions and remember to learn from your mistakes as we all do.
You can read more about the AWS Well-Architected Framework on the official AWS website.