AWS2
AWS2
DynamoDB
AWS DynamoDB
This is a NoSQL database service that is fully managed and scalable. It’s ideal for web and
mobile applications requiring high-performance data access. The free tier provides 25 GB of
storage and 25 Write/Read Capacity Units, which is enough for lightweight.
Prerequisites
1. AWS Account: Make sure you have an AWS account. If not, sign up here.
2. IAM User: Log in with an IAM user with permissions to create and access
DynamoDB. Avoid using the root account for security purposes.
1. Encryption: DynamoDB tables are encrypted at rest by default. You can use the
default AWS-owned key.
2. Point-in-time Recovery: Enables backup and recovery for your table data.
3. TTL (Time to Live): Set a TTL attribute to automatically delete items after a certain
period (optional for the demo).
4. Tags: Optionally, add tags to organize and manage your AWS resources.
1. After the table is created, you’ll see a summary screen with information about the
table.
2. Go to the Items tab, and click Create Item.
3. A JSON editor will open, or you can use the default form view.
o Add an item with the id attribute you defined as the partition key.
o Add additional attributes, such as Name or Description.
o Click Save to add the item to your table after you add the attribute to the table.
Step 6: Querying and Scanning the Table
1. In the Items tab, click on Actions and choose between Query or Scan.
o Query: Searches based on partition key and (optionally) sort key.
o Scan: Retrieves all items in the table, useful for small tables or testing.
When you’re done with your demo, delete the table to avoid unnecessary charges:
• AWS SDK: If you want to interact programmatically with DynamoDB, use the AWS
SDK in languages like Python (boto3), JavaScript, or Java.
• Indexes: You can add Global Secondary Indexes (GSI) and Local Secondary
Indexes (LSI) to support additional query patterns. These are optional but useful for
more complex use cases.
This setup gives you a basic DynamoDB table and lets you add and view items, perfect for
experimenting with DynamoDB’s core features.
Payment-Related Information
1. Pricing Model:
o On-Demand Pricing: You pay per request for read and write operations. This
is ideal for applications with unpredictable traffic. Charges are based on the
number of read and write requests.
▪ Read Operations: Charged per read request unit (RRU) for eventual
consistency and double for strongly consistent reads.
▪ Write Operations: Charged per write request unit (WRU).
o Provisioned Capacity Pricing: You specify the number of read and write
capacity units you need. You are charged for the provisioned capacity,
regardless of usage.
▪ Storage Costs: Charged based on the amount of data stored (per GB
per month).
▪ Data Transfer: Charges for data transferred out of DynamoDB to the
internet or other AWS regions.
o Free Tier: Offers 25 GB of storage, 25 write capacity units, and 25 read
capacity units for the first 12 months for new accounts.
2. Additional Costs:
o DynamoDB Streams: Charges apply if you use DynamoDB Streams for
change data capture.
o Backup and Restore: Charged per GB for backup storage and restore
operations.
o Global Tables: Extra charges apply if you use multi-region replication.
Use Cases
1. Web Applications: Storing user sessions, profile data, and application state.
2. Mobile Applications: Backend data storage for mobile apps, including user data and
application logs.
3. IoT Applications: Managing time-series data from connected devices.
4. Gaming: Storing player profiles, game state, and leaderboards.
5. Real-Time Analytics: Storing and analyzing data in real-time for applications like
recommendation engines or fraud detection.
Advantages
Disadvantages
1. Cost Complexity: Pricing can be complex and may become expensive as the
application scales, especially with unpredictable workloads.
2. Limited Querying Capabilities: Supports simple queries, but complex querying and
transactions can be challenging compared to traditional SQL databases.
3. Eventually Consistent Reads: While eventual consistency can be beneficial for
performance, it may not be suitable for all applications requiring immediate
consistency.
4. Data Modeling: Requires careful planning and understanding of access patterns to
create efficient data models.
Challenges
Summary