🗂️ Day 31 – Exploring AWS DynamoDB, Route 53, and Elastic Beanstalk

Table of contents
- 🚀 DynamoDB: AWS’s Lightning-Fast NoSQL Database
- What is DynamoDB?
- Key Features
- How to Get Started
- Creating a DynamoDB Table
- Adding an Item
- Querying an Item
- How to Migrate Data from an EC2 Instance to DynamoDB – Step-by-Step Guide
- Step 1: Launch an EC2 Instance
- Step 2: Connect to Your EC2 Instance via SSH
- Step 3: Install Git
- Step 4: Clone the Sample Repository
- Step 5: Create the DynamoDB Table
- Step 6: Migrate Data from EC2 to DynamoDB
- What’s Happening Here?
- 🌐 Route 53: AWS’s Global Traffic Router
- What is Route 53?
- How to Use Route 53
- 1. Register a Domain
- 2. Create a Hosted Zone
- 3. Record Sets
- Routing Policies
- 🚀 Elastic Beanstalk: App Deployment Made Effortless
- What is Elastic Beanstalk?
- How to Deploy Your App
- 1. Install EB CLI
- 2. Initialize Your Project
- 3. Create an Environment and Deploy
- 4. Monitor and Manage
- Elastic Beanstalk Handles:
- Workflow Example: Bringing it All Together
- Deploying a Python App to AWS Elastic Beanstalk Using the Web Console (GUI)
- Prerequisites
- Step 1: Prepare Your App Package
- Step 2: Open Elastic Beanstalk in the AWS Console
- Step 3: Create a New Application
- Step 4: Configure the Environment
- Step 5: Upload and Deploy Your Code
- Step 6: Access Your Python App
- Step 7: Manage and Monitor
- Tips
- Summary Table

Welcome to Day 31 of my #100DaysOfCloud journey!
Today, I worked with three powerful AWS services:
🗃️ Amazon DynamoDB (NoSQL Database)
🌐 Amazon Route 53 (DNS Management)
🚀 AWS Elastic Beanstalk (App Deployment & Scaling)
Each plays a crucial role in building modern, scalable, cloud-native applications. Let's break down their purpose, use cases, and a hands-on implementation.
If you're diving into the AWS cloud universe, understanding key services that handle data storage, DNS routing, and streamlined app deployments is crucial for building robust, modern applications. This post will guide you through DynamoDB, Route 53, and Elastic Beanstalk — three foundational AWS services that empower you to build fast, reliable, and scalable systems.
🚀 DynamoDB: AWS’s Lightning-Fast NoSQL Database
What is DynamoDB?
DynamoDB is a fully managed, serverless NoSQL database offered by AWS. It’s designed for high performance, scalability, and low latency, making it perfect for key-value and document workloads such as session management, user profiles, IoT data, and shopping carts.
Why DynamoDB?
Serverless: No infrastructure to manage
Seamless scaling: Handles millions of requests per second
Flexible schema: Great for dynamic data models
Key Features
Automatic scaling based on traffic and storage requirements
Built-in security with encryption at rest
Serverless architecture – pay only for what you use
How to Get Started
Creating a DynamoDB Table
You can use the AWS Console or AWS CLI. Here’s a simple example using the AWS CLI:
aws dynamodb create-table \
--table-name Users \
--attribute-definitions AttributeName=UserId,AttributeType=S \
--key-schema AttributeName=UserId,KeyType=HASH \
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
Adding an Item
aws dynamodb put-item \
--table-name Users \
--item '{"UserId": {"S": "12345"}, "Name": {"S": "Alice"}}'
Querying an Item
aws dynamodb get-item \
--table-name Users \
--key '{"UserId": {"S": "12345"}}'
Explore more: Check out the DynamoDB documentation for insights on secondary indexes, streams, and advanced use cases.
How to Migrate Data from an EC2 Instance to DynamoDB – Step-by-Step Guide
To complement your AWS learning lineup, here’s how to migrate a sample database from an EC2 instance to DynamoDB using a practical workflow. This journey takes you from launching a cloud server to data import, blending real AWS operations with hands-on commands.
Step 1: Launch an EC2 Instance
Go to the AWS Console.
Navigate to EC2 > Instances > Launch Instance.
Choose an Amazon Linux 2 AMI (or your preferred OS).
Select instance type (t2.micro is covered under free tier).
Configure network, storage, and security group (open SSH port 22).
Launch and download the key pair (e.g.,
ec2-key.pem
).
Step 2: Connect to Your EC2 Instance via SSH
Assuming you saved your private key ec2-key.pem
and your EC2 public IP is ec2-xx-xxx-xxx-xx.compute-1.amazonaws.com
:
chmod 400 ec2-key.pem
ssh -i ec2-key.pem ec2-user@ec2-xx-xxx-xxx-xx.compute-1.amazonaws.com
Step 3: Install Git
On your EC2 instance, run:
sudo yum update -y
sudo yum install git -y
Step 4: Clone the Sample Repository
Still on your EC2:
git clone https://github.com/username/Dynamodb-sample-file
cd Dynamodb-sample-file
ls
You should see sample .json
files, such as Forum.json
, ProductCatalog.json
, etc.
Step 5: Create the DynamoDB Table
From your EC2 instance (ensure you have the AWS CLI configured, with the right IAM permissions):
aws dynamodb create-table \
--table-name Forum \
--attribute-definitions AttributeName=Name,AttributeType=S \
--key-schema AttributeName=Name,KeyType=HASH \
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
Update attribute/key schema to match your sample file (e.g., Forum.json).
Step 6: Migrate Data from EC2 to DynamoDB
Use the AWS CLI to batch import data:
aws dynamodb batch-write-item --request-items file://Forum.json
Repeat for other files/tables as needed (change the table name/key schema if importing other datasets like ProductCatalog.json
).
What’s Happening Here?
EC2 instance acts as your migration server.
Git fetches data files for import.
DynamoDB table is set up to match your data structure.
AWS CLI batch-write-item loads data directly into DynamoDB with a single command.
🌐 Route 53: AWS’s Global Traffic Router
What is Route 53?
Amazon Route 53 is a highly available and scalable DNS web service. It routes user requests to infrastructure running in AWS — such as EC2, S3, or Lambda — or to infrastructure outside of AWS.
Key Advantages
Global domain registration: Register and manage domains directly within AWS.
Flexible routing policies: Simple, weighted, latency-based, geolocation, and failover routing.
Health checks: Automatically route away from unhealthy endpoints.
How to Use Route 53
1. Register a Domain
Can be done directly from the AWS Console:Route 53 > Domain Registration > Register Domain
2. Create a Hosted Zone
A hosted zone holds the DNS records for your domain.
bashaws route53 create-hosted-zone \
--name example.com \
--caller-reference "myuniqueidentifier"
3. Record Sets
Set up records like A, CNAME, or MX records to route traffic:
bashaws route53 change-resource-record-sets \
--hosted-zone-id ZXXXXXXXXXXXX \
--change-batch file://changes.json
Example changes.json
for an A record:
json{
"Changes": [{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "www.example.com",
"Type": "A",
"TTL": 300,
"ResourceRecords": [ { "Value": "192.0.2.12" } ]
}
}]
}
Routing Policies
Simple: Single resource
Weighted: Distribute traffic by percentage
Latency-based: Route users to the lowest-latency region
Geolocation: Traffic based on user location
Failover: Health-check based backups
🚀 Elastic Beanstalk: App Deployment Made Effortless
What is Elastic Beanstalk?
Elastic Beanstalk is AWS’s Platform as a Service (PaaS) that simplifies deploying web applications and services. Just upload your code – Beanstalk automatically handles everything else (provisioning, load balancing, scaling, health monitoring).
Benefits
Zero infrastructure management
Automatic scaling based on demand
Supports multiple platforms: Java, .NET, Python, Node.js, Ruby, Go, Docker, and more
How to Deploy Your App
1. Install EB CLI
pip install awsebcli --upgrade
2. Initialize Your Project
eb init
Follow the prompts to select region and platform.
3. Create an Environment and Deploy
eb create my-env
eb deploy
4. Monitor and Manage
eb status
eb health
eb open
Elastic Beanstalk Handles:
Provisioning of EC2 instances, load balancers, databases, and more
Scaling up/down based on resource needs
Health monitoring and auto remediation
Workflow Example: Bringing it All Together
Suppose you want to build a scalable web application:
Store app data (user profiles, inventory, logs) in DynamoDB.
Use Route 53 to register a custom domain and route traffic globally using the best routing policies for your use case.
Deploy your app code (Node.js/Python/etc.) via Elastic Beanstalk, letting AWS handle infrastructure, load balancing, and scaling.
Deploying a Python App to AWS Elastic Beanstalk Using the Web Console (GUI)
If you want to deploy your Python application to Elastic Beanstalk without using the command-line interface (CLI), the AWS Management Console provides an intuitive graphical interface that simplifies the process. Here’s how to do it step-by-step:
Prerequisites
AWS account: Make sure you can log in at https://aws.amazon.com/.
Python project files: Your app code as a zip file. The app should have:
An
application.py
(for Flask) or correct entry point.A
requirements.txt
listing dependencies.
Step 1: Prepare Your App Package
Organize your app's files in a folder.
Required files:
application.py
(main Flask app),requirem
ents.txt
(dependencies).Zip the entire contents (not the folder itself) into, for example,
my-python-app.zip
.
Step 2: Open Elastic Beanstalk in the AWS Console
Go to the AWS Console.
In the Services menu, choose Elastic Beanstalk.
Step 3: Create a New Application
Name your application (e.g.,
M
yPythonApp
).Optionally, add a description.
Step 4: Configure the Environment
Platform: Choose Python (for example, Python 3.9).
Platform branch and version: Select the desired version (the default is usually fine).
Step 5: Upload and Deploy Your Code
Under Application code, choose Upload your code.
Click Choose file and select your zipped app package (
my-python-app.zip
).Leave the rest of the settings as default for a simple deployment.
Elastic Beanstalk will provision resources, create an environment, and deploy your app—all within a few minutes.
Step 6: Access Your Python App
After deployment, the console shows an environment dashboard.
Click the URL displayed at the top to open your live, running app.
Step 7: Manage and Monitor
Health: View environment health on the dashboard.
Logs: Download logs if you need to debug.
Update app: To redeploy a new version, click Upload and deploy on your environment dashboard and select the updated zip file.
Tips
Use a
.ebextensions
folder inside your zip for advanced configurations if necessary.For Django apps or those needing environment variables, look under “Configuration” and use the Environment properties tab.
Summary Table
Service | Main Use | Key Commands / Steps |
DynamoDB | NoSQL data storage | create-table , put-item , get-item |
Route 53 | DNS & domain management, traffic routing | create-hosted -zone , record sets setup |
Elastic Beanstalk | App deployment and management | eb i nit , eb create , eb deploy |
Level up your AWS journey by mastering these services—and you’ll be able to build, route, and scale modern cloud apps with confidence!
Subscribe to my newsletter
Read articles from Pratik Das directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
