Tags

Database

Database

0 lessons
3 system designs
10 community items

database

System Design

3 articles
System Design

SQL vs NoSQL - Choosing the Right Database

SQL vs NoSQL is the most common storage decision in system design interviews. SQL databases give you ACID guarantees, joins, and a fixed relational schema; NoSQL databases give you flexible schemas, horizontal scaling, and specialized data models. This lesson teaches you the four NoSQL families, the real engineering trade-offs, and a clear decision framework so you can defend your database choice in any interview.

sql
nosql
database
acid
data-modeling
horizontal-scaling
system-design
beginner

525

15

Easy
System Design

Database Indexing & Query Optimization

Indexes turn O(N) full-table scans into O(log N) lookups, but every index costs storage and slows writes. This lesson teaches how B-tree and hash indexes work, when to use composite or covering indexes, how to read an EXPLAIN plan, and the common indexing mistakes that cause production outages. By the end you can defend any indexing decision in an interview and diagnose a slow query in production.

database-indexing
query-optimization
sql
btree
performance
database
system-design
beginner

332

10

Easy
System Design

Database Sharding & Partitioning Strategies

Sharding splits a database into many smaller pieces (shards) so writes and storage can scale across servers. The hard part is not the splitting; it is choosing a shard key that avoids hot shards, supporting cross-shard queries, and rebalancing as the data grows. This lesson covers the four sharding strategies, how to pick a shard key, the operational realities of resharding, and when sharding is the wrong answer.

data-partitioning
partitioning
database
horizontal-scaling
consistent-hashing
sql
system-design
intermediate

282

5

Medium

Community

10 items
Article

Transaction Isolation Levels with Failing Examples

Read uncommitted, read committed, repeatable read, serializable. Each level explained with a runnable two-session SQL example showing exactly which anomaly it allows or prevents.

database
sql
acid
concurrency
optimistic-locking

493

9

4.4 (14)

May 3, 2026

by @rohaneriksson

Article

N+1 Queries: Detection and Prevention

What an N+1 query is, why ORMs hide them, the four ways to fix them, and the simple logging change that has caught every N+1 I have shipped since I added it.

database
performance
query-optimization
backend
debugging

806

11

4.5 (10)

Apr 23, 2026

by @adaezeaziz

Question Bundle
$14.99

PostgreSQL MVCC and Isolation Level Deep Dive

A 5-question reference set on PostgreSQL's MVCC implementation: tuple versioning, READ COMMITTED vs REPEATABLE READ vs SERIALIZABLE, row-level locks, and the autovacuum machinery that keeps txid wraparound at bay.

Python
sql
database
concurrency
interview-prep

668

13

4.4 (16)

Apr 20, 2026

by CodeSnatch

Article

SQL vs NoSQL: Stop Asking the Wrong Question

The choice that matters is not the data model. It is which guarantees you need on read and write. A decision table and the JSONB middle ground that retired half my Mongo use cases.

database
sql
nosql
data-modeling
scalability

967

9

4.3 (14)

Apr 20, 2026

by @tylerperry

Question Bundle
Free

Django ORM N+1 and prefetch_related Drill

Four questions on Django ORM patterns I keep flagging in code review: spotting N+1 in templates, choosing select_related vs prefetch_related, slicing prefetches, and avoiding the .count() trap.

Python
framework
database
query-optimization
interview-prep

412

14

4.4 (9)

Apr 16, 2026

by @freyadiallo

Article

B-Trees and Why Databases Love Them

High fanout, leaf chaining, and the asymmetric access cost that has kept the B+ tree at the heart of PostgreSQL, MySQL InnoDB, MongoDB WiredTiger, and SQLite for fifty years.

b-tree
b-plus-tree
database-indexing
database
data-structures

724

18

4.6 (9)

Mar 31, 2026

by @valentinamwangi

Article

Database Migrations: A Zero-Downtime Playbook

Adding a column, renaming a column, dropping a column, splitting a table. The expand-contract pattern, the four-step rename, and the migration phases that have kept me from taking the site down.

database
sql
reliability
backend
data-modeling

659

16

Mar 22, 2026

by @hannahchakraborty

Article

MongoDB Aggregation Pipelines, by Example

Match, group, lookup, project, the four stages I use 90% of the time. Real pipelines for funnel analysis, leaderboard, and a one-stage join, with the gotchas that surprise SQL refugees.

database
nosql
query-optimization
data-modeling
performance

582

6

4.5 (11)

Feb 1, 2026

by @fatimapark

Article

Connection Pooling, PgBouncer, and the Prisma Trap

What a connection pool actually does, why your Postgres falls over at 200 connections, where PgBouncer sits, and the prepared-statement bug that bites every Prisma team that adds it the wrong way.

database
performance
backend
scalability
reliability

322

2

4.3 (13)

Jan 8, 2026

by @ananyanakamura

Article

Database Indexes Explained with Real EXPLAIN Output

What an index actually is, how the planner picks one, and the EXPLAIN output I read every day. Postgres examples, real numbers, and the three indexing mistakes I keep finding in code review.

database
database-indexing
sql
query-optimization
performance

1.1k

24

4.4 (16)

Dec 2, 2025

by @theowatanabe