A Basic Guide to Using Amazon DynamoDB

A Basic Guide to Using Amazon DynamoDBAmazon DynamoDB is a fully managed NoSQL database cloud service offered by Amazon Web Services (AWS). It is an operational database with special capabilities, like quickly and consistently handling semi-structured or unstructured data (though it does not possess analytical, or OLAP, capabilities). It also uses the ‘pay-per use’ model, meaning you don’t pay for hardware or services you don’t use.

Comparative Analysis Between Amazon DynamoDB and Other Databases

Compared to other transactional databases, like Oracle, MSSQL, or PostgreSQL, AWS DynamoDB is schemaless, meaning it does not require conformation to a rigid schema of data types, tables, etc. This, though, also comes with a tradeoff: key advantages, like consistently high performance and millisecond latency, are compromised with ACID (atomicity, consistency, isolation, and durability) properties supported by a relational database.

Compared to other NoSQL databases, AWS DynamoDB supports data models like key-value pair (see figure below), and document data structures such as JSON, XML and HTML. But DynamoDB lacks support for columnar data sets, like Cassandra and HBase, and graph models such as Orient DB.

figure: key-value pair

Fig 1 : Key – Value pair    

DynamoDB’s Architecture

AWS products, DynamoDB included, have a reputation as highly available, scalable, and secure. These are some of the keys to its success:

Availability: When your application writes data to an Amazon DynamoDB table and receives a response (such as Okay), all copies of the data are updated. The data will eventually be consistent across all storage locations, usually within one second or less. This is because DynamoDB has a highly redundant architecture with synchronous data replication stored on SSDs for high performance across three facilities or availability zones in a single region.

Scalability: Automatic partitioning at the database level spreads the data across various partitions and increases the AWS DynamoDB throughput with the growth of the data. To make your life easier, AWS handles this partitioning of data so that customers can concentrate on core aspects.

Security: DynamoDB can be integrated with AWS’ identity and access management (IAM) to provide each user with unique credentials for accessing database resources. Moreover, access can also be authenticated by leveraging your internal AD or LDAP server. Data is also backed up to Amazon Simple Storage Service (S3) in order to maintain high performance on a massive scale all while preserving durability and security.

How AWS DynamoDB Functions

AWS DynamoDB automatically scales throughput capacity to meet workload demands and partitions and re-partitions your data as your table size grows. Here is how it’s done:

Monitoring: CloudWatch is the central pane for monitoring the performance, resource utilization, and operational health of DynamoDB. CloudWatch keeps an eye on the various metrics and triggers an alarm when a threshold is breached. This can further initiate the auto-scaling of resources per the system’s configuration. (See  Figure 2.)

A Basic Guide to Using Amazon DynamoDB

Figure 2 – Auto scaling

Throughput: Throughput capacity is the maximum rate at which something can be produced or processed. It can be managed by DynamoDB’s auto-scaling, provisional throughput, or reserved capacity. Throughput is specified in terms of read capacity units and write capacity units: One read capacity unit represents one strongly consistent read per second, or two eventually consistent reads per second, for an item up to 4 KB in size. One write capacity unit represents one write per second for an item up to 1 KB in size.

The creation of any table or global index in DynamoDB requires specifying the object’s read and write capacity requirements. This lays the foundation for delivering high performance at a consistent pace by reserving required resources for your application.

Data Read Consistency: As mentioned earlier, as AWS DynamoDB is a NoSQL database it may not support ACID properties of a relational database. However, it still provides a degree of flexibility by supporting what are called eventually consistent reads—when a read request from a DynamoDB table does not immediately reflect the last committed transaction but does after waiting and trying again—and strongly consistent readswhen a read request returns the last saved data from the successful write transaction.

Zero Management: With this managed service model, you don’t have to worry about managing infrastructure layers, like network and storage connectivity, OS patching, server health, or backup, among others, as AWS does this for you.

Easy Integration and Open APIs: DynamoDB provides APIs for managing tables and indexes and for performing various data operations (like read and write).  It also supports integration with Amazon Redshift, Elasticstack and IAM, among others.

Industry-Wide Usages of DynamoDB

AWS DynamoDB has a strong and industry-wide presence. It also has a variety of use cases, ranging from IoT stories for capturing sensor data from home security systems to triggering real-time notifications for required parties via enabling streams. Another powerful use case is in the gaming industry, where games (which are generally write intensive) are continuously writing each event to the database layer so that the data is not lost.

There is, consequently, no dearth of uses for DynamoDB. To get going, you just need to find the right match per your requirements and then refer to the easy-to-use features highlighted above. With DynamoDB providing consistently high performance at large scale deployments, coupled with its ease of managing complex infrastructures, Amazon has made life simpler and more productive for the developer community.


Share this post →

You might also like: