What is Modeling?
Application의 요구사항과 Database 성능의 균형을 맞추는 것
➡️ 공략법 이라고 할 수 있다!
mongoDB는 스키마가 자유롭기 때문에 어떻게 모델링하는지에 따라 성능과 얼마나 쉽게 쿼리할 수 있는지가 결정된다.
Embedding vs Referencing
read 빠르지만, write 느림
read 느리지만, write 빠름
Reducing Long Array’s
: 배열의 크기에 따라 embedding할지 referencing할지 결정될 수 있다.
배열이 길어지면 데이터를 더 이상 삽입하지 못하게 될 수가 있다.
컬렉션 일부를 나누어서 배열의 크기를 줄이는 등의 방법으로 해결 가능
Reducing Resources