About this question

LSM Tree vs B-Tree for Time Series

Hard · Algorithms & Data Structures · Quant Trader interview question · LSM tree, B-tree, time series, database, write amplification, data structures

You are designing a database to store high-frequency market data (tick data). The database will primarily be used for writing new data points as they arrive. Reads will be less frequent but still important for backtesting and analysis. You are considering using either a B-tree or an LSM tree (Log-Structured Merge Tree) as the underlying data structure. Given the write-heavy nature of time-series data, why are LSM trees generally preferred over B-trees for this use case?