tezvyn:

Databases & Architecture

SQL, NoSQL, system design, microservices, APIs

289 bites

More in Databases & Architecture — page 4

Databases & Architecture80 sec read

Least privilege for database service accounts

WHAT IT TESTS: secure access design. OUTLINE: grant each account only the minimum rights its job needs; for an app service account, scope grants to specific tables and verbs, never use the superuser.

Databases & Architecture71 sec read

Full, differential, and incremental backups

WHAT IT TESTS: backup-strategy tradeoffs. OUTLINE: full copies everything; differential copies all changes since the last full; incremental copies changes since the last backup of any type.

Databases & Architecture75 sec read

Mitigating a database shard hot spot

WHAT IT TESTS: load-distribution remedies. OUTLINE: short-term, add read replicas or cache the hot keys; long-term, fix the partition key with hashing, salting, or finer-grained splitting. RED FLAG: only adding hardware without addressing the skewed key.

Databases & Architecture77 sec read

Split-brain, consensus, and quorum

WHAT IT TESTS: partition handling. OUTLINE: split-brain is two nodes both believing they are leader during a partition; Raft/Paxos require a majority quorum to elect a leader and commit, so the minority side cannot make progress.

Databases & Architecture76 sec read

Durable write path in a sharded KV store

WHAT IT TESTS: end-to-end durable write design. OUTLINE: route by key hash to the shard leader, append to WAL and fsync, replicate to two followers, ack on quorum, then confirm. RED FLAG: confirming the client before any durable persistence.

Databases & Architecture69 sec read

What is eventual consistency?

WHAT IT TESTS: consistency-model tradeoffs. OUTLINE: replicas converge to the same value if writes stop, allowing temporary staleness for higher availability and lower latency. RED FLAG: claiming it means data is wrong or never converges.

Databases & Architecture71 sec read

Leader-follower vs multi-leader replication

WHAT IT TESTS: replication topology tradeoffs. OUTLINE: single-writer leader-follower is simple but a write bottleneck; multi-leader accepts writes in many regions for latency and availability. RED FLAG: ignoring that multi-leader needs conflict resolution.

Databases & Architecture2 min read

Range-based vs hash-based sharding trade-offs?

WHAT IT TESTS: choosing a shard strategy by query pattern. OUTLINE: range sharding keeps ordered keys together, great for range scans but prone to hot spots on sequential keys; hash sharding spreads keys evenly, avoiding hot spots but killing efficient range…

Databases & Architecture2 min read

Apply the CAP theorem to a real system

WHAT IT TESTS: applying CAP to concrete systems. OUTLINE: define C, A, P; note partitions are unavoidable, so the real choice during one is consistency versus availability; then classify a system as CP or AP with reasoning.

Databases & Architecture2 min read

What is sharding and why shard over vertical scaling?

WHAT IT TESTS: horizontal partitioning rationale. OUTLINE: sharding splits one dataset across servers by a shard key so each holds a subset; you shard because vertical scaling hits hardware ceilings, gets costly, and remains a single point of failure.

Databases & Architecture85 sec read

What is database replication and why use it?

WHAT IT TESTS: basics of copying data across nodes. OUTLINE: replication keeps copies of data on multiple servers; primary benefits are high availability through failover and improved read scalability by spreading reads.

Databases & Architecture2 min read

What is an OLAP cube and its operations?

WHAT IT TESTS: multidimensional analysis concepts. OUTLINE: a cube pre-aggregates measures across dimensions; operations are slice, dice, drill-down, roll-up, and pivot.

Databases & Architecture2 min read

Why separate storage and compute in a cloud warehouse?

WHAT IT TESTS: understanding decoupled warehouse architecture. OUTLINE: data lives in cheap shared object storage while independent compute clusters scale separately, enabling elastic, concurrent, isolated workloads and pay-per-use.

Databases & Architecture2 min read

What is a Type 2 slowly changing dimension?

WHAT IT TESTS: preserving history in dimensional models. OUTLINE: an SCD handles dimension attributes that change over time; Type 2 inserts a new row per change with a surrogate key and validity dates, marking one current.

Databases & Architecture2 min read

How does columnar storage speed up analytics?

WHAT IT TESTS: physical storage layout versus query type. OUTLINE: columnar stores each column contiguously, so aggregations read only needed columns, scan far less data, and compress better with vectorized execution.

Databases & Architecture88 sec read

Star schema vs snowflake schema trade-offs?

WHAT IT TESTS: dimensional design trade-offs. OUTLINE: star keeps dimensions denormalized for fewer joins and faster simpler queries; snowflake normalizes dimensions into sub-tables saving space and easing maintenance but adding joins.

Databases & Architecture85 sec read

What is the difference between ETL and ELT?

WHAT IT TESTS: knowing where transformation runs in a pipeline. OUTLINE: ETL transforms before loading, on a separate engine; ELT loads raw then transforms inside a scalable warehouse. Choose ELT with cloud warehouses and large raw or schema-on-read data.

Databases & Architecture84 sec read

What is a star schema?

WHAT IT TESTS: dimensional modeling fundamentals. OUTLINE: a central fact table of measures and foreign keys surrounded by denormalized dimension tables of descriptive attributes, joined in one hop for fast, simple analytical queries.

Databases & Architecture80 sec read

What is the difference between OLTP and OLAP?

WHAT IT TESTS: understanding two opposite workload profiles. OUTLINE: OLTP handles many short read-write transactions on normalized current data; OLAP runs few large analytical scans over denormalized historical data.

Databases & Architecture87 sec read

What consistency do you sacrifice in an AP system?

WHAT IT TESTS: precise reasoning about consistency models and anomaly handling. OUTLINE: you give up linearizability and often sequential consistency, accepting stale reads and conflicts, then mitigate with quorums, vector clocks or CRDTs, and…