🔷 What is DynamoDB?
Amazon DynamoDB is a fast and serverless NoSQL database provided by AWS.
It is used to store and manage data in the cloud without worrying about servers.
💡 Where is DynamoDB used?
Online apps (like Flipkart, Amazon)
Student complaint form systems
Chat apps
Game leaderboards
IoT sensor data storage
🌟 Main Features:
Feature Meaning
🔥 Very Fast Can handle thousands of requests per second
☁️ Serverless No need to manage servers, AWS does it for you
📄 NoSQL Database Stores data like JSON (key-value format)
💳 Pay Only When Used You pay only for the storage and read/write actions you use
🔒 Secure Works with AWS security like IAM and encryption
📁 How is Data Stored?
DynamoDB uses tables to store data.
Each table has:
Primary Key (Partition Key) – to uniquely identify each item
Optional Sort Key – to organize related data
Example table:
complaintId studentId complaintText status priority
123 S001 "Water problem in hostel" Pending High
🔄 Common Operations:
Action What it does
PutItem Add a new item to the table
GetItem Read an item by its key
UpdateItem Change an existing item
DeleteItem Remove an item
Query Find multiple items with filter
Scan Read everything in the table (slow)
🧪 Example in Python:
python
Copy
Edit
import boto3
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('ComplaintsTable')
table.put_item(Item={
'complaintId': '123',
'studentId': 'S001',
'complaintText': 'Water problem in hostel',
'status': 'Pending',
'priority': 'High'
})
✅ How to Use DynamoDB (Simple Steps):
Go to AWS Console → search "DynamoDB"
Click “Create Table”
Give a name (like ComplaintsTable)
Add a primary key (e.g., complaintId)
Click Create and start using it!
🧠 Summary:
DynamoDB is a fast, serverless, NoSQL database on AWS.
It stores data in tables (like Excel rows).
You don’t need to manage servers.
Used in real-time apps.
Works well with AWS services like Lambda, API Gateway, etc.