When referring to databases, what does it mean to be ACID-compliant?
Database operations that adhere to the properties of Atomicity, Consistency, Isolation, and Durability
What does it mean for database operations to adhere to Atomicity properties?
A transaction is treated as a single, indivisible unit of work; either all changes within the transaction are committed, or none are.
What does it mean for database operations to adhere to Consistency properties?
The database remains in a valid state after each transaction, meaning that all data constraints and rules are followed.
What does it mean for database operations to adhere to Isolation properties?
Transactions are executed independently, preventing interference or conflicts between concurrent transactions.
What does it mean for database operations to adhere to Durability properties?
Once a transaction is committed, the changes are permanently stored and survive system failures or crashes.
What is vertical scaling in the context of databases?
Increasing the resources (CPU, RAM, storage) of a single database server to enhance its capacity and performance.
What is horizontal scaling in the context of databases?
Adding more separate database servers and distributing the workload across them to handle increased load and data volume.
What is a primary advantage of vertical scaling?
Simpler to implement and manage, as it involves upgrading a single machine.
What is a primary disadvantage of vertical scaling?
Limited by hardware ceilings and creates a single point of failure.
What is a primary advantage of horizontal scaling?
Offers near-unlimited scalability and improves fault tolerance (no single point of failure).
What is a primary disadvantage of horizontal scaling?
Increased complexity in design, implementation, and management, especially regarding data consistency.
Define sharding in the context of databases.
Dividing a large dataset into smaller, independent pieces called “shards,” and storing each shard on a separate database server to distribute workload.
What is the purpose of a “shard key”?
A specific field or combination of fields in data that determines how the data will be split and distributed among different shards.
What are two key benefits of implementing sharding?
Improved scalability and enhanced performance by distributing data and queries across multiple servers.
What is a significant challenge when implementing sharding?
Increased system complexity, difficulty in choosing an effective shard key, and challenges with cross-shard queries or rebalancing.