Databases Flashcards
DynamoDB
- Fully managed, nosql, massive scale (1000000 rps)
- Max object size 400KB
- Capacity provisioned (WCU, RCU & autoscaling) or on-demand
- Reads can be eventually or strongly consistent
- Supports transactions across multiple tables (ACID)
- Backups and point-in-time recovery available
- Integrated with IAM for security
DynamoDB - Primary Keys
- Must be unique
- Partition key only
- Partition key + sort key
- Data grouped by partition key, the timestamp is an example of the good sort key
DynamoDB - Indexes
- In order to query an attribute must create an index of it
- LSI - Local Secondary Index
- Same partition key, the alternative sort key
- Must be added at creation
- GSI - Global Secondary Index
- Different partition and sort key
- Can be defined after the table creation
- Needs provisioned throughput per index, extra $
DynamoDB - TTL
Can expire rows
DynamoDB - Streams
- React to change in tables in real time
- 24-hour retention
- Can send to lambda, sqs, sns, ec2 and more
DynamoDB - Global Tables
- Active Active xregion replication, many regions
- Must enable streams
- Good for low latency, DR
DynamoDb - DAX
- DynamoDB Acceleration, aka cache
- No application code, directly integrated with DynamoDB
- Good for handling hot key problem
- 5 min TTL by default
- Multi AZ, recommended min 3 node for PROD
- Secure (KMS, IAM, VPC, CloudTrail)
- Up to 10 nodes in the cluster
Amazon ElasticSearch (ES)
- Not serveless, need to provision servers
- Must specify instance types, must be Multi-AZ
ElasticSearch + DynamoDB
Searching + Fast key-value store and retrieval
Store in Elasticsearch using streams and lambda
ES + CW
cw + subscription filter + lambda + es - real time
cw + subscription filter + kinesis + es - near real time
build own analytics and dashboard using kibana
RDS
- PostgreSQL, MySQL, MariaDB, Oracle, MS SQL Server
- Managed but requires provisioned servers
RDS VPC
Must be in VPC in private subnet, access controlled using SGs
RDS Storage
EBS (gp2 or io1), can enable auto-scaling
RDS Recovery
- Automated backups, pit recovery. Backups expire.
- Snapshots manual, can make copies of snapshots xregion
RDS Events
- Get notified via SNS about operations, outages, backups etc