Databases Flashcards
Unmanaged Services
Scaling, fault tolerance, and availability are managed by you.
Managed Services
Scaling, fault tolerance, and availability are typically built into the service.
Challenges of relational databases
- Server maintenance and energy footprint,
- Software installation and patches,
- Database backups and high availability,
- Limits on scalability,
- Data security,
- Operating system (OS) installation and patches;
Amazon Relational Database Service (Amazon RDS)
- Managed service
- Sets up and Operates a relational database
Database in EC2
You are still responsible for patching the OS and handling all software and backup operations.
Database in RDS - Aurora (engine)
- Automatically scale your database
- Enable high availability
- Manage backups,
- Perform patching.
DB Instance Class
- CPU
- Memory
- Network performance
DB Instance Storage
- Magnetic
- General Purpose (SSD)
- Provisioned IOPS
Multi - AZ deployment
Ability to configure your database instance for high availability. RDS automatically generates a standby copy of the database instance in another Availability Zone within the same VPC.
RDS Read Replicas
Features:
* Offers asynchronous replication
* Can be promoted to primary if needed
Functionality:
* Use for read-heavy database workloads
* Offload read queries
RDS Use Cases
Web and mobile applications,
Ecommerce applications,
Mobile and online games.
When to use RDS
- Complex transactions / queries
- Medium to high query or write rate
- No more than a single worker node or shard * High durability
Clock-hour billing
Resources incur charges when running.
Database characteristics
Physical capacity of database:
* Engine,
* Size,
* Memory class.
On-Demand Instances
Compute capacity by the hour.
Reserved Instances
Low, one-time, upfront payment for database instances that are reserved with a 1 year or 3 year term.
Relational
Rows and Columns,
Fixed Schema,
SQL,
Vertical Scalability;
Non-Relational
- Key-Value/Document/Graph
- Dynamic Schema
- Focuses on collection of documents
- Horizontal Scalability
Amazon DynamoDB
Fast and flexible NoSQL database service for any scale. (SSD Exclusive).
- Virtually unlimited storage,
- Items can have differing attributes,
- Low-latency queries,
- Scalable read/write throughput.
DynamoDB Core Components
- Tables, items, and attributes are the core DynamoDB components.
- DynamoDB supports two different kinds of primary keys:
- Partition key
- Partition and sort key(Composite Primary Key).
Partition Key
Simple primary key, which is composed of one attribute called the sort key. (GUID).
Composite Primary Key
Composed of two attributes:
* Partition key
* Sort key
Partitioning
As data grows, table data is partitioned and indexed by the primary key.
Data Retrieval DynamoDB
- In the first method, the query operation takes advantage of partitioning to effectively locate items by using the primary key.
- The second method is via a scan, which enables you to locate items in the table by matching conditions on non - key attributes. The second method gives you the flexibility to locate items by other attributes. However, the operation is less efficient because DynamoDB will scan through all the items in the table to find the ones that match your criteria.
Amazon Redshift
- Fast, fully managed data warehouse
- Simple and cost-effective to analyze all your data by using standard SQL and your existing business intelligence (BI) tools
Leader Node
- Manages communications with client programs and all compute nodes.
- It parses and develops plans to carry out database operations needed to obtain results for complex queries.
- Compiles code and assigns to individual compute nodes.
Compute Node
Run the compiled code and send intermediate results back to the leader node for final aggregation.