DiStash is a disaggregated transactional key-value store for data across pools of different storage medium such as Dynamic Random Access Memory (DRAM), Solid State Disk (SSD), Hard Disk Drive (HDD), or Non-Volatile Memory (NVM). An application may configure a storage pool as either durable or ephemeral (transient cache). DiStash simplifies the application logic by preventing undesirable race conditions that may cause copies of data across different pools of storage to diverge.
DiStash is built using FoundationDB. To learn more about FoundationDB, visit foundationdb.org
Authors: Yiming Gao (gaoyimin@usc.edu), Hieu Nguyen (hieunguyen@ebay.com), Jun Li (junli5@ebay.com), and Shahram Ghandeharizadeh (shahram@usc.edu)
DiStash is a research prototype that supports:
- Pools of stashes. A stash is a storage medium such as Dynamic Random Access Memory (DRAM), Solid State Disk (SSD), Hard Disk Drive (HDD), or Non-Volatile Memory (NVM).
- A single transaction to read and write different copies of one or more key-value pair across the different pools of stashes.
- Pools of stashes as either ephemeral (cache) or durable storage. In ephemeral mode, once the storage capacity of a stash is exhausted, DiStash uses LRU to evict data.
- DiStash may be used to implement cache augmented data stores, front-end load balancing, and hierarchical storage structures.
A build of DiStash requires at least these dependencies:
- Install cmake Version 3.13 or higher CMake, on a MacBook Pro:
brew install cmake - Install Mono, on a MacBook Pro: download pkg file and install
- Install Ninja (optional, but recommended), on a MacBook Pro:
brew install ninja
We also recomment installing:
- openssl, on a MacBook Pro:
brew install openssl - lz4, on a Macbook Pro:
brew install lz4 - sphinx-doc, on a Macbook Pro:
brew install sphinx-doc - jinja2-cli, on a Macbook Pro:
brew install jinja2-cli pip install jinja2
If compiling for local development, please set -DUSE_WERROR=ON in
cmake. Our CI compiles with -Werror on, so this way you'll find out about
compiler warnings that break the build earlier.
Once you have your dependencies, you can run cmake and then build:
- Check out this repository.
- Create a build directory (you can have the build directory anywhere you like).
cd <PATH_TO_BUILD_DIRECTORY>cmake -G Ninja <PATH_TO_FOUNDATIONDB_DIRECTORY>ninja # If this crashes it probably ran out of memory. Try ninja -j1
The language bindings that are supported by cmake will have a corresponding
README.md file in the corresponding bindings/lang directory.
Generally, cmake will build all language bindings for which it can find all necessary dependencies. After each successful cmake run, cmake will tell you which language bindings it is going to build.
CMake can build a compilation database for you. However, the default generated
one is not too useful as it operates on the generated files. When running make,
the build system will create another compile_commands.json file in the source
directory. This can than be used for tools like
CCLS,
CQuery, etc. This way you can get
code-completion and code navigation in flow. It is not yet perfect (it will show
a few errors) but we are constantly working on improving the development experience.
CMake will not produce a compile_commands.json, you must pass
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON. This also enables the target
processed_compile_commands, which rewrites compile_commands.json to
describe the actor compiler source file, not the post-processed output files,
and places the output file in the source directory. This file should then be
picked up automatically by any tooling.
Note that if building inside of the foundationdb/build docker
image, the resulting paths will still be incorrect and require manual fixing.
One will wish to re-run cmake with -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF to
prevent it from reverting the manual changes.
CMake has built in support for a number of popular IDEs. However, because flow files are precompiled with the actor compiler, an IDE will not be very useful as a user will only be presented with the generated code - which is not what she wants to edit and get IDE features for.
The good news is, that it is possible to generate project files for editing
flow with a supported IDE. There is a CMake option called OPEN_FOR_IDE which
will generate a project which can be opened in an IDE for editing. You won't be
able to build this project, but you will be able to edit the files and get most
edit and navigation features your IDE supports.
For example, if you want to use XCode to make changes to FoundationDB you can create a XCode-project with the following command:
cmake -G Xcode -DOPEN_FOR_IDE=ON <FDB_SOURCE_DIRECTORY>You should create a second build-directory which you will use for building and debugging.
-
Check out this repo on your server.
-
Install compile-time dependencies from ports.
-
(Optional) Use tmpfs & ccache for significantly faster repeat builds
-
(Optional) Install a JDK for Java Bindings. FoundationDB currently builds with Java 8.
-
Navigate to the directory where you checked out the foundationdb repo.
-
Build from source.
sudo pkg install -r FreeBSD \ shells/bash devel/cmake devel/ninja devel/ccache \ lang/mono lang/python3 \ devel/boost-libs devel/libeio \ security/openssl mkdir .build && cd .build cmake -G Ninja \ -DUSE_CCACHE=on \ -DUSE_DTRACE=off \ .. ninja -j 10 # run fast tests ctest -L fast # run all tests ctest --output-on-failure -v
Create an instance with the latest versin of Ubuntu (24 as of May 8, 2024). Bring it up to date:
sudo apt update
Install cmake on it.
sudo apt install cmake
Follow the FDB installation guide and verify the version of cmake is 3.13 or higher.
Proceed to install the other required libraries and packages. Install Ninja:
sudo apt-get install ninja-build
Install jemalloc:
sudo apt install libjemalloc-dev
Install ssl:
sudo apt install libssl-dev
Install compression technique lz4:
sudo apt install liblz4-dev
Install compression technique python sphinx:
sudo apt install python3-sphinx
Install mono by following instructions at :
https://www.mono-project.com/download/stable/#dwonload-lin
Create the build directory, change into that directory and run:
cmake -G Ninja ../foundationdb_cache
Now, build FDB:
ninja
See https://github.com/eBay-USC/fdb_deploy/tree/fdb_cache2 and follow its instructions.
There are no special requirements for Linux. A docker image can be pulled from
foundationdb/build that has all of FoundationDB's dependencies
pre-installed, and is what the CI uses to build and test PRs.
cmake -G Ninja <FDB_SOURCE_DIR>
ninja
cpack -G DEB
For RPM simply replace DEB with RPM.
The build under MacOS will work the same way as on Linux. To get boost and ninja you can use Homebrew:
brew install llvm
brew install lldVerify that the following paths are set:
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include" To generate a installable package,first compile:
cmake -G Ninja \
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang \
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ \
-DCMAKE_AR=/opt/homebrew/opt/llvm/bin/llvm-ar \
-DCMAKE_RANLIB=/opt/homebrew/opt/llvm/bin/llvm-ranlib \
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=/opt/homebrew/bin/ld64.lld" \
-DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=/opt/homebrew/bin/ld64.lld" \
<PATH_TO_FOUNDATIONDB_SOURCE>From the build directory, compile using the following command:
ninjaFrom the build directory, generate the package:
$SRCDIR/packaging/osx/buildpkg.sh . $SRCDIRPrior to installing the newly compiled package, remove an existing FDB installation:
sudo /usr/local/foundationdb/uninstall-FoundationDB.shRemove its data and configuration files:
sudo rm -rf /usr/local/foundationdb /usr/local/etc/foundationdbUse the finder to browse the directory that contains the newly generated package:
cd build/packagesDouble click the FoundationDB package to install.
Y. Gao, H. Nguyen, J. Li, and S. Ghandeharizadeh. DiStash: A Disaggregated Multi-Stash Transactional Key-Value Store. In the Seventeenth TPC Technology Conference on Performance Evaluation & Benchmarking, co-located with VLDB 2025, London, UK, September 1, 2025.
BibTex:
@inproceedings{distash2025,
author = {Gao, Yiming and Nguyen, Hieu and Li, Jun and Ghandeharizadeh, Shahram},
title = {DiStash: A Disaggregated Multi-Stash Transactional Key-Value Store},
year = {2025},
abstract = {A stash is a storage medium such as Dynamic Random Access Memory (DRAM), Solid State Disk (SSD), Hard Disk Drive (HDD), or Non-Volatile Memory (NVM). This paper presents a disaggregated transactional key-value (KV) store, DiStash, that governs KVs cross pools of stash types. It enables an application to use a single transaction to read and write different copies of one or more key-value pair across the different pools of stashes. It simplifies the application logic by (a) preventing undesirable race conditions that may cause copies of data across different stash pools to reflect different values and/or (b) failures that may result in loss of key-value pairs. A configuration of DiStash may use a pool of stashes as either ephemeral or durable storage. The application dictates whether the content of its participating stashes are inclusive (replicated) or exclusive (tiered). We implement a DiStash by extending FoundationDB. We quantify the tradeoffs with its design decisions using microbenchmarks and eBay’s production workload.},
booktitle = {Proceedings of the Seventeenth TPC Technology Conference on Performance Evaluation \& Benchmarking},
location = {London, England},
series = {TPCTC '25}
}