bigonotes
System DesignData Modeling

Data Modeling in an Interview

A step-by-step checklist for sketching a schema during a system design interview, plus sensible database defaults.

3 min readLast updated

In a system design interview you don't need a complete, textbook data model. You need a schema detailed enough to show how your design serves its main queries. This note pulls the data modeling lessons together into a checklist you can follow on the whiteboard.

When data modeling happens#

Data modeling isn't one step in the interview. It shows up at two points:

  1. Core entities step: list the main entities early, as a short list of nouns such as Student, Course and Enrollment.
  2. High-level design step: when you draw a database, sketch its schema next to it: key fields, relationships, and how you'd index or partition it for the main queries.

The checklist#

Each time you add a database to your design, walk through the same six steps:

  1. Pick the type of database.
  2. List the columns each entity needs to meet the functional requirements. Skip obvious ones.
  3. Mark primary and foreign keys for each relationship.
  4. Decide which columns need indexes, tied to specific queries.
  5. Decide whether any read path needs denormalization.
  6. Decide whether sharding is needed. If so, pick a shard key that matches the main access pattern.

You don't need much on the board. The result can be as light as this:

A Postgres schema sketch: students, enrollments and courses tables with primary keys, foreign keys and indexed columns marked, and lines showing that enrollments references both students and courses

Sensible defaults for the database type#

Step 1 of the checklist, picking the database type, is where people stall. Each need has a sensible default:

Need Default Notes
Core entities, money, relationships Relational (PostgreSQL) ACID, joins, constraints. The reliable source of truth.
Faster reads of hot data Key-value (Redis) in front of the source of truth Cache-aside: check Redis, on a miss read PostgreSQL and fill the cache. Also good for sessions and rate limits.
Schema that changes often or varies per record Document (MongoDB) Mention it when prompted, or when records are polymorphic.
Very high write volume: logs, events, time series Wide-column (Cassandra) Move only those tables; keep core data relational.
Deep relationship traversal Graph Rarely worth it. Usually relational plus a cache of adjacency lists is enough.

In practice you start with one store and add others as needs appear. A typical progression:

  1. Start with PostgreSQL for relationships and consistency.
  2. If read latency is too high, add Redis in front.
  3. If one table's writes exceed a single leader's capacity, move it to Cassandra.
  4. If the schema is unpredictable, mention a document store as an alternative.

Details for each model are in Types of Databases.

How to phrase it#

Once you've picked the stores, say why out loud. Short, reasoned sentences work best when you name each one.

  • The default: "PostgreSQL is the default here. It gives us ACID transactions and integrity, and for this system a relational model's reliability matters more than raw horizontal scale."
  • The cache: "Redis caches hot data. On a miss we read from PostgreSQL, the source of truth, and fill the cache for later requests."
  • High writes: "Event logs go to a wide-column store like Cassandra, which scales writes horizontally beyond what one relational leader can handle."

Key takeaways#

  • List entities early; sketch the schema when the database appears in your high-level design.
  • Follow the checklist: type, columns, keys, indexes, denormalization, sharding.
  • Default to PostgreSQL. Add Redis for read speed and Cassandra for extreme write volume.
  • Only document the columns that matter to your design.
Revision notes · 1 min

Core idea#

An interview schema needs only enough detail to show how the design serves its main queries. Follow a fixed checklist each time you add a database.

When it happens#

  • Core entities step: list the main nouns early, such as Student, Course, Enrollment.
  • High-level design step: sketch the schema next to each database you draw.

The checklist#

  1. Pick the type of database.
  2. List the columns each entity needs. Skip obvious ones.
  3. Mark primary and foreign keys.
  4. Index columns tied to specific queries.
  5. Decide whether a read path needs denormalization.
  6. Decide whether to shard, and pick a key from the main access pattern.

Defaults#

Need Default
Core entities, money, relationships PostgreSQL
Faster reads of hot data Redis in front, cache-aside
Schema varies per record Document store (MongoDB)
Very high write volume: logs, events Cassandra, for those tables only
Deep relationship traversal Graph, rarely; usually relational plus a cache

Pitfalls#

  • Writing out every column. Document only the columns that matter to the design.
  • Moving core data out of PostgreSQL when only one table is write-heavy.

Say it in an interview#

  • "PostgreSQL is the default. It gives ACID transactions and integrity."
  • "Redis caches hot data. On a miss we read PostgreSQL and fill the cache."
  • "Event logs go to Cassandra, which scales writes beyond one relational leader."

Found a mistake? Email ask@bigonotes.com