MongoDB WiredTiger offers LSMT for storage. Great, so in memory it maintains a balanced search tree which is flushed to disk depending on configuration (time or size). But q is, how is the data stored on disk? LSMT in Cassandra/HBase are stored as immutable files. These are compacted from time to time. Data is inserted/updated/deleted as cells which are part of a logical distributed dictionary. So each cell is identified by key, column name and version.
But MongoDB uses BSON. This is a single document.so q arises:
- Does MongoDB break down BSON into cells and updates/versions them? Most unlikely, since BSON was designed for disk storage.
- In that case, how is the memtable (balanced search tree) update the BSON file? Is the BSON file mutable? LSMT uses immutable files in Cassandra/HBase.
- In general, how does MongoDB WT do updates? Mutable files on disk, or immutable, and the effort for index management? Since MongoDB offers lots of indexing types.
Thanks