Skip to content
tezvyn:

All bites

The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.

8668 bites

Page 43

Databases & Architecture1 min read

Sessionizing clickstream events into sessions

Order events per user, split on inactivity gap, assign session ids, pick event or session grain.

Databases & Architecture1 min read

Vectorized query execution and its speedups

Process column batches per operator call, amortize per-tuple overhead, use cache locality and SIMD.

Databases & Architecture2 min read

The buffer pool's role in database IO

Caches pages, serves reads from RAM, buffers dirty writes flushed later, uses eviction like LRU.

Databases & Architecture1 min read

Predicate pushdown and why it speeds queries

Apply WHERE conditions at the scan or remote source, prune partitions and rows early, shrink data movement.

Databases & Architecture1 min read

Denormalization: trading write cost for read speed

Duplicate or precompute data to avoid joins, accept harder writes and consistency risk, justify by read-heavy access.

Databases & Architecture1 min read

Upgrading a stateful Flink job without losing state

Take a savepoint, stop with drain, deploy new jar, restore from savepoint with matching operator UIDs.

Databases & Architecture1 min read

Tuning a database connection pool

Max size, min idle, connection and max-lifetime timeouts; size from cores and latency, not guesswork.

Databases & Architecture1 min read

The N+1 query problem and how to fix it

One query for a list plus one per item for its relation, fix with eager loading or a batched join.

Databases & Architecture1 min read

Synchronous vs asynchronous replication trade-offs

Sync waits for replica ack giving zero data loss but higher latency; async acks immediately, faster but risks losing recent writes on failover.

Databases & Architecture1 min read

Choosing a good shard key and avoiding hot spots

High cardinality, even write distribution, query alignment; monotonic keys send all writes to one shard.

Databases & Architecture1 min read

When a graph database beats relational or document stores

Deeply connected data, variable-depth traversals, fraud or recommendation paths, index-free adjacency.

Databases & Architecture1 min read

SQL isolation levels and the anomalies they prevent

Read Uncommitted allows dirty reads; Read Committed blocks them; Repeatable Read blocks non-repeatable reads; Serializable blocks phantoms.

Databases & Architecture1 min read

Zero-downtime schema migration on a hot table

Expand-migrate-contract phases, dual-write and backfill, decouple deploys from migrations.

Databases & Architecture2 min read

Tuning HNSW for recall vs latency

ANN trades exactness for speed, and HNSW knobs M and efConstruction shape graph quality while efSearch trades query latency for recall at runtime.

Databases & Architecture1 min read

TSM-Tree vs LSM-Tree storage engines

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 & Architecture1 min read

The analysis phase: tokenizers and token filters

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 & Architecture1 min read

Vector embeddings and vector databases

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 & Architecture1 min read

Cache-aside pattern pros and cons

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 & Architecture1 min read

Inverted index in search engines

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

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.