DEV Community

Sid Mustafa
Sid Mustafa

Posted on • Originally published at sidmustafa.substack.com on

Scaling Heights: The AWS Adventure of Zoe and Liam πŸš€

[

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70547afd-b9a9-47bc-84b6-9e662026f554.heic)

Introduction: 🌟 Hey Tech Enthusiasts! Meet Zoe and Liam, two dynamic software engineers on a mission to scale their innovative app to 10 million users using AWS. Join us on their thrilling journey, filled with tech challenges and AWS solutions.

πŸ” TL;DR: This story will take you through Zoe and Liam's scaling saga from a simple MVP to a robust app serving millions, all while leveraging AWS's powerful capabilities.

1. The Dream Begins: Prelaunch Phase

Zoe and Liam had a groundbreaking app idea. In the prelaunch phase, they built a buzz-generating launch page using AWS Amplify, enjoying hassle-free hosting and zero operational costs. AWS Amplify's ease of use allowed them to focus on their MVP's core features while ensuring a smooth user experience.

[

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52c0bb16-d299-4e07-a6c1-6793e4ec17f2_1089x465.png)

2. The Big Launch

The D-day arrived, and they launched their MVP. Initially, user traffic was low, so they managed with a single Amazon EC2 instance, handling both the database and backend. They cleverly used Elastic IP and Amazon Route 53 for efficient DNS management. However, they soon realized the need for more storage and upgraded to a larger instance type for vertical scaling.

[

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0ece283-55c6-4b16-b046-c2e47656a4b0_1103x463.png)

3. The First Hurdles: Ten Users

As user numbers grew, Zoe and Liam faced memory constraints with their EC2 instance. They quickly adapted by separating the database and backend onto different EC2 instances, choosing an SQL database for its robust community support and scalability up to 10 million users.

[

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd25c84a-ea9b-44ad-a913-da68aeae560f_800x768.png)

4. Expanding Horizons: Thousand Users

Then came a challenge – a power outage in their server's availability zone. They swiftly added another server in a different zone and implemented leader-follower replication for their database, ensuring high availability and resilience.

[

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd031dff6-705b-4b48-b416-19d43f322063_1122x800.png)

5. Scaling Up: Ten Thousand Users

With a surge to ten thousand users, the duo opted for horizontal scaling. They made their backend stateless, shifting session states to ElasticCache, and added more servers behind the load balancer. To tackle read bottlenecks, they cached popular database reads in ElasticCache.

[

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd61ff3fa-4fbc-4e87-9040-952294bfd305_1107x195.png)

ElasticCache is a managed Memcached or Redis.

[

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F685fee89-7cea-408b-89be-5650fed0d5a7_1096x298.png)

They also moved static content to Amazon S3 and CloudFront to reduce the server load. The static content is CSS, images, and JavaScript files.

[

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F621de4c6-9bbd-416f-9cf2-402c41c50d3e_1102x154.png)

They reduced latency by caching data in CDN at edge locations.

A content delivery endpoint in a CDN network is called an Edge Location.

[

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d7370e1-584d-4550-a1eb-7c8c3fcfb17f_1120x803.png)

6. The Leap: Half a Million Users

As they hit half a million users, Zoe and Liam aimed for a 99.99% SLA. They replicated servers across multiple zones, offloaded session data to DynamoDB, and fully utilized server capacity. DynamoDB's NoSQL nature was perfect for their needs.

[
Monolith vs Microservice

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1d03e9d-082d-4cea-a63f-b747962d10a1_1106x810.png)
Monolith vs Microservice

The next step was to move to a microservices architecture because they wanted to be able to scale services independently.

[

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefacaac5-b116-495f-adf6-83c86313a6c5_1111x143.png)

With load balancers between each layer to scale out.

[

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe278d30b-c53e-4b76-a034-aae000226666_1107x115.png)

They used AWS CloudFormation (This could just as easily have been something like Terraform) to create a template of the stack because it helps reduce the operational complexity.

7. The Peak πŸ”οΈ: Ten Million Users

Upon reaching 10 million users, database writes became a bottleneck. They tackled this by federating and sharding their database. They also extended their system across AWS regions, optimizing for high availability and scalability.

[

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d4b53f2-cd2b-4d2a-921b-438f44ee3673_1089x243.png)
They federated the DB based on business domain

[

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a7a30a0-a666-49d6-ac3c-9805044fcf67_1101x255.png)
Then split datasets across many servers to scale out..

For some compliance requirements, high availability and scalability, they also extended the system across many AWS regions.

AWS encompasses a global network comprising 32 regions and a total of 102 availability zones.

The AWS infrastructure is segmented into regions and availability zones for scalability. A region denotes a specific geographical location containing data centers. Every region is equipped with multiple availability zones.

An Availability Zone within a region can be a singular data center or a cluster of data centers.

Availability Zones are designed with isolated networking and power sources to ensure enhanced availability and reliability.

[

](https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb73ea72-8467-499a-bd39-3fb31480d3a9.heic)

Sky's the Limit with AWS

Zoe and Liam’s journey from a small startup to a major player demonstrates the power of AWS in scaling applications. Their story is a testament to how with the right tools and a bit of ingenuity, any dream can reach stellar heights.

πŸ“£Inspired by Zoe and Liam’s story? Start leveraging AWS for your projects and scale your dreams to new heights! Share your thoughts and experiences with AWS.

Leave a comment

Subscribe now


πŸš€ I provide an Engineering-Leader-as-a-Service to StartUps and ScaleUps

πŸ…I mentor aspiring and experienced Engineering Leaders

πŸ‘‰ View my profile to find out more: Serdar Mustafa's LinkedIn

Refer a friend

Share

Top comments (0)