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

Pratik DasPratik Das
7 min read

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:

  1. Store app data (user profiles, inventory, logs) in DynamoDB.

  2. Use Route 53 to register a custom domain and route traffic globally using the best routing policies for your use case.

  3. 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

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

Elastic Beanstalk will provision resources, create an environment, and deploy your app—all within a few minutes.

Step 6: Access Your Python App

Step 7: Manage and Monitor

Tips

Summary Table

ServiceMain UseKey Commands / Steps
DynamoDBNoSQL data storagecreate-table, put-item, get-item
Route 53DNS & domain management, traffic routingcreate-hosted-zone, record sets setup
Elastic BeanstalkApp deployment and managementeb init, 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!

0
Subscribe to my newsletter

Read articles from Pratik Das directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Pratik Das
Pratik Das