Flashcards · Databases · Free
Databases flashcards, generated for you.
Example Databases study cards to learn from right now — then generate a full set from your own notes (plus a practice quiz) and export to Quizlet or Anki. Free, no account needed.
Example Databases flashcards
What is the fundamental difference between SQL and NoSQL databases?
SQL uses structured schemas with ACID compliance and relational tables; NoSQL uses flexible schemas (document, key-value, graph) and prioritizes availability/partition tolerance (BASE model).
Define ACID properties and why they matter.
Atomicity (all-or-nothing), Consistency (valid state), Isolation (concurrent safety), Durability (persisted). Critical for financial/transactional systems where data corruption is unacceptable.
What is the CAP Theorem and its three components?
Consistency (all nodes see same data), Availability (system always responds), Partition tolerance (survives network splits). You can guarantee only 2 of 3; real systems choose AP or CP.
What's the trade-off between normalization and denormalization?
Normalization reduces redundancy and update anomalies but increases join complexity and query costs; denormalization speeds reads via pre-computed data but risks inconsistency and higher write costs.
Explain indexing: what problem does it solve and what's the cost?
Indexes speed up SELECT/WHERE queries from O(n) to O(log n), but consume extra storage, slow down INSERT/UPDATE/DELETE operations, and require maintenance overhead.
What is sharding and what problems does it create?
Sharding horizontally partitions data across servers by key (e.g., user_id % num_shards). Solves scalability but creates complexity: hotspots, uneven distribution, cross-shard joins become expensive, and rebalancing is hard.
Define eventual consistency and when it's acceptable.
System guarantees that if no new writes occur, all nodes converge to identical state, but reads may temporarily see stale data. Acceptable for social feeds, caches, analytics; unacceptable for inventory, payments.
What is a write-ahead log (WAL) and why do databases use it?
WAL records every write to disk before applying it in memory. Enables durability (survives crashes) and recovery; trade-off is that every write requires 2 I/O operations (log + data).
Explain the N+1 query problem and how to avoid it.
Fetching parent records then looping to query children individually results in N+1 queries. Solve via: join in single query, batch loading, lazy loading with eager load hints, or GraphQL DataLoader pattern.
What is the difference between vertical and horizontal scaling for databases, and why is horizontal harder?
Vertical = bigger machine (CPU, RAM, disk); simple but hits limits and requires downtime. Horizontal = more machines; handles growth better but requires distributed consensus, replication, sharding logic, and cross-node transaction complexity.
Make your own Databases study set
Flashcards for related topics
Studying Databases to build with AI? MindloomHQ turns it into real skills — structured courses, agent projects, and certificates.
Explore MindloomHQ →