Data Modeling

Dated Jun 6, 2026; last modified on Sat, 06 Jun 2026

Notes

Choosing what data to store and how to structure it directly affects performance, scalability, and maintenance.

Relational databases are useful when you have structured data with clear relationships and need strong consistency (transaction-based actions, enforcing foreign key constraints). NoSQL databases shine for flexible schemas or when you need to scale horizontally across many servers without complex joins.

Normalization refers to splitting data across tables to avoid duplication, e.g., you have a users table, and orders table, and a products table, where each order references a userId and productId. Normalized data is easy to keep consistent, e.g., updating a product name is limited to the products table. However, getting complete data needs joins, which get expensive on huge/many tables.

Denormalization involves duplicating data, e.g., orders table contains the userName as well. This allows faster reads. However, updates are costly, e.g., an updated userName needs to be propagated across multiple records that have a copy.

NoSQL databases also require specifying the partition key and sort key. For a social media app, userId as the partition key makes “get all posts for user X” fast at the expense of queries like “get all posts mentioning hashtag Y”.

References

  1. Core Concepts for System Design Interviews. www.hellointerview.com . Accessed Jun 6, 2026.