Amazon DynamoDB | Streams Flashcards
In what regions is DynamoDB Triggers available?
Streams
Amazon DynamoDB | Database
DynamoDB Triggers is available in all AWS regions where AWS Lambda and DynamoDB are available.
What is DynamoDB Streams?
Streams
Amazon DynamoDB | Database
DynamoDB Streams provides a time-ordered sequence of item-level changes made to data in a table in the last 24 hours. You can access a stream with a simple API call and use it to keep other data stores up-to-date with the latest changes to DynamoDB or to take actions based on the changes made to your table.
What are the benefits of DynamoDB Streams?
Streams
Amazon DynamoDB | Database
Using the DynamoDB Streams APIs, developers can consume updates and receive the item-level data before and after items are changed. This can be used to build creative extensions to your applications built on top of DynamoDB. For example, a developer building a global multi-player game using DynamoDB can use the DynamoDB Streams APIs to build a multi-master topology and keep the masters in sync by consuming the DynamoDB Streams for each master and replaying the updates in the remote masters. As another example, developers can use the DynamoDB Streams APIs to build mobile applications that automatically notify the mobile devices of all friends in a circle as soon as a user uploads a new selfie. Developers could also use DynamoDB Streams to keep data warehousing tools, such as Amazon Redshift, in sync with all changes to their DynamoDB table to enable real-time analytics. DynamoDB also integrates with Elasticsearch using the Amazon DynamoDB Logstash Plugin, thus enabling developers to add free-text search for DynamoDB content.
You can read more about DynamoDB Streams in our documentation.
How long are changes to my DynamoDB table available via DynamoDB Streams?
Streams
Amazon DynamoDB | Database
DynamoDB Streams keep records of all changes to a table for 24 hours. After that, they will be erased.
How do I enable DynamoDB Streams?
Streams
Amazon DynamoDB | Database
DynamoDB Streams have to be enabled on a per-table basis. To enable DynamoDB Streams for an existing DynamoDB table, select the table through the AWS Management Console, choose the Overview tab, click the Manage Stream button, choose a view type, and then click Enable.
For more information, see our documentation.
How do I verify that DynamoDB Streams has been enabled?
Streams
Amazon DynamoDB | Database
After enabling DynamoDB Streams, you can see the stream in the AWS Management Console. Select your table, and then choose the Overview tab. Under Stream details, verify Stream enabled is set to Yes.
How can I access DynamoDB Streams?
Streams
Amazon DynamoDB | Database
You can access a stream available through DynamoDB Streams with a simple API call using the DynamoDB SDK or using the Kinesis Client Library (KCL). KCL helps you consume and process the data from a stream and also helps you manage tasks such as load balancing across multiple readers, responding to instance failures, and checkpointing processed records.
For more information about accessing DynamoDB Streams, see our documentation.
Does DynamoDB Streams display all updates made to my DynamoDB table in order?
Streams
Amazon DynamoDB | Database
Changes made to any individual item will appear in the correct order. Changes made to different items may appear in DynamoDB Streams in a different order than they were received.
For example, suppose that you have a DynamoDB table tracking high scores for a game and that each item in the table represents an individual player. If you make the following three updates in this order:
Update 1: Change Player 1’s high score to 100 points
Update 2: Change Player 2’s high score to 50 points
Update 3: Change Player 1’s high score to 125 points
Update 1 and Update 3 both changed the same item (Player 1), so DynamoDB Streams will show you that Update 3 came after Update 1. This allows you to retrieve the most up-to-date high score for each player. The stream might not show that all three updates were made in the same order (i.e., that Update 2 happened after Update 1 and before Update 3), but updates to each individual player’s record will be in the right order.
Do I need to manage the capacity of a stream in DynamoDB Streams?
Streams
Amazon DynamoDB | Database
No, capacity for your stream is managed automatically in DynamoDB Streams. If you significantly increase the traffic to your DynamoDB table, DynamoDB will automatically adjust the capacity of the stream to allow it to continue to accept all updates.
At what rate can I read from DynamoDB Streams?
Streams
Amazon DynamoDB | Database
You can read updates from your stream in DynamoDB Streams at up to twice the rate of the provisioned write capacity of your DynamoDB table. For example, if you have provisioned enough capacity to update 1,000 items per second in your DynamoDB table, you could read up to 2,000 updates per second from your stream.
If I delete my DynamoDB table, does the stream also get deleted in DynamoDB Streams?
Streams
Amazon DynamoDB | Database
No, not immediately. The stream will persist in DynamoDB Streams for 24 hours to give you a chance to read the last updates that were made to your table. After 24 hours, the stream will be deleted automatically from DynamoDB Streams.
What happens if I turn off DynamoDB Streams for my table?
Streams
Amazon DynamoDB | Database
If you turn off DynamoDB Streams, the stream will persist for 24 hours but will not be updated with any additional changes made to your DynamoDB table.
What happens if I turn off DynamoDB Streams and then turn it back on?
Streams
Amazon DynamoDB | Database
When you turn off DynamoDB Streams, the stream will persist for 24 hours but will not be updated with any additional changes made to your DynamoDB table. If you turn DynamoDB Streams back on, this will create a new stream in DynamoDB Streams that contains the changes made to your DynamoDB table starting from the time that the new stream was created.
Will there be duplicates or gaps in DynamoDB Streams?
Streams
Amazon DynamoDB | Database
No, DynamoDB Streams is designed so that every update made to your table will be represented exactly once in the stream.
What information is included in DynamoDB Streams?
Streams
Amazon DynamoDB | Database
A DynamoDB stream contains information about both the previous value and the changed value of the item. The stream also includes the change type (INSERT, REMOVE, and MODIFY) and the primary key for the item that changed.