tezvyn:

Databases & Architecture

SQL, NoSQL, system design, microservices, APIs

289 bites

Databases & Architecture72 sec read

Tuning a database connection pool

WHAT IT TESTS: connection-pool sizing intuition. OUTLINE: max size, min idle, connection and max-lifetime timeouts; size from cores and latency, not guesswork.

Databases & Architecture78 sec read

The N+1 query problem and how to fix it

WHAT IT TESTS: recognizing ORM lazy-loading waste. OUTLINE: one query for a list plus one per item for its relation, fix with eager loading or a batched join. RED FLAG: blaming the database, or fixing it by caching instead of reducing round trips.

Databases & Architecture67 sec read

Synchronous vs asynchronous replication trade-offs

WHAT IT TESTS: durability versus latency tradeoff. OUTLINE: sync waits for replica ack giving zero data loss but higher latency; async acks immediately, faster but risks losing recent writes on failover.

Databases & Architecture71 sec read

Choosing a good shard key and avoiding hot spots

WHAT IT TESTS: shard-key design tradeoffs. OUTLINE: high cardinality, even write distribution, query alignment; monotonic keys send all writes to one shard. RED FLAG: optimizing only for cardinality while ignoring write skew, or claiming any unique key works.

Databases & Architecture69 sec read

When a graph database beats relational or document stores

WHAT IT TESTS: fit between graph data and traversal queries. OUTLINE: deeply connected data, variable-depth traversals, fraud or recommendation paths, index-free adjacency.

Databases & Architecture70 sec read

SQL isolation levels and the anomalies they prevent

WHAT IT TESTS: the isolation-anomaly mapping. OUTLINE: Read Uncommitted allows dirty reads; Read Committed blocks them; Repeatable Read blocks non-repeatable reads; Serializable blocks phantoms.

Databases & Architecture78 sec read

Zero-downtime schema migration on a hot table

WHAT IT TESTS: safe online schema evolution. OUTLINE: expand-migrate-contract phases, dual-write and backfill, decouple deploys from migrations. RED FLAG: a single blocking ALTER plus drop-old-column in one release, breaking running code.

Databases & Architecture2 min read

Tuning HNSW for recall vs latency

WHAT IT TESTS: tuning ANN index parameters. OUTLINE: ANN trades exactness for speed, and HNSW knobs M and efConstruction shape graph quality while efSearch trades query latency for recall at runtime.

Databases & Architecture89 sec read

TSM-Tree vs LSM-Tree storage engines

WHAT IT TESTS: storage-engine internals for time-series. OUTLINE: both buffer writes in memory and flush sorted immutable files, but TSM organizes by series and time with columnar, heavily compressed blocks tuned for ordered appends and range scans.

Databases & Architecture84 sec read

The analysis phase: tokenizers and token filters

WHAT IT TESTS: understanding text analysis in search indexing. OUTLINE: analysis turns raw text into index terms via a tokenizer that splits text into tokens then token filters that transform them, like lowercasing or stemming.

Databases & Architecture88 sec read

Vector embeddings and vector databases

WHAT IT TESTS: grasp of embeddings and ANN search. OUTLINE: an embedding is a learned dense vector capturing semantic meaning, and vector DBs use ANN indexes like HNSW for fast similarity search that relational B-trees cannot provide.

Databases & Architecture83 sec read

Cache-aside pattern pros and cons

WHAT IT TESTS: knowing lazy-loading caching and its consistency cost. OUTLINE: app reads cache, on miss loads DB and populates, invalidates on write; pros are resilience and lean cache, cons are stale windows and app-managed invalidation.

Databases & Architecture87 sec read

Inverted index in search engines

WHAT IT TESTS: understanding the core search data structure. OUTLINE: an inverted index maps each term to the list of documents containing it, making keyword lookup O(1)-ish instead of scanning every document.

Databases & Architecture2 min read

Iceberg vs Delta Lake metadata and ACID

WHAT IT TESTS: deep table-format internals. OUTLINE: Iceberg uses a tree of metadata and manifest files with atomic pointer swaps and optimistic concurrency; Delta uses an ordered transaction log of JSON commits with optimistic concurrency.

Databases & Architecture88 sec read

The small files problem in data lakes

WHAT IT TESTS: diagnosing storage-layout performance issues. OUTLINE: many tiny files create per-file overhead and metadata pressure, hurting scans; fix via compaction, batching writes, and tuning partitioning.

Databases & Architecture85 sec read

Exactly-once semantics in stream processing

WHAT IT TESTS: understanding delivery guarantees and effects. OUTLINE: exactly-once means each event affects state once despite retries, it is hard because of failures between processing and committing, and you achieve it via idempotency or atomic…

Databases & Architecture85 sec read

Clickstream architecture for real-time and batch

WHAT IT TESTS: designing a dual-path streaming pipeline. OUTLINE: ingest events into a log like Kafka, fan out to a real-time path for dashboards and a batch path to a lake for ad-hoc analysis. RED FLAG: a single path that can't serve both latency profiles.

Databases & Architecture86 sec read

Schema-on-read in data lakes

WHAT IT TESTS: understanding deferred schema application. OUTLINE: structure is applied at query time not ingest, enabling flexible raw storage and ML, but costing query-time validation and risking data swamps.

Databases & Architecture79 sec read

Data warehouse vs data lake

WHAT IT TESTS: distinguishing two storage paradigms. OUTLINE: warehouses store structured, schema-on-write data for BI; lakes store raw multi-format data with schema-on-read for exploration and ML.

Databases & Architecture82 sec read

Multi-region active-passive DR with Aurora

WHAT IT TESTS: designing cross-region DR with clear RPO/RTO. OUTLINE: async global replication to a passive region, promote and repoint traffic on failover, and fence the old primary to prevent split-brain.