Skip to content

AWS DynamoDB

Author: Elias Ekornås <https://imdev.no>

aws-dynamoDB

Introduction

AWS DynamoDB is a managed Non-Relational Database (NoSQL) service provided by Amazon Web Services (AWS). It was designed to offer a highly scalable, fully managed, and low-latency database solution for developers and businesses needing to handle large amounts of data and high traffic loads.

Brief History

In the mid-2000s, Amazon.com’s exponential e-commerce growth posed a challenge, which was managing and scaling their database infrastructure. Traditional relational databases struggled with the vast data and traffic generated. Amazon sought a solution delivering high performance, scalability, and reliability.

In 2004, Amazon engineers acknowledged the need for a novel database to meet scalability demands. They came up with an internal system named “Amazon Dynamo,” designed for high availability, fault tolerance, and consistent performance despite hardware failures or network issues.

In 2007, Amazon’s engineers unveiled their work in a paper titled “Dynamo: Amazon’s Highly Available Key-value Store.” This publication outlined Dynamo’s construction principles, attracting significant attention in tech circles. It fueled discussions on distributed databases, NoSQL, and database scalability.

Recognizing growing interest in scalable, available databases, Amazon leveraged their technology for external use via Amazon Web Service (AWS). In 2012, Amazon introduced Amazon DynamoDB, a fully managed NoSQL database service on AWS. Developers could delegate database management complexities while leveraging Dynamo’s core principles.

Main Features

DynamoDB has rapidly become a favorite among startups, enterprises, and developers who are in search of reliable and scalable databases, all while avoiding the challenges of managing infrastructure. Its adaptability across various applications, ranging from mobile apps to real-time analytics, has been a key factor in driving its widespread adoption.

By utilizing DynamoDB, developers are liberated from the intricacies of handling both hardware and software components. The platform takes on the intricate task of scaling partitions and re-partitioning data to align with the specific throughput requirements. It accomplishes this seamless scaling without necessitating manual intervention for re-partitioning tables. This automatic process guarantees consistently low latency access to your data, with response times typically in the single-digit millisecond range.

The list below includes but is not limited to some of the most important features that DynamoDB offers it’s customers.

FeaturesDescription
Key-Value StoreIn a Key-Value database data is organized as pairs, with a unique “key” serving as an identifier and the corresponding “value” storing the data. Keys and values can be simple or complex objects. Key-value databases, like Amazon DynamoDB, can easily scale horizontally by adding partitions, enabling them to handle immense amounts of data, unlike some other database types. For instance, DynamoDB automatically adds partitions to a table when needed for increased storage capacity.
Managed NoSQL DatabaseDynamoDB allows you to easily scale up or down based on your application’s needs, without requiring you to provision hardware.
High AvailabilityIt offers built-in high availability and data durability by automatically replicating data across multiple Availability Zones.
Data ReplicationDynamoDB supports global tables, enabling you to replicate data across multiple AWS regions for low-latency access from anywhere.
On-Demand CapacityYou can choose to pay for read and write capacity by actual usage, known as on-demand capacity mode.
Provisioned CapacityAlternatively, you can provision a specific amount of read and write capacity to handle predictable workloads.
Auto ScalingDynamoDB can automatically adjust capacity to handle traffic spikes without manual intervention.
Data EncryptionData at rest is encrypted using AWS Key Management Service (KMS). Additionally, data in transit can be encrypted using Transport Layer Security (TLS).
Fine-Grained Access ControlYou can control access to tables and resources using AWS Identity and Access Management (IAM) and fine-grained access control policies.
Flexible SchemaDynamoDB’s schema-less nature allows you to add or remove attributes from items without altering the database schema.
Fully Managed BackupsDynamoDB provides continuous backups and enables point-in-time recovery to protect your data.
Global Secondary Indexes (GSI)GSIs enable you to create alternative query patterns for your data, improving query performance.
Local Secondary Indexes (LSI)LSIs provide another way to query your data, but they are limited to items with the same partition key as the base table.
In-Memory Acceleration with DAXDynamoDB Accelerator (DAX) is an in-memory cache that can significantly improve read performance.
Time-to-Live (TTL)You can configure items to expire automatically after a specified amount of time.
StreamsDynamoDB Streams capture changes to the data in real-time, allowing you to react to changes or perform data analysis.
Cross-Region ReplicationYou can replicate tables across regions for disaster recovery or to serve global users with low-latency access.
Triggers with AWS LambdaYou can configure triggers to invoke AWS Lambda functions in response to changes in the DynamoDB table.
Consistent and Eventually Consistent ReadsDynamoDB offers two types of read consistency options for different application needs.

Market Comparison

In this section i will be comparing AWS DynamoDB with Oracle NoSQL Database pricing models and the technical aspects that they both incorporate.

Provisioned Capacity Pricing Model

Provisioned capacity in the context of databases refers to the pre-allocated resources that you set up to handle the anticipated workload of read and write operations on your database.

In other words, when you provision capacity for a database, you are specifying the amount of computing resources (such as processing power, memory, and storage) that should be dedicated to handling the data access operations. This capacity is allocated based on your expected usage patterns, traffic volume, and performance requirements.

Some of the key points about provisioned capacity are:

  1. Predictable Performance: By provisioning a set amount of capacity, you can ensure consistent and predictable performance for your database, as it will have a dedicated amount of resources available at all times.
  2. Cost Predictability: Provisioned capacity typically comes with a fixed cost associated with the allocated resources. You pay for the capacity you provision, regardless of whether you fully utilize it or not.
  3. Adjustable: While provisioned capacity provides a baseline level of performance, many cloud database services allow you to adjust the provisioned capacity up or down as your needs change. This allows you to scale your resources to match changes in traffic or workload.
  4. Capacity Planning: Provisioned capacity often requires some level of capacity planning to determine the appropriate amount of resources needed to handle your database’s workload effectively.
  5. Optimized for Steady Workloads: Provisioned capacity is well-suited for workloads that have relatively steady and predictable traffic patterns. It ensures that your application doesn’t face performance fluctuations due to sudden spikes in traffic.

One of the drawbacks with provisoned capacity is excess capacity that can lead to over-provisioning which will result in unnecessary costs or provisioning too little capacity which can result in performance bottlenecks during high-demand periods.

ℹ️ EDITORS NOTE

I would like to take this opportunity to apologize if some of the price comparisons are not quite correct in the table below, it was difficult to find and adjust the relevant values to compare with one another.

AWS DynamoDBOracle NoSQL Database
Monthly write cost33.46 USD25.08 USD = 200 writes x $0.1254
Monthly read cost3.37 USD1.28 USD = 200 reads x $0.0064
Storage7.43 USD = 25GB1.65 USD = 25GB
Upfront write cost356.00 USD0 USD
Upfront read cost35.60 USD0 USD
Total Monthly BillingFirst Month: 391.60 USD
After: 44.26 USD
28.01 USD
Total Price First Year922.72 USD336.12 USD

ℹ️ EDITORS NOTE

The prices in the table are from the expected calculations provided by each website thus you should take into consideration that there might be some slight differences.

Free Tier Model

Both database providers offer free tiers for their services, below you can see the comparison.

AWS DynamoDB Free Tier (Provisioned Capacity)Always Free NoSQL Database Service (Provisioned Capacity)
Free Tier Time LimitationThe free tier is available for up to 12 months from the accounts activation date.The Always Free services are available for an unlimited period of time.
Write Capacity25 WCUs of provisioned capacity for tables using the DynamoDB Standard table class.Write Capacity (Write Units) is 50 and cannot be changed.
Read Capacity25 RCUs of provisioned capacity for tables using the DynamoDB Standard table class.Read Capacity (Read Units) is 50 and cannot be changed.
Storage25 GB of data storage for tables using the DynamoDB Standard table class.Disk Storage is 25GB and cannot be changed.
Replicated Write Cpacity25 rWCUs for global tables using the DynamoDB Standard table class deployed in two AWS Regions.Electable source-replica replication per shard. Support distributed global deployment with Multi-region table feature
Streams2.5 million stream read requests from DynamoDB Streams❌ Oracle Does Not Have This Feature.
Data Transfer1 GB of data transfer out (15 GB for your first 12 months), aggregated across AWS services❌ Oracle Does Not Have This Feature.

Technical

The table below shows some of the more technical comparisons of the two databases.

AWS DynamoDBOracle NoSQL Database
Database ModelDocument Store
Key-Value Store
Document Store
Key-Value Store
Relational DBMS (Primary Model)
Graph DBMS
RDF Store
Spatial DBMS
LicenseFree tier for a limited amount of database operations.Proprietary for Enterprise Edition.
Cloud-Based Only
Server Operating SystemsHostedLinux
Solaris SPARC/x86
Support for SQLSQL-like DML and DDL Statements
API’s and other access methodsRESTful HTTP APIRESTful HTTP API
Support Programming Languages.Net
ColdFusion
Erlang
Groovy
Java
JavaScript
Perl
PHP
Python
Ruby
C
C#
Go
Java
JavaScript (Node.js)
Python
Transaction ConceptACID across one or more tables within a single AWS account and region.ACID within a storage node (=shard).
API’s and other access methodsRESTful HTTP APIRESTful HTTP API

Setting up AWS DynamoDB

To use the DynamoDB service, you must have an AWS account. You’re not charged for any AWS services that you sign up for unless you use them.

  1. If you don’t already have one - Create a new AWS Account.
    • Follow the online instructions.
      Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad.
      When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative access to an administrative user, and use only the root user to perform tasks that require root user access.
  1. Get an AWS access key
    • Before you can access DynamoDB programmatically or through the AWS Command Line Interface (AWS CLI), you must have programmatic access. You don’t need programmatic access if you plan to use the DynamoDB console only.
  1. Configure your credentials
    • Before you can access DynamoDB programmatically or through the AWS CLI, you must configure your credentials to enable authorization for your applications.
      There are several ways to do this. For example, you can manually create the credentials file to store your access key ID and secret access key. You also can use the aws configure command of the AWS CLI to automatically create the file. Alternatively, you can use environment variables. For more information about configuring your credentials, see the programming-specific AWS SDK developer guide.
      To install and configure the AWS CLI, see Using the AWS CLI.

This should get you up and running with AWS DynamoDB Web service.

DynamoDB Documentation

The docs files include an extensive range of step by step procedures thus fitting them all in here would be counterproductive, this is why. I will include some important links to the docs files so that any interested party can have quick access to read material as they see fit.

Conclusion

AWS DynamoDB stands as a testament to the ever-evolving landscape of database technology, offering a versatile, scalable, and fully managed NoSQL solution. Its roots in Amazon’s need to handle immense e-commerce data led to the development of a groundbreaking database system named “Amazon Dynamo.” This innovation not only met Amazon’s scaling requirements but also sparked discussions in the tech world about distributed databases, NoSQL, and database scalability.

DynamoDB’s journey from an internal system to an external service within AWS has been marked by continuous evolution and the incorporation of features that cater to a wide array of use cases. Developers and businesses have embraced it as a solution that liberates them from the complexities of infrastructure management.

Key features like automatic scaling, data replication, fine-grained access control, and in-memory acceleration with DAX have played a pivotal role in DynamoDB’s success. Its flexible schema, global and local secondary indexes, and support for streams and triggers with AWS Lambda make it adaptable to various applications, from mobile apps to real-time analytics.

Additionally, DynamoDB offers multiple capacity modes, including provisioned capacity, allowing users to choose the most suitable model for their workloads. Provisioned capacity provides predictable performance and cost, making it an ideal choice for steady workloads.

In this comprehensive overview, we’ve also delved into the market comparison between AWS DynamoDB and Oracle NoSQL Database, examining pricing models and technical aspects. DynamoDB’s provisioned capacity pricing model ensures performance predictability, while Oracle NoSQL Database offers an always-free provisioned capacity model, although with certain limitations.

In essence, AWS DynamoDB continues to be a significant player in the world of modern database solutions, providing a robust foundation for applications that demand high scalability, availability, and low-latency data access. Its evolution and feature-rich nature make it a compelling choice for developers and businesses alike.

References