MongoDB Caching Internals
Hey, I am Uddeshya 👋
SDE-2 @ GTF (GoTo Finance), OSS Enthusiast, Occasional database tinkerer, Manchester United Masochist
Twt - @uds5501
Github - @uds5501
Email - singhuddeshyaofficial@gmail.com
Agenda (Broadly)
This talk is not… ❌
MongoDB
Famous NoSQL database with highly flexible data modelling support
General databases?
WiredTiger Storage Engine
The Good
WiredTiger Storage Engine
The Bad
Architecture Overview
Act - 1
Gateways to engine
APIs
Act - 2
The building blocks
Schema
Cursors
Metadata
dHandles
Act - 3
In Memory Storage
B Trees
Act - 4
Writing something?
Transactions!
Snapshots
Cache
Block Manager
Tracking the blocks
Why use skiplists?
When to use what?
Enough of disk, back to memory.
Caching internals!
Cache struction tracks
Eviction dance
How are pages selected for eviction?
How many slots are available?
Where do I evict from?
Which page do I select to evict?
But what if cache grows too large?
Application threads pulling up.
Optimization conclusions
Arigato!