Skip to content
tezvyn:

Databases

229 bites tagged Databases — interview questions with model answers, and 60-second explainers.

Databases & Architecture2 min read

Causal Consistency: A Memory Model for Concurrency

Causal consistency is a rulebook for concurrent systems, defining legal data access patterns. It's used to ensure correctness in distributed shared memory and transactions, preventing data corruption from simultaneous operations.

Databases & Architecture2 min read

Raft: Understandable Distributed Consensus

Raft gets a cluster of servers to agree on a shared state by electing a leader to manage a replicated log. It's used to build fault-tolerant systems that must maintain a consistent state machine. The footgun: assuming 'easier than Paxos' means 'easy'.

Databases & Architecture2 min read

Vector Clocks: Tracking Causality in Distributed Systems

A vector clock is an array of counters, one for each node, that tracks causality across a distributed system. It's how databases resolve conflicting writes.

Databases & Architecture2 min read

Two-Phase Commit (2PC): All or Nothing, Together

Two-Phase Commit (2PC) ensures a distributed transaction is atomic: all participants either commit or abort together. A coordinator first asks all nodes to prepare (vote), then issues a final commit or abort.

Databases & Architecture2 min read

Quorum: How Distributed Systems Agree Without Unanimity

A quorum is a majority vote for distributed systems, letting them operate without waiting for every node. It's used in databases and consensus algorithms to ensure consistent writes. The footgun is setting the quorum too low, risking conflicting decisions.

Databases & Architecture2 min read

Read Replicas: Scale Out Your Database Reads

A read replica is a read-only copy of your database that handles query traffic. Use it for read-heavy apps to prevent your primary DB from becoming a bottleneck. The footgun: replication is asynchronous, so reads from a replica can return slightly stale data.

Databases & Architecture2 min read

MOLAP: A Pre-Computed Cube for Fast Analytics

MOLAP pre-calculates business data into a multi-dimensional "cube" for near-instant analytics. Use it for BI dashboards requiring fast responses to complex queries. The footgun: the cube is a static snapshot, and building it can be slow and rigid.

Databases & Architecture2 min read

OLAP Cube Operations

OLAP cube operations let you analyze data like a multi-dimensional spreadsheet. Instead of just rows and columns, you navigate dimensions like time and location. Used in business intelligence to answer complex analytical questions.

Databases & Architecture2 min read

Dimension Tables: The 'Who, What, Where, When' of Your Data

Dimension tables provide the descriptive context—the 'who, what, where, when'—for raw numbers in a fact table. They are the backbone of data warehouses, letting you slice sales data by product or region. The footgun is polluting them with transactional data.

Databases & Architecture2 min read

Fact Table: The Numbers in Your Data Warehouse

A fact table is the ledger of business events, recording what happened and how much. It's the core of a data warehouse, holding sales figures or page views. The footgun is storing descriptive text here; that belongs in linked dimension tables.

Databases & Architecture2 min read

Vector Databases: Searching by Meaning, Not Keywords

A vector database finds "what's most like this?" instead of "find me exactly this." It organizes data by semantic meaning, not just exact values, making it ideal for recommendation engines, semantic search, or finding similar images.

Databases & Architecture2 min read

Polyglot Persistence: Use the Right Database for the Job

Polyglot persistence means using multiple, specialized data stores in one system. Instead of one database handling everything, you might use a relational DB for transactions, a document DB for profiles, and a graph DB for connections.

Databases & Architecture1 min read

Time Series Database: A Logbook, Not a Filing Cabinet

A Time Series Database (TSDB) is a specialized logbook for data that happens over time, like server metrics or sensor readings. It's built for high-speed writes and fast range queries. The footgun: don't use it for relational data like user profiles.

Databases & Architecture2 min read

Database Sharding: Splitting Data for Scale

Sharding splits a database across multiple servers, like dividing a phone book into A-M and N-Z volumes. It's used when a single server can't handle the data size or write load. The footgun is that querying across shards is complex and slow.

Databases & Architecture2 min read

Graph Databases: When Relationships Are the Data

A graph database treats connections between data as first-class citizens. It's ideal for social networks or fraud detection where you query relationships by traversing links. The footgun is using it for simple tabular data where a relational DB is faster.

Databases & Architecture2 min read

Wide-Column Store: Flexible Schema for Massive Datasets

A wide-column store is like a spreadsheet where each row can have its own unique columns. It's ideal for sparse data like user profiles or IoT readings. The footgun is thinking it's just a relational table with many columns—the flexibility is the point.

Databases & Architecture2 min read

Eventual Consistency: Availability Now, Correctness Later

Eventual consistency prioritizes availability by letting replicas temporarily disagree. If updates stop, all nodes will eventually converge on the same value.

Databases & Architecture2 min read

Document Databases: Store Data as Flexible Objects

A document database stores data as self-contained objects, like JSON, instead of rows and columns. It's ideal for user profiles or product catalogs where each item might have different attributes. The footgun is treating it as a schema-less free-for-all.

Databases & Architecture2 min read

NoSQL: Databases Beyond Rigid Tables

NoSQL databases trade rigid tables for flexible models like documents or key-value pairs. This allows them to scale for massive, unstructured datasets from social media or IoT.

Databases & Architecture2 min read

PostgreSQL's Free Space Map: Finding Room to Write

A Free Space Map is a table of contents for empty space in a Postgres table. It lets Postgres quickly find a page with enough room for a new row or index entry, avoiding a slow scan. It's used on every INSERT/UPDATE.

Databases & Architecture2 min read

ARIES Recovery Algorithm

ARIES is a widely-used database recovery algorithm, found in systems like IBM Db2 and SQL Server. It enables high performance by supporting a 'no-force, steal' policy, ensuring data integrity after a crash. The main footgun is not understanding this policy.

Databases & Architecture2 min read

LSM-Tree: Fast Writes, Later Merges

An LSM-tree optimizes for high-volume writes by batching them in memory before flushing to disk, like a notepad for a busy filing cabinet. It's used in databases like Cassandra for write-heavy tasks. The footgun is unpredictable read latency.

Databases & Architecture2 min read

Database Checkpoints: Faster Recovery After a Crash

A database checkpoint creates a known good point for faster crash recovery. Instead of writing every change to disk, it periodically flushes modified data from memory, reducing the amount of log data to process.

Databases & Architecture2 min read

Slotted Page Structure: Stable Pointers on Disk

A slotted page organizes data by growing records from the end of the page and pointers from the beginning. This allows databases to handle variable-sized records without costly reshuffling, keeping pointers stable.

Get Databases bites daily.

Five a day, five minutes, offline. With quizzes so it sticks.

Open testing — you’ll join as an early tester.