AWS DynamoDB

AWS DynamoDB

DynamoDB:

  • Amazon's own fully managed, serverless NoSQL DB offering.
  • DynamoDB lets you offload the administrative burdens of operating and scaling a distributed database so that you don't have to worry about hardware provisioning, setup, and configuration, replication, software patching, or cluster scaling.
  • Can scale up to 100s of TB.
  • Can replace ElastiCache since it has its own Cache cluster i.e. DynamoDB Accelerator - DAX.
  • DAX is used for Read Cache.
  • Security, authentication, and authorization are done through IAM.
  • Cross-region replication can be enabled through DynamoDB Data Streams.
  • Monitoring can be done through CloudWatch.
  • DynamoDB also offers encryption at rest, which eliminates the operational burden and complexity involved in protecting sensitive data.

DynamoDB Table:

When you create a table, in addition to the table name, you must specify the primary key of the table. The primary key uniquely identifies each item in the table, so that no two items can have the same key.

Amazon DynamoDB supports two different kinds of primary keys:

Partition key – A simple primary key, composed of one attribute known as the partition key. DynamoDB uses the partition key’s value as input to an internal hash function. The output from the hash function determines the partition (physical storage internal to DynamoDB) in which the item will be stored.

Partition key and sort key – Referred to as a composite primary key, this type of key is composed of two attributes. The first attribute is the partition key, and the second attribute is the sort key. DynamoDB uses the partition key value as input to an internal hash function. The output from the hash function determines the partition (physical storage internal to DynamoDB) in which the item will be stored.

Take note that the partition key of an item is also known as its hash attribute. The term hash attribute derives from the use of an internal hash function in DynamoDB that evenly distributes data items across partitions, based on their partition key values.

  • Features: Back-up/Restore and Global Tables available for HA.

Use-cases:

  • Useful in serverless architecture and applications, etc.
  • Distributed serverless cache.
  • Has transactions capability since November 2018.