Implementation of a Scalable Web Application using AWS Elastic Beanstalk, DynamoDB, CloudFront, and Edge Location

In this real-world project, my role involved implementing an application designed to handle high user demand concurrently. The application was deployed for a large conference with over 10,000 participants, both physically and online, from around the globe.
The event, spanning both online and in-person platforms, involved a raffle for 10 vouchers for three Cloud certifications. Over 10,000 participants registered their emails at that moment to secure their participation in the draw.
Technology Stack: To address the scalability needs and ensure easy accessibility, we utilized AWS Elastic Beanstalk for deployment, DynamoDB for email storage, CloudFront for caching static and dynamic files, optimizing accessibility through Edge Locations close to users.

Key learnings:
- How these resources are deployed step by step.
- The importance of each resource and their impact on the application performance.
- Key points, parameters, and configuration and common errors.
- A simple and robust production-level architecture.
Key highlights:
Part 1: Deploying DynamoDB + Elastic Beanstalk (EC2, SG, ELB, TG, AutoScaling…)
- Ensure VPC or default VPC is in place.
- In AWS console, create DynamoDB with a user table, specifying the partition key as “email.”
- Create an SSH key or use an existing one for EC2 interaction.
- Create an Amazon Beanstalk service, paying attention to platform, environment, and version configurations.
- Upload application code, select High Availability in presets, and create service roles for AWS Elastic Beanstalk. (This option might be off if you don’t have a VPC already).
- Set up EC2 role permissions, select VPC, configure subnets, and define Auto Scaling group parameters. Permissions should include:
· AWSElasticBeanstalkWebTier
· AWSElasticBeanstalkWorkerTier
· AWSElasticBeanstalkMulticontainerDocker
7. Set up environment properties, specifying the region where resources are deployed.
Part 2: Validating the Resources Created, Adding an Email, and AWS CloudFront
- In EBS, check the app’s running status using the provided URL.
- Enable EBS to communicate with the database by attaching the “AmazonDynamoDBFullAccess” permission policy to the EC2 role.
- Test the application to verify data storage in DynamoDB.
Part 3: Accelerating Application Access Globally using CloudFront (CDN)
- Create a CloudFront Distribution with the ELB as the origin domain.
- Configure CloudFront settings, ensuring HTTP protocol and all required methods are selected. (You might encounter error 504, if HTTP protocol is not selected.)
- Optimize caching policy and enable security protections for WAF.
- Test application access through CloudFront, verifying secure HTTPS connections.
Part 4: Stress/Overloading Test
- Verify the application and EC2 status before running stress tests.
- SSH into an EC2 instance, install stress, and run stress commands.
- Monitor EBS status and observe the scaling group’s response to the load.
- Analyze warnings and indications of 100% utilization, new instance deployment, and scaling group adjustments.
- Stop stress tests, observe cooling, and instance termination to minimize costs.


Conclusion and Key Learnings:
In conclusion, we successfully deployed multiple resources, including DynamoDB, Elastic BeanStalk, and CloudFront, within a VPC. Key learnings include the simplicity, common usage, and responsiveness of this architecture to medium-sized applications. We highlighted the utility of Elastic Beanstalk as a PaaS service for easy application testing, Autoscaling for handling spikes, and Amazon CloudFront for efficient content distribution to the nearest edge location, ensuring fast access.