First time hearing this term, thanks for writing this up Saurabh! Aren't these systems prone to data loss - specifically during the memtable part where the data is stored in memory? Also, do you know if MongoDB also uses the LSM Tree approach, or is this more like your Redis and similar stuff?
Saurabh friend is delivering high quality content as always! 💪
Thank you Daniel!
First time hearing this term, thanks for writing this up Saurabh! Aren't these systems prone to data loss - specifically during the memtable part where the data is stored in memory? Also, do you know if MongoDB also uses the LSM Tree approach, or is this more like your Redis and similar stuff?
Thanks Akos!
The WAL file takes care of the data loss.
As far as MongoDB is concerned, their storage engine WiredTiger uses B-Tree by default. But there is also an option to go with LSM Tree.
Thanks, Saurabh, for the clarifications! 🙌
hi Akos, data loss is mitigated by first writing the record to WAL file and then to the memtable.
Even if the server restarts abruptly, LSM tree memtable can recover the records unwritten to SStable from WAL file.
Oh so they are written into a file for the first time as well! Thanks!
yes, since its written in append only mode in WAL, its generally faster
I finally had the time to read your article, Saurabh. I loved it. A simple explanation of a not easy topic 👏
Thank you Fernando!
Superb explanation, @saurabh!
Thank you Raul!