07 - Managed NoSQL: DynamoDB Flashcards
Define
Cloud Computing
on-demand delivery of IT resources and applications via the Internet, with pay-as-you-go pricing.
How does cloud computing reduce IT costs?
-
Multiple pricing options also help you optimize costs based on your unique workloads.
2.lower cycles In comparison, an on-premises solution typically requires upgrades on 1/3/5-year cycles. The cost of labor and systems administration can be significant. - The cost savings achieved using the cloud empowers organizations to shift resources toward innovative, new projects
- Cloud computing can move with your business. Its speed and agility makes it possible for you to respond to changing market conditions and computing requirements.
In a traditional infrastructure, ____ is a challenge due to the amount of time it can take to get a server procured, delivered, and running.
scalability
When Running your database in the Cloud (IaaS), which ones are handled by you?
7
- App optimization
- Scaling
- high availability
- Backups (DB)
- Patches (DB software)
- Installations (DB software)
- operating system patches
ASHBPIO
When Running your database in the Cloud (PaaS), which ones are handled by you?
App optimization
DynamoDB characteristics
4
- Fully managed
- Virtually unlimited
- Low latency (< 10ms)
- Flexible schema
Define
flexible schema
- DynamoDB supports both key-value and document data models
- each row can have any number of columns at any point in time
- u can easily adapt the tables as your business requirements change
- w/o having to redefine the table schema as you would in relational databases
When to use SQL
- Complex transactions/queries
- A medium to high query or write rate – Up to 30,000 IOPS (15,000 reads + 15,000 writes)
- High durability
When to use DynamoDB
- Massive read/write rates (for example, 150,000 write/second)
- Sharding due to high data size or throughput demands
- Simple GET or PUT requests and queries
Can only put & read data as is
T/F
You won’t be doing complex queries in DynamoDB and you won’t use simple GET and PUT request and queries.
You will probably would leave your analytics
F
You won’t be doing complex queries in DynamoDB but rather simple GET and PUT request and queries.
You will probably would leave your analytics
Aka: Can only put & read data as is
Is DynamoDB vertically or horizontally scaled?
horizontally
Define
Partition key
Attribute of data that divides data across multiple machines
Ex. Course
Differentiate
Single Key vs Compound Key
Single key: partition key is the only key
* Partition key + attributes
Compound key
* Sort key in addition to partition key
* Partition key + sort key + attributes
Define
Sort Key/Range Key
Sorts data w/in a partition
Note that if you decide to only specify a partition key and not a sort key (also known as a Range Key), all records must have a _____________
unique partition key value
As data grows, how is table partitioned?
Partitioned by key
When do you use QUERY vs SCAN?
QUERY by key to find items efficiently
SCAN to find items by attribute
Is SCAN cost-effective for DynamoDB?
No
Need to practice proper data modeling, para ma-identify primary keys & data will be more cost effective
DynamoDB Data Modeling Process
- Start with an ERD
- Define access patterns
- Design your table schema
- FORGET YOUR RELATIONAL CONCEPTS
Elaborate
FORGET YOUR RELATIONAL CONCEPTS
NO normalization
NO joins
NO one entity per table rule
Differentiate
Global Secondary Index vs Local Secondary Index
GSI: alternate partition and/or sort key (online indexing)
* Index across all partition keys
* Has RCUs/WCUs (Read Capacity Unit / Write Capacity Unit)
* can assign a new partition key and new sort key
* gives a new primary key
* functions as a new table (redundancy of old, w/ new partition key & sort key)
LSI: alternate sort key attribute
* Index is local to a partition key, enclosed
* Doesn’t change partition key, only assigns a new sort key
* 10 GB max per partition key
Define
Projection
What is part of a projection
Projection: new table
* new partition and sort key
* old partition key
* extra attributes, or all attributes
How to choose a good partition key?
- Match common access patterns
- High cardinality
- Evenly distributed values
- Is well-known to the application