APEX: A High-Performance Learned Index on Persistent Memory
Baotong Lu1, Jialin Ding2, Eric Lo1, Umar Faroop Minhas3, Tianzheng Wang4
1 The Chinese University of Hong Kong �2 MIT�3 Microsoft Research�4 Simon Fraser University
Traditional B+-Trees vs. Learned Indexes
APEX: A High-Performance Learned Index on Persistent Memory
2
B. Lu, J. Ding, E. Lo, U. Minhas, T. Wang
| B+-trees | Learned Indexes |
Performance | | |
Architecture | | |
1. No persistence
2. Restricted by DRAM capacity
O(logn), n = #items
In-memory or disk-based
In-memory
Source: wikipedia.org
Source: Kraska et al, SIGMOD 2018
Persistent Memory Primer
Persistent Memory (PM)
Intel Optane DCPMM
APEX: A High-Performance Learned Index on Persistent Memory
3
B. Lu, J. Ding, E. Lo, U. Minhas, T. Wang
How to build an efficient learned Index on PM?
Instant Recovery!
Challenge 1: Scalability
Start with ALEX [1]
APEX: A High-Performance Learned Index on Persistent Memory
4
B. Lu, J. Ding, E. Lo, U. Minhas, T. Wang
| ALEX | B+-Tree | PM B+-Tree |
Node design | Up to 16MB, sort | 512B, sort | 512B, unsort |
1. PM writes | | | |
| | | |
| | | |
Three aspects inhibit the scalability on PM!
O(m), m = #KVs in one data node
O(m)
O(1)
2. Concurrency
Not Yet
Optimistic CC
Optimistic CC
3. SMO Cost
Large
Small
Small
[1] ALEX: An Updatable Adaptive Learned Index SIGMOD’20
Challenge 2: Crash Consistency & Instant Recovery
APEX: A High-Performance Learned Index on Persistent Memory
5
B. Lu, J. Ding, E. Lo, U. Minhas, T. Wang
Old crash consistency tricks on PM do not work on learned Index
impose high overhead
Instant recovery vs. higher throughput with DRAM
leaf nodes in PM
Design Principles
P1 Avoid excessive PM reads and writes
P2 Model-based operations
P3 Lightweight SMOs
P4 Judicious use of DRAM
P5 Crash consistency
APEX: A High-Performance Learned Index on Persistent Memory
6
B. Lu, J. Ding, E. Lo, U. Minhas, T. Wang
ALEX
APEX = Fast + Scalable + Instantly-Recoverable
Overall structure of ALEX
Data Node Design: PM-Aware Optimizations
Insights
APEX: A High-Performance Learned Index on Persistent Memory
7
B. Lu, J. Ding, E. Lo, U. Minhas, T. Wang
ALEX data node
APEX data node
VS.
1
2
3
4
6
7
9
1
2
3
4
5
6
7
9
y = model (key)
1
2
3
6
5
7
9
4
Primary array:
Stash array:
[1] Patience is a Virtue: Revisiting Merge and Sort on Modern Processors SIGMOD’14
Data Node Design: Data-Aware Optimizations
Primary array (PA) size vs. stash array (SA) size?
Distribution-aware (DA) approach
APEX: A High-Performance Learned Index on Persistent Memory
8
B. Lu, J. Ding, E. Lo, U. Minhas, T. Wang
Search (Longlat)
Insert (Longlat)
Low-overhead Data Consistency
Insight: reduce the amount of data to be persistent as much as possible
APEX: A High-Performance Learned Index on Persistent Memory
9
B. Lu, J. Ding, E. Lo, U. Minhas, T. Wang
Non-critical data => DRAM-resident
Critical data => PM-resident
Instant Recovery and Scalable Concurrency
Employ lazy recovery [1] to support instant recovery
Scalable concurrency protocol
APEX: A High-Performance Learned Index on Persistent Memory
10
B. Lu, J. Ding, E. Lo, U. Minhas, T. Wang
[1] Dash: Scalable Hashing on Persistent Memory VLDB’20
Experimental Setup
Setting: 24-core CPU, 128GB X 6 Optane DCPMM (on all six channels)
Competitors
Datasets
APEX: A High-Performance Learned Index on Persistent Memory
11
B. Lu, J. Ding, E. Lo, U. Minhas, T. Wang
PM-only
PM-DRAM
Evaluation: Insert
APEX: A High-Performance Learned Index on Persistent Memory
12
B. Lu, J. Ding, E. Lo, U. Minhas, T. Wang
Evaluation: Search
APEX: A High-Performance Learned Index on Persistent Memory
13
B. Lu, J. Ding, E. Lo, U. Minhas, T. Wang
Conclusions
APEX: A High-Performance Learned Index on Persistent Memory
14
B. Lu, J. Ding, E. Lo, U. Minhas, T. Wang
Open source at: https://github.com/baotonglu/apex
Thank you!