When should you denormalize a database, and what are the risks?
When should you denormalize a database, and what are the risks?
Denormalization deliberately stores redundant or pre-computed data to make reads cheaper. Do it after measuring, not by default: a normalized design is easier to keep correct.
| Technique | Example |
|---|---|
| Redundant column | orders.customer_name copied from customers |
| Counter / summary column | posts.comment_count |
| Summary table | daily_sales(day, product_id, revenue) |
| Materialized view | pre-joined report that you refresh |
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.