Google News
logo
DynamoDB - Interview Questions
What are the primary components of DynamoDB?
The primary components of Amazon DynamoDB include:

Tables : Tables are the primary data storage structures in DynamoDB. Each table consists of multiple items, which are the individual records or data entities. Tables are schema-less, meaning each item in a table can have different attributes.

Items : Items are the individual data records stored within DynamoDB tables. Each item is uniquely identified by a primary key, which can be either a single attribute known as the partition key or a combination of partition key and sort key. Items can contain various attributes, and each attribute can be of different data types.

Attributes : Attributes are the key-value pairs that make up items in DynamoDB. Each item can have one or more attributes, where the attribute name is a string and the attribute value can be of various data types such as string, number, binary, boolean, or set.

Primary Key : The primary key uniquely identifies each item in a DynamoDB table. It consists of one or two attributes :

* Partition Key : A single attribute that DynamoDB uses to partition data across multiple servers for scalability and performance.
* Sort Key (Optional) : An additional attribute used in combination with the partition key to uniquely identify items within the same partition. It enables range queries and sorting of items within a partition.
Local Secondary Indexes (LSIs): LSIs allow querying table data using an alternative sort key, different from the table's primary sort key. LSIs can only be created when creating the table and must be defined at that time.
Global Secondary Indexes (GSIs) : GSIs enable querying table data using non-primary key attributes as partition keys and sort keys. Unlike LSIs, GSIs can be created or deleted after the table is created, providing more flexibility in querying options.

Streams : DynamoDB Streams capture changes to items in a table and allow developers to process these changes in real-time. Streams can be enabled on a per-table basis and can trigger AWS Lambda functions or other downstream applications.

Throughput Capacity : Throughput capacity defines the amount of read and write activity that a DynamoDB table can support. It is measured in read capacity units (RCUs) for reads and write capacity units (WCUs) for writes. Throughput capacity can be provisioned or set to auto-scaling based on demand.

Understanding these components is crucial for effectively designing DynamoDB schemas and optimizing performance for specific use cases.
Advertisement