0% found this document useful (0 votes)
18 views

AWS2

AWS DynamoDB is a fully managed NoSQL database service ideal for web and mobile applications that require high-performance data access. It offers a free tier and a straightforward setup process, along with various configuration options for table settings and data management. While it provides scalability and integration with other AWS services, users must consider its pricing complexities and data modeling challenges.

Uploaded by

Koushik r
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

AWS2

AWS DynamoDB is a fully managed NoSQL database service ideal for web and mobile applications that require high-performance data access. It offers a free tier and a straightforward setup process, along with various configuration options for table settings and data management. While it provides scalability and integration with other AWS services, users must consider its pricing complexities and data modeling challenges.

Uploaded by

Koushik r
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

AWS

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.

Creating a demo AWS DynamoDB table in the AWS Management Console is


straightforward. Here’s a detailed step-by-step guide:

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.

Step 1: Sign in to AWS Management Console

1. Go to the AWS Management Console.


2. Search for DynamoDB in the search bar and select it from the list.

Step 2: Create a DynamoDB Table

1. In the DynamoDB Dashboard, click on Create Table.


2. In the Table Name field, enter a name for your table (e.g., DemoTable).
3. In the Partition Key section:
o Enter a primary key (partition key) name (e.g., id).
o Choose the data type for the partition key (e.g., String).
4. (Optional) Add a Sort Key if you need composite primary keys. For this demo, you
can skip the sort key by leaving it unchecked.
Step 3: Configure Table Settings (Optional)

1. Table Class: For a demo, keep it as the default, Standard.


2. Read/Write Capacity Mode: Choose between the following:
o On-demand (pay per request) – Suitable for unpredictable workloads.
o Provisioned (specify read/write capacity units) – More cost-effective for
consistent workloads. (For the demo, select On-demand for simplicity).
3. Auto Scaling: Leave it enabled to automatically manage capacity if you select
Provisioned mode.
Step 4: Configure Table Encryption and other Settings (Optional)

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.

Click Create Table at the bottom to create the table.


Step 5: Adding Items to the Table

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.

For a demo, use Scan to see all items in the table.


Step 7: Clean Up (Delete the Table)

When you’re done with your demo, delete the table to avoid unnecessary charges:

1. Return to the Tables section in DynamoDB.


2. Select your table and click Actions > Delete Table.
3. Confirm deletion when prompted.
Additional Tips

• 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

1. Fully Managed: No need to manage servers or infrastructure, allowing developers to


focus on application logic.
2. Scalability: Automatically scales to accommodate variable workloads and high traffic
without downtime.
3. High Availability: Built-in redundancy and replication across multiple availability
zones ensure high availability and durability.
4. Performance: Offers low-latency responses, typically in single-digit milliseconds.
5. Flexible Data Model: Supports key-value and document data models, allowing
developers to store data in a way that suits their application.
6. Integrated with Other AWS Services: Works seamlessly with AWS Lambda, API
Gateway, and more for serverless architectures.

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

1. Cost Management: Monitoring and managing costs can be challenging, particularly


with unpredictable workloads or rapidly growing data.
2. Data Modeling: Designing the data model to fit the application’s query patterns
requires careful planning and may necessitate adjustments over time.
3. Scaling Considerations: While DynamoDB is designed to scale automatically,
managing read/write capacity units in provisioned mode can require ongoing
adjustments based on usage patterns.
4. Cold Starts with Lambda Integration: If integrating with AWS Lambda, cold starts
may introduce latency in applications with low traffic.
5. Migration Complexity: Migrating from a traditional relational database to
DynamoDB can be complex, requiring changes in application logic and data
structures.

Summary

AWS DynamoDB is a powerful NoSQL database service suitable for various


applications, especially those requiring high scalability and low latency. While it offers many
advantages, careful consideration is needed regarding its pricing model, data modeling
strategies, and potential challenges. Organizations should weigh these factors to determine if
DynamoDB is the right fit for their use case.

You might also like