DynamoDB Flashcards
You can select a specific Availability Zone in which to place your DynamoDB Table.
False.
How can you optimise the performance of a large scan in DynamoDb?
Run smaller scans in parallel.
What is some characteristics of DynamoDB?
- NoSQL database that supports both key-value and document data models
- It is a fast, millisecond latency at any scale
- Flexible data model
- Reliable performance
- Serverless
- Can be configured to auto scale
Name a few applications for which DynamoDB is a good choice.
- Mobile apps
- Web
- Gaming
- Ad-tech
- IoT
How is the data stored in DynamoDB?
- Stored on SSD storage
- Spread across 3 geographically distinct data centers
What can documents in DynamoDB be written in?
- JSON
- HTML
- XML
What is used for authentication and access control to a DynamoDB?
IAM
How can you make sure that an user only can access their own data in DynamoDB?
- By adding a Condition to an IAM Policy that checks so that the Partition Key value matches the User ID.
- “dynamodb:LeadingKeys”
DynamoDB supports both Eventually Consistent and Strongly Consistent reads, which it the default?
Eventual Consistency.
In DynamoDB, how can you specify what attributes a query or scan should return?
By specifying the ProjectionExpression parameter.
You’re doing a query on a DynamoDB table, how is the result sorted? Can you change this in any way?
- The result is sorted by the Sort Key
- Numeric order - by default in ascending order (1, 2, 3)
- ASCII character code values
- You can revers the order by setting the ScanIndexForward parameter to false
- Only for queries, not scans
By default, are queries eventual or strongly consistent?
Eventual. If you want Strong Consistency you need to specify it
How can you refine the result of a scan?
- Filter the result.
- Remember that the scan still fetches ALL the data of the table, filter simply filters out what to show you after all data has been fetched
How can you improve the performance of a query or scan?
- Set a smaller page size, this will use fewer read operations
- Try to design the tables in a way so that you can use Query, Get or BatchGetItem instead of Scan
- Parallel scans (not recommended if your table/index is quite busy)
Which are the two pricing models for DynamoDB?
- Provisioned Throughput
- On-Demand Capacity
How does the On-Demand Capacity model work for DynamoDB?
- You don’t need to specify your requirements
- DynamoDB instantly scales up and down based on the activity of your application
- Great for unpredictable workloads, if you workload has large short lived spikes, if you do not know your capacity requirements, or if it is a new application where the workload isn’t well understood
- You only pay for what you use (read, write, storing data)
When should you use the Provisioned Throughput model for DynamoDB?
- When you can forecast read and write capacity requirements
- Predictable application traffic
- Application traffic is consistent or increases gradually
You can change you DynamoDB table from Provisioned to On-Demand once per day.
True.
What does DAX stand for, and what is it?
- DynamoDB Accelerator
- It’s a fully managed, clustered in-memory cache for DynamoDB
- Only for Read
- Good for Read-Heavy and bursty workloads
- My be able to reduce the Provisioned Read Capacity on your DynamoDB table (can save money)
Give a few examples of when to use DAX.
- Auction applications
- Gaming
- Retail sites during Black Friday/Christmas promotions
How does DAX work?
- It’s a write-through caching service
- Data is written to the cache as well as the back end store at the same time
- Allows you to point your DynamoDB API calls at the DAX cluster
- If the item you are querying is in the cache (cache hit), DAX returns the result to the application
- If the item is not found in DAX (cache miss) then DAX performs an Eventually Consistent GetItem operation against DynamoDB
- The item is the written to the cache, as well as returned to the one asking for it
When is DAX not a good choice?
- If the application requires Strongly Consistent reads
- DAX works with Eventually Consistent reads only
- Write intensive applications
- Applications that do not perform many read operations
- Applications that do not require microsecond response time
- If you need a Lazy Loading strategy
- DAX only supports write-through
What is DynamoDB Transactions?
- Supports and all or nothing approach to the database transactions
- Good for mission-critical applications
- ACID Transactions (Atomic, Consistent, Isolated, Durable)
What is DynamoDB TTL?
- Allows you to set an expiry time for your data
- Expired items are automatically marked for deletion
- The item will be deleted within the next 48 hours
- Great for removing irrelevant or old data such as:
- Session data
- Event logs
- Temporary data
- Reduces cost by automatically removing data which is no longer relevant
- You can filter out expired items from your queries and scans
- You choose which attribute you will base the TTL on