Introduction

Today we will talk about AWS DynamoDB in 15 simple points.

AWS DynamoDB

  1. AWS DynamoDB is a non-relational, key-value pair database service which provides high performance at scale.
  2. Data is stored in a document format instead of relational format. This is useful if you have a data model which does not have a fixed schema. If you want to create tables whose schema is not fixed and can be dynamically changed, you can easily use DynamoDB.
  3. It is a server less, fully managed NoSQL database which means you cannot use structured query language SQL to query data.
  4. AWS DynamoDB is highly available and a durable service.
  5. It stores data in shards or partitions which means it can scale horizontally. Learn about sharding and horizontal scaling.
  6. You can define a primary key or partition key which uniquely identifies every record. You can either ensure that partition key is unique for each row or you can create a combination of partition key + sort key that together identifies a record uniquely. For example – if a DynamoDB table stores employee id as partition key. Each employee will have a unique record. This is when a partition key is individually unique. In other example – if you are storing country and states as data in DynamoDB record. Then country and state together can be used as a composite key. So two records with same country name but different state will uniquely identify the row. [ref]
  7. AWS DynamoDB service provides a facility to capture any create, insert or delete operation using data stream. Using this option, you can integrate other AWS services like – AWS Lambda and AWS Kinesis stream to track operations like – inserting a new record, updating to an existing record, and deleting a record.
  8. When any write operation occurs in AWS DynamoDB, the particular record on which the operation is performed (insert, update or delete) can be detected and further used for data analytics, data manipulation or any other use case.
  9. AWS DynamoDB also provides in-built dashboards to display metrics like read usages, read throttles, write usages etc.
  10. AWS DynamoDB allows creation of global tables. Usually when you create a DynamoDB table it gets created only one region of the AWS account. A global table in DynamoDB means a table that is owned by the entire AWS account and its replicas can be created in more than one regions. If you make your table global, that means it can have its replica in many regions decided by you. This is useful for disaster recovery or serve same data to multi-region applications.
  11. The consistency of replicas is maintained automatically. Updating one replica propagates to other replicas in seconds.[ref]
  12. In case of conflicts when some application updates the same item in different Regions at about the same time, DynamoDB ensures consistency using  last writer wins concept. In this DynamoDB makes a best effort to determine the last writer. With this conflict resolution mechanism, all the replicas will agree on the latest update and converge toward a state in which they all have identical data. [ref]
  13. You can export data from DynamoDB directly to S3 using ‘export data’ feature. With this feature, you can export the table’s data in DynamoDB JSON or ION format to files in S3 for a specified amount of time. Export Data to S3 feature does not consume read capacity of the table and it also does not impact the performance of the table. [ref]
  14. TTL (Time-To-Live) option of DynamoDB table provides option to automatically delete the items (records) from the table which are no longer relevant. If you have a column (attribute) in DynamoDB table that stores the creation timestamp of the record in epoch format, you can define a column for TTL where you can define a timestamp after which these records will be deleted automatically. [ref]
  15. AWS DynamoDB provides encryption for the data-at-rest.

See you in the next read.

Leave a Reply

Your email address will not be published. Required fields are marked *