How do MongoDB’s different storage options change the way you model your data?
Each storage engine, WiredTiger, the In-Memory Storage engine, MMAP V1 and other community supported drivers, persists data differently, writes data to disk in different formats and handles memory resources in different ways.
This webinar will go through how to design applications around different storage engines based on your use case and data access patterns. We will be looking into concrete examples of schema design practices that were previously applied on MMAPv1 and whether those practices still apply, to other storage engines like WiredTiger.
Topics for review: Schema design patterns and strategies, real-world examples, sizing and resource allocation of infrastructure.
6. Why do we have so some many
options?
MMAP V1WT 3rd
Party
Available 3.2 Your
own?
In-memoryEncrypted
7. Example of Document Definition
• App1
- Realtime dashboard
- Ad hoc queries
- User profiles
• App2
- Heavy writes batch process
- Analytics workload
- Multi-tenant application
29. MMAPv1 / Basics
• Data is Mapped into virtual Memory for
Fast access
• Documents pointers are request per
access
• If in Memory = fast
• If not = Disk seek
• Indexes follow the same structure
• Allocation based on Database per file
67. What to Look For
Bucketing Read/Write RatioIn-place Update
68. Update Process
• Apply changes to your schema design
• Check if there's any performance regression
• Make sure you have CPU resources available
• Swap secondary nodes
• Swap primary
• Enjoy the increased performance!
69. Example of Document Definition
• App1
- Realtime dashboard
- Ad hoc queries
- User profiles
• App2
- Heavy writes batch process
- Analytics workload
- Multi-tenant application
70. Example of Document Definition
• App1
- Realtime dashboard
- Ad hoc queries
- User profiles
• App2
- Heavy writes batch process
- Analytics workload
- Multi-tenant application
WiredTiger or MMAPv1
71. Example of Document Definition
• App1
- Realtime dashboard
- Ad hoc queries
- User profiles
• App2
- Heavy writes batch process
- Analytics workload
- Multi-tenant application
WiredTiger or MMAPv1 WiredTiger