Amazon DynamoDB | Getting started Flashcards

1
Q

Is DynamoDB only for high-scale applications?

Getting started

Amazon DynamoDB | Database

A

No. Amazon DynamoDB offers seamless scaling so that you can scale automatically as your application requirements increase. If you need fast, predictable performance at any scale, DynamoDB may be the right choice for you.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do I get started with Amazon DynamoDB?

Getting started

Amazon DynamoDB | Database

A

Click “Sign Up” to get started with Amazon DynamoDB today. From there, you can begin interacting with Amazon DynamoDB using either the AWS Management Console or Amazon DynamoDB APIs. If you are using the AWS Management Console, you can create a table with Amazon DynamoDB and begin exploring with just a few clicks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What kind of query functionality does DynamoDB support?

Getting started

Amazon DynamoDB | Database

A

Amazon DynamoDB supports GET/PUT operations using a user-defined primary key. The primary key is the only required attribute for items in a table and it uniquely identifies each item. You specify the primary key when you create a table. In addition to that DynamoDB provides flexible querying by letting you query on non-primary key attributes using Global Secondary Indexes and Local Secondary Indexes.

A primary key can either be a single-attribute partition key or a composite partition-sort key. A single attribute partition primary key could be, for example, “UserID”. This would allow you to quickly read and write data for an item associated with a given user ID.

A composite partition-sort key is indexed as a partition key element and a sort key element. This multi-part key maintains a hierarchy between the first and second element values. For example, a composite partition-sort key could be a combination of “UserID” (partition) and “Timestamp” (sort). Holding the partition key element constant, you can search across the sort key element to retrieve items. This would allow you to use the Query API to, for example, retrieve all items for a single UserID across a range of timestamps.

For more information on Global Secondary Indexing and its query capabilities, see the Secondary Indexes section in FAQ.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do I update and query data items with Amazon DynamoDB?

Getting started

Amazon DynamoDB | Database

A

After you have created a table using the AWS Management Console or CreateTable API, you can use the PutItem or BatchWriteItem APIs to insert items. Then you can use the GetItem, BatchGetItem, or, if composite primary keys are enabled and in use in your table, the Query API to retrieve the item(s) you added to the table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Does Amazon DynamoDB support conditional operations?

Getting started

Amazon DynamoDB | Database

A

Yes, you can specify a condition that must be satisfied for a put, update, or delete operation to be completed on an item. To perform a conditional operation, you can define a ConditionExpression that is constructed from the following:

Boolean functions: ATTRIBUTE_EXIST, CONTAINS, and BEGINS_WITH

Comparison operators: =, <>, , <=, >=, BETWEEN, and IN

Logical operators: NOT, AND, and OR.

You can construct a free-form conditional expression that combines multiple conditional clauses, including nested clauses. Conditional operations allow users to implement optimistic concurrency control systems on DynamoDB. For more information on conditional operations, please see our documentation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Are expressions supported for key conditions?

Getting started

Amazon DynamoDB | Database

A

Yes, you can specify an expression as part of the Query API call to filter results based on values of primary keys on a table using the KeyConditionExpression parameter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Are expressions supported for partition and partition-sort keys?

Getting started

Amazon DynamoDB | Database

A

Yes, you can use expressions for both partition and partition-sort keys. Refer to the documentation page for more information on which expressions work on partition and partition-sort keys.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Does Amazon DynamoDB support increment or decrement operations?

Getting started

Amazon DynamoDB | Database

A

Yes, Amazon DynamoDB allows atomic increment and decrement operations on scalar values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When should I use Amazon DynamoDB vs a relational database engine on Amazon RDS or Amazon EC2?

Getting started

Amazon DynamoDB | Database

A

Today’s web-based applications generate and consume massive amounts of data. For example, an online game might start out with only a few thousand users and a light database workload consisting of 10 writes per second and 50 reads per second. However, if the game becomes successful, it may rapidly grow to millions of users and generate tens (or even hundreds) of thousands of writes and reads per second. It may also create terabytes or more of data per day. Developing your applications against Amazon DynamoDB enables you to start small and simply dial-up your request capacity for a table as your requirements scale, without incurring downtime. You pay highly cost-efficient rates for the request capacity you provision, and let Amazon DynamoDB do the work over partitioning your data and traffic over sufficient server capacity to meet your needs. Amazon DynamoDB does the database management and administration, and you simply store and request your data. Automatic replication and failover provides built-in fault tolerance, high availability, and data durability. Amazon DynamoDB gives you the peace of mind that your database is fully managed and can grow with your application requirements.

While Amazon DynamoDB tackles the core problems of database scalability, management, performance, and reliability, the datamodel, just like any NoSQL, must be designed specifically for the access patterns required by the application. In other words, running adhoc queries on DynamoDB can be inefficient. Refer to the design guidance that shows how to effectively migrate from any Relational database to DynamoDB. If your workload requires this functionality, or you are looking for compatibility with an existing relational engine, you may wish to run a relational engine on Amazon RDS or Amazon EC2. While relational database engines provide robust features and functionality, scaling a workload beyond a single relational database instance is highly complex and requires significant time and expertise. As such, if you anticipate scaling requirements for your new application and do not need relational features, Amazon DynamoDB may be the best choice for you.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How does Amazon DynamoDB differ from Amazon SimpleDB?

Getting started

Amazon DynamoDB | Database

A

Which should I use? Both services are non-relational databases that remove the work of database administration. Amazon DynamoDB focuses on providing seamless scalability and fast, predictable performance. It runs on solid state disks (SSDs) for low-latency response times, and there are no limits on the request capacity or storage size for a given table. This is because Amazon DynamoDB automatically partitions your data and workload over a sufficient number of servers to meet the scale requirements you provide. In contrast, a table in Amazon SimpleDB has a strict storage limitation of 10 GB and is limited in the request capacity it can achieve (typically under 25 writes/second); it is up to you to manage the partitioning and re-partitioning of your data over additional SimpleDB tables if you need additional scale. While SimpleDB has scaling limitations, it may be a good fit for smaller workloads that require query flexibility. Amazon SimpleDB automatically indexes all item attributes and thus supports query flexibility at the cost of performance and scale.

Amazon CTO Werner Vogels’ DynamoDB blog post provides additional context on the evolution of non-relational database technology at Amazon.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

When should I use Amazon DynamoDB vs Amazon S3?

Getting started

Amazon DynamoDB | Database

A

Amazon DynamoDB stores structured data, indexed by primary key, and allows low latency read and write access to items ranging from 1 byte up to 400KB. Amazon S3 stores unstructured blobs and suited for storing large objects up to 5 TB. In order to optimize your costs across AWS services, large objects or infrequently accessed data sets should be stored in Amazon S3, while smaller data elements or file pointers (possibly to Amazon S3 objects) are best saved in Amazon DynamoDB.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly