ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Denormalized vs Normalized Databases
    📚 데이터베이스/데이터베이스 모델링 2022. 7. 15. 08:40

     

    정규화의 장점 : 데이터의 중복을 피하고, update/delete anomaly를 피할수있다 

    정규화의 단점 : 필요시 join연산을 계속 수행해야한다 

     

    데이터의 중복을 피하기 위해서 normalization은 중요하지만 요구사항에 따라서 denormalization이 유용한 경우도 있다.

    => 자주 사용되는 정보는 denormalized된 형태로 저장해두는 편이 performance면에서 나을때도 있다 ! 

     

    Normalized databases are designed to minimize redundancy, while denormalized databases are designed to optimize read time.

    In a traditional normalized database with data like Courses and Teachers, Courses might contain a column called TeacherID, which is a foreign key to Teacher. One benefit of this is that information about the teacher (name, address, etc.) is only stored once in the database. The drawback is that many common queries will require expensive joins.

    Instead, we can denormalize the database by storing redundant data. For example, if we knew that we would have to repeat this query often, we might store the teacher's name in the Courses table. Denormalization is commonly used to create highly scalable systems.

    ref: cracking the coding interview (6th edition)
Designed by Tistory.