DEV Community

Roy
Roy

Posted on

DynamoDB Pros & Cons

What is AWS DynamoDB?

AWS DynamoDB is a fast, scalable, and fully managed NoSQL database service. It provides fast and predictable performance with seamless scalability. DynamoDB enables you to offload the administrative burden of operating and scaling a highly available database. It also provides consistent performance and availability at any scale.

DynamoDB Advantages

Performance

One of the main advantages of DynamoDB over traditional relational databases is its performance. DynamoDB is designed to offer fast and predictable performance at any scale. It uses a unique partitioning scheme that allows it to distribute data across multiple servers while maintaining low latency and high throughput.

Capacity

DynamoDB uses adaptive capacity to automatically adjust capacity in response to changing traffic patterns, so you never have to worry about over provisioning or under provisioning your database.

Scalability

DynamoDB scales horizontally by adding more servers as needed to handle increased traffic. It also scales vertically by adding more capacity to individual servers. This allows DynamoDB to handle sudden spikes in traffic without sacrificing performance or availability.

Availability

DynamoDB is also a highly available and fault tolerant database service. It uses multiple Availability Zones (AZs) to replicate the data across multiple servers in different geographic regions. This ensures that your data is always available, even if one or more AZs goes down.

Fault tolerance

DynamoDB automatically fails over to a standby replica in another AZ if the primary replica becomes unavailable.

Fully Managed

DynamoDB is a fully managed service, which means that Amazon takes care of all the administrative tasks associated with running a NoSQL database. This includes patching, backing up, monitoring, and scaling the database. This frees up your time so you can focus on developing your applications instead of worrying about managing the infrastructure.

Security and compliance

DynamoDB has encryption at rest and in transit: DynamoDB encrypts your data at rest using server side encryption with an AWS Key Management Service (KMS) master key. DynamoDB also supports client side encryption, which lets you encrypt your data before you send it to DynamoDB.

Auditing

DynamoDB can streams all data changes made to your table, which lets you track activity and monitor for suspicious activity. You can also use AWS CloudTrail to log all DynamoDB API calls for further auditing.

DynamoDB Disadvantages

While DynamoDB has many benefits, such as being highly scalable and offering low latency, there are also some disadvantages to using this service.

Expensive at Scale

DynamoDB can be more expensive than other database solutions, especially when you need to scale. The reason for this is that DynamoDB is a managed service, which means that AWS takes care of all the underlying infrastructure and management for you. This is great if you're not familiar with AWS or if you don't want to worry about managing your own database, but it comes at a cost. When you need to scale DynamoDB, you're essentially paying for AWS to do all the work for you, which can add up quickly.

NoSQL Database

DynamoDB is not a good choice for workloads that require a relational database structure. This is because DynamoDB is a NoSQL database, which means that it does not support the relational database model. In addition, DynamoDB does not support foreign keys, which are necessary for defining relationships between tables in a relational database. As a result, DynamoDB is not suitable for workloads that require a complex relational database structure.

Complex Queries

DynamoDB's lack of query optimization can make it difficult to execute complex queries efficiently. For example, a query that requires a full table scan can be very slow. Additionally, DynamoDB does not support indexing, so it can be difficult to find specific items in a large table.

In conclusion, DynamoDB is a great tool for those who need a powerful database solution. However, it does have its drawbacks. If you're looking for a lighthearted and witty take on the pros and cons of DynamoDB, this is the article for you!

Star our Github repo and join the discussion in our Discord channel to help us make BLST even better!
Test your API for free now at BLST!

Top comments (7)

Collapse
 
rcls profile image
OssiDev • Edited

You should also add as a con the lack of local development options as it is proprietary software. You need a live database to develop against. Or have they made any progress in dockerizing something that could help with this?

My personal golden rule with DynamoDB is: no full scans. If you need to scan, you havent done proper planning. I've always spent time planning my primary and sort keys or perhaps secondary indexes to avoid scans completely.

Collapse
 
roy8 profile image
Roy

From what that I know DynamoDB has the option of local development, But I still looked it up and found this AWS Doc: docs.aws.amazon.com/amazondynamodb...
This is a great golden rule! I have found that DynamoDB works best when you take the time to plan out your data model ahead of time. By doing this you can avoid full scans which can be quite costly.

Collapse
 
mikeatupside profile image
Mike Lowe

Your point about data consistency would have been true four years ago, but DynamoDB does support transactions aws.amazon.com/blogs/aws/new-amazo...

Collapse
 
roy8 profile image
Roy

Thanks, I will edit it

Collapse
 
yigblst profile image
yigblst

Great article!

Collapse
 
roy8 profile image
Roy

Thanks

Collapse
 
emil profile image
Emil • Edited

You should provide data to prove your points. What means expensive at scale? Is it one million requests or only thousands. Can you provide examples?

Further you say it does not provide the concept of foreign keys. Yet this is true there a different approaches to relationships with dynamodb