[Paper Review] Bigtable Merge Compaction
This paper introduces formal tools for designing and analyzing online compaction policies in Bigtable's LSM-based storage system, proposing new algorithms that achieve near-optimal performance through competitive analysis. It presents theoretically sound, empirically validated policies that significantly reduce compaction and read costs compared to existing heuristics, especially under realistic workloads with i.i.d. file lengths and read rates.
NoSQL databases are widely used for massive data storage and real-time web applications. Yet important aspects of these data structures are not well understood. For example, NoSQL databases write most of their data to a collection of files on disk, meanwhile periodically compacting subsets of these files. A compaction policy must choose which files to compact, and when to compact them, without knowing the future workload. Although these choices can affect computational efficiency by orders of magnitude, existing literature lacks tools for designing and analyzing online compaction policies --- policies are now chosen largely by trial and error. Here we introduce tools for the design and analysis of compaction policies for Google Bigtable, propose new policies, give average-case and worst-case competitive analyses, and present preliminary empirical benchmarks.
Motivation & Objective
- To address the lack of formal tools for designing and analyzing online compaction policies in NoSQL databases like Bigtable.
- To reduce the computational overhead of compaction and read operations, which are major performance bottlenecks in LSM-based systems.
- To develop policies that perform well under uncertainty (unknown future workloads) using competitive analysis.
- To provide theoretical bounds on optimal and online policy costs, enabling performance estimation and comparison.
- To empirically validate new policies against existing heuristics like Google's default and BRB, showing significant cost reductions.
Proposed method
- Models the Bigtable merge compaction (BMC) problem as an online stack-based optimization where file lengths are pushed and merged in contiguous sequences to minimize total cost.
- Introduces a read-cost function f(k) that depends on stack size k, capturing the cost of reading keys across multiple levels.
- Proposes two new online algorithms: one for bounded merge size (BMC≤K) and one for linear read cost (linear BMC), both using adaptive merging based on estimated average file length and read rate.
- Applies worst-case and average-case competitive analysis to prove that the new algorithms achieve cost within a (1+o(1)) factor of optimal offline cost.
- Uses phase-based merging and statistical estimation to maintain (1±ε)-accurate estimates of average file length and read rate over time.
- Employs a two-phase strategy: initial phase with aggressive merging to reduce stack size, followed by phase-wise merging using estimated optimal schedules.
Experimental results
Research questions
- RQ1Can we design online compaction policies for Bigtable that are provably close to optimal, even without knowledge of future workloads?
- RQ2How do theoretical competitive ratios of online policies compare to empirical performance on realistic, i.i.d. workloads?
- RQ3Can adaptive estimation of average file length and read rate lead to near-optimal performance in practice?
- RQ4How do the proposed policies compare to existing heuristics like Google’s default and BRB in terms of total cost and scalability?
- RQ5What is the impact of file length and read rate distributions on the performance of different compaction strategies?
Key findings
- The proposed online algorithm for BMC≤K achieves expected cost within (1+o(1)) of the optimal offline cost, with total cost O(ℓ[1,n] + r[1,n]) for initial phases.
- For linear BMC, the algorithm from Theorem 4 asymptotically matches the optimal cost β log n per time step, where β satisfies 1/2^(ℓ̄/β) + 1/2^(r̄/β) = 1.
- Empirical benchmarks show that the BRB algorithm significantly outperforms Google’s default policy, especially for large n ≥ K·3^K, with cost reductions approaching optimal levels.
- Even for small n, BRB performs close to optimal and substantially better than default, particularly when file lengths follow a log-normal distribution and read rates are i.i.d. exponential.
- The algorithm from Theorem 3 performs well when ℓ̄/r̄ is small but degrades when this ratio is large, indicating sensitivity to workload imbalance.
- Overall, the proposed policies achieve near-optimal performance in practice, with expected cost within a (1+o(1)) factor of optimal, validating the theoretical competitive analysis.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.