AWS DynamoDB Flashcards
What type of database is DynamoDB
It is a key/value store, but it, not 100% true as the value can be more complex like JSON.
Can you have a secondary index?
Yes
Is DynamoDB deployed to a server or cluster?
No, it is a managed service from AWS you consume it as a service and scaling is performed automatically by AWS
Is DynamoDB a NoSQL database?
Yes, it is a NoSQL database.
Can I have joines in DynamoDB?
No, this database is a NoSQL key-value/document DB
Is DynamoDB encrypted by default for data at rest?
Yes
Is DynamoDB a schemaless database?
Yes unlike SQL thereis schemes, DynamoDSB is not.
Can I use my own customer managed key?
Yes you can use CMK
What does one read capacity unit represent?
It represents on strong consistent read or two eventual consistent reads, per 4K read. If you read over 4K then dynamoDB will consume one or more read unity.
What is a table in DynamoDB?
It a collection of items
What is an item in DynamoDB?
It is a uniquely identifiable collection of attributes.
What is an attribute in DynamoDB
Each items is composed of one or more attributes with atribute been a PersonID, LastName, FirstName.
Is a primary key on an attribute?
No, th eprimary key is on the item, this is a unique idenifier.
Can I create a backup of a DynamoDB table?
Yes, in the console, API or CLI.
You can restore from the backup.
When restoring from a DynamoDB backup, can I restore to the same table?
Yes, enter same table name for the restore
When restoring from a DynamoDB backup, can I restore to a different table?
Enter a different table name
With DynamoDB can I reserve storage capacity?
No as with storage you pay for only what you use as you use it.
I have a consistent known number of read/write capacity units I use 24/7/365, what can I do to save on cost?
I can purchase reserved capacity for both read and write, this can be for 1 - 3 years.
When you delete a table, are backups automatically deleted?
No.
Are DynamoDB tables encrypted at rest by default?
Yes, but you have the option to switch off encryption.
What is the default read and write capacity units?
5 x 5
Is DynamoDB handled at a database with a collection of tables or individual tables?
Individual tables, for example, when you want to copy all tables belong to your app, you have to do it per table. All configs are per table.
When you perform a write to DynamoDB, is the data written to another AZ?
Yes, in fact, it is written to a min of 3AZ.
When I preform a eventual consistant read on DynamoDB, am i geeteting the last write to the DB table?
No, reading again may give you different result.
When I preform a strong consistant read on DynamoDB, am i geeteting the last write to the DB table?
Yes you are geteting the most recent write to the DB table.
I ahve a laptop dev environmet and I wnat to develop again DynamoDB, what options do i have?
You have the ability to use the offline dev version of dynamodb
What is a DynamoDB table?
It is a collection of items
What is a DynamoDB item?
It is a colection of attributes.
Is DynamoDB a columer DB?
No is is a key-value and document DB.
What is the DynamoDB partation/has key?
This is the ley used on a table to distrubute the date and and is used to get access to the data.
What is a DynamoDB range key?
This key is used for searching, you can have ==, >, =, >=, “begines width”, “between”
When I prefrom a write to DynamoDB, is all the writes to the three AZ’s synchrous?
No, they are eventual consistant
When I preforma a write to DynamoDB, how long will it take for the data to becomes consistant?
about 1sec.
What size is a read/write capacity unit?
4K
How is DynamoDB priced?
It is based on through put, this is with capacity units.
What dose a read capacity unit represent?
It is a single read of a 4K bloock of data using strong consistancy.
Or, two consistant reads.
If I have a 8K block of data, how may capacity units will it take to read that data using strong consistancy?
2, as there will be 8K and this is tow 4K rreads.
I have fluctation read and write on my DynamoDB table, what cna I do to ensure I pay the minium?
Enable autoscaling and configure min and max. Or enables on-demand and pay for what you use, these is a small permium cost.
I need to ensure that alll the data is weote to DB using ACID trancation, as DynamoDB is a No-SQL DB, dose this means thta i have to use RDS?
No, DynamoDB supports ACID transactions.
Is an attribute a single value or a key value pair?
It is a key value pair.
I have an web application that uses DyanamoDB, this application serves customers in both the usa and ireland, I wnat to ensure that both sets of locations get service, I need a single db, what options do I have?
You can use DynamoDB global table to create a table in a second region.
I am currrently using provisioned capacaity unity, I have spily workloads, what are my options?
you can switch to on-demand where you only pay for what you use, but you also pay a surge charge. Or you can swithc to auto scaling.
What is strong consistancy?
When you read data from a DynamoDB table, the response might not reflect the results of a recently completed write operation. The response might include some stale data. If you repeat your read request after a short time, the response should return the latest data.
What is evantual strong?
When you request a strongly consistent read, DynamoDB returns a response with the most up-to-date data, reflecting the updates from all prior write operations that were successful. A strongly consistent read might not be available if there is a network delay or outage. Consistent reads are not supported on global secondary indexes (GSI).
Where will DyanamoDB store data?
In partations.
Where are partations stored?
They are stored on SSD and replicated across multipal AZ’s in the same region.
How will DynamoDB know where to find you data when you ask for it?
It used the partation key (hash) to locate the partation where the data is stored. You can alos use partatuion key and a sort key, data is stored in a partation and ordered by the sort key.
What application types is DyanamoDB good for?
Web-scale workloaded like,
- gaming
- media sharing
- IoT
I need ot have DyanamoDB backed up, how can I have this preformaned?
Ypu can enable point in time backups of the table. You cna also take an on-demand backup of the database.
I need to take a backup of the database for long term retention of a year, will point in time backup work for me, if not what other options do i have?
you can use point in time backups as you only get 35 days retention time. You cna use ondamand backupps. to storage a backup for long periods.
I have a dynamodb table with items, can I add a global table?
No the global table can only be added while these is no items in the table.
My ORG has a policy for encryption at rest, what DynamoDB options do I have?
Enable encryption on the DynamoDB table and use one of the following encryption keys methods,
- AWS owned CMK
AWS managed CMK Key is stored in your account and manged by KMS.
I need to make changes across 3 DynamoDB tables and have ACID transactions, what options do I have?
DynamoDB has transactions, you can group Put, Delete or Updates into a single group to be executed in all or nothing ACID transaction.
I require a database using query and index but not joins, what are my best options?
As you do not need joins, DynamoDB has what you need.
I required joins and need a fixed schema, what is my best option is it DynamoDB?
Do not use DynamoDB as it is not designed for joins, RDS may be a better option.
What is the use case for DynamoDB?
Highly available, scalable, no joints required, suited for -mobile apps -gaming -digital shopping cart - web session managment
I need complex joints in my relational data, is DynamoDB a good option?
No, joins or relationship data is not somethingDynamoDB dose very well, RDS is a better option here.
I want to store blob data in DynamoDB, why is this not a good idea?
You pay for each 4K read, blob data tends to be large, S3 is a better option here for blob data.
Is DynamoDB a good option for applications already wrote?
No, RDS is a better option.
By default is DynamoDB strongly consistent where you get back the last write?
No, by default DynamoDB is eventually consistent.
Is Dynamo DB global or regional service?
DynamoDB is a regional service unless you configure replication your data stays in that region.
What is a DynamoDB Item?
It is much like a traditional DB
I wnat to configure Dynao
DB nodes so I have my masters and slaves in a single region, how can I configure this?
You can, DynamoDB is 100% service with no nodes, its has capacity units you can use to govern read/write capacity.
What is the only mandatory requirement in an item (table)?
It is the primary key, the rest of the data has no structure (schema)
What is the max size of an item?
400KB
How much data can I write with 1 write capacity unit?
1KB
How much data can I read with a 1 read capacity unit?
4KB
I have an item (table) with 25 attributes (fields), and the item is 12KB in size, I read an attribute that is 30 bytes in size, how many capacity units do I use?
You are reading the 30 bytes, but Dynamo only allows you to read a complete item, in our case, the item is 12KB in size so you will have read 12KB and as each capacity unit for reading is 4KB you will have used 3 capacity units.
I do a search and return 3 12KB tables, how may read capacities do I use?
9, you use 9 because each item is 3 capacity units
I do a search and return 3 10byte tables, how may read capacities do I use?
3, each item is 10 bytes and you can only consume a whole read capacity unit so you will consume 3 1KB capacity units.
Do filers reduce the items with regard to capacity units read?
No, thye only filters the results, you will still use the read capacity units.
Should I use queries or scans?
You should use query as scenes are expensive as it reads every item in the database.
Can I have duplicate primary keys in a table?
No, primary keys have to be unique.
For DynamoDB, what is the only mandatory requirement for a table?
To have a primary key.
What is the max size of an item?
400KB
What is contained in a Table?
Items
What is contained in an Item
Attributes, primary key and sort keys.
What are a partition and a primary key and a hash key?
They are the same thing, they are used for and where to store the data in the partitions.
Can I have two items in a table with the same primary key?
No, it has to be unique.