• NoSQL database service
  • fully managed by AWS
  • It provides
    • predictable performance
    • seamless scalability
    • fast performance
  • Also has encryption at rest
  • Serve any level of request traffic.
  • Scale up or down tables’ throughput capacity without downtime or performance degradation
  • AWS Management Console can be used to monitor resource usage
  • Also, provides on-demand backup capability with full backups of tables for long-term retention and archival.
  • core components are
    • tables
    • items
    • attributes
  • A table is a collection of items
  • item is a collection of attributes.
  • primary keys are used to uniquely identify each item in a table
  • secondary indexes provide more querying flexibility
  • DynamoDB Streams capture data modification events in DynamoDB tables.

DynamoDB components

  • Tables
    • Similar to other database systems, DynamoDB stores data in tables.
    • A table is a collection of data
    • For example, a People table, stores personal contact information about friends, family, or anyone else of interest. Another Cars table stores vehicle details which people drive.
  • Items
    • Each table contains zero or more items
    • An item is a group of attributes that is uniquely identifiable among all of the other items.
    • In People table, each item signify a person. For Cars table, each item signify one vehicle.
    • Items are similar in many ways to rows, or tuples in other database systems.
    • There is no limit to the number of items you can store in a table.
  • Attributes
    • Each item is composed of one or more attributes.
    • It is a fundamental data element, and is not to be broken down any further.
    • For example, an item in a People table contains attributes called PersonID, LastName, FirstName, and so on.
    • Attributes are similar to fields or columns in other database systems.

Below diagram lists People table with some items and attributes.

Note the following about the People table:

  • Every item in table has a unique identifier, or primary key
  • primary key differentiates item from rest in table. In People table, primary key is PersonID
  • Without primary key, People table is schemaless, or each item can have its own distinct attributes.
  • Most of attributes are scalar, or have only one value example – strings and numbers
  • Some items have nested attribute like Address or have multiple attributes like house number/city/pincode.
  • 32 level nesting is supported by DynamoDB

DynamoDB supports 2 types of primary keys

  • Partition key – only primary key, has one attribute called partition key, which is input to internal hash function. Hashing output decides partition or internal physical storage to store item. Partition key value is unique for items. In People table it is PersonID.
  • Partition key and sort key –  Also called as composite primary key. Has two attributes – first is partition key, and second is sort key. Partition key value is input to internal hash function and hash function decides internal physical storage location. items are sorted by key value

Secondary Indexes –

  • Multiple secondary indexes on a table, can be created
  • Query the table using an alternate key by secondary index, instead of primary key.
  • DynamoDB doesn’t require index, but index give more flexibility during querying data.
  • With a secondary index on a table, read data from index similar as, from the table.

DynamoDB index types

  • Global secondary index – Partition key and sort key that can be different from those on the table.
  • Local secondary index –Same partition key as the table, but a different sort key.

DynamoDB supports eventually consistent and strongly consistent reads.

  • Eventually Consistent Reads – During reading data from DynamoDB , output will not have recent changes like write or delete. Current data change is reflected after some time.
  • Strongly Consistent Reads – Any data request returns data  with all successful recent changes in DynamoDB. It is not available due to network delay or outage. They are not supported on global secondary indexes (GSI).

Enrich and Enhance your profile to become an AWS Certified Developer – Associate. Try hundreds of Practice Exam Now!

Menu