ToplingDB Integration#
ToplingDB is an optional, RocksDB-compatible storage engine that can replace the standard RocksDB JNI backend across HugeGraph Server, PD (Placement Driver), and Store. It offers YAML-driven dynamic configuration, a built-in HTTP monitoring UI, and higher write throughput via a plugin-based architecture . The integration is opt-in: standard RocksDB remains the default, and no HugeGraph public APIs change .
Provider Selection#
ToplingDB is activated by setting rocksdb.provider=topling in the component's properties or YAML configuration. Without this setting the standard RocksDB path is taken unchanged .
- HugeGraph Server โ
hugegraph.properties - PD โ
application.yml;rocksdb.providerdefaults to"standard"inPDConfig.java - Store โ
application-pd.yml
At startup, preload-topling.sh (sourced by start-hugegraph.sh and init-store.sh) reads the configured provider, swaps the standard rocksdbjni-*.jar for the ToplingDB JAR placed in lib/topling/, extracts native .so files, and configures LD_PRELOAD, LD_LIBRARY_PATH, and TOPLINGDB_EASY_MIGRATE_CONF before the JVM starts . The swap logic is not idempotent โ a second restart with topling mode overwrites the backup of the standard JAR, making manual reinstallation necessary to recover standard mode . Platform support is currently limited to Linux x86_64 .
The ToplingDB JNI JAR (rocksdbjni-8.10.2-*) is sourced from the GitHub Packages Maven repository configured in .github/configs/settings.xml, using GITHUB_ACTOR/GITHUB_TOKEN credentials . An open concern in PR #179 is that a pre-built binary JAR was also committed directly under lib/topling/, which conflicts with Apache IP/release policy.
Easy Migrate YAML Configuration and Truncate Semantics#
ToplingDB uses its Easy Migrate mechanism to manage RocksDB options via component-specific YAML files instead of hard-coded Java calls. Each component sets TOPLINGDB_EASY_MIGRATE_CONF to its own YAML before startup :
| Component | Config file | HTTP port |
|---|---|---|
| Server | conf/toplingdb.yaml | 2011 |
| PD | conf/rocksdb_pd.yaml | 2012 |
| Store | conf/rocksdb_store.yaml | 2013 |
Ports must be unique to avoid conflicts in co-located deployments .
Truncate / Column-Family Semantics#
The key behavioural difference from standard RocksDB lies in how column families are created. HugeGraph's standard path sets create_missing_column_families: false for the default DB options โ this must remain false for HugeGraph compatibility. However, JRaft (used by PD and Store for Raft consensus) requires a log column family that must be created on first open. The fix, landed in PR #172, adds a separate DBOptions.log block with create_missing_column_families: true to all three YAML files :
# DBOptions.log โ for JRaft
log:
create_if_missing: true
create_missing_column_families: true
# DBOptions.default โ must stay false for HugeGraph
default:
create_if_missing: true
create_missing_column_families: false
In the PD store, HgKVStoreImpl.java had a trailing slash in the dbPath (/rocksdb/ โ /rocksdb) which prevented ToplingDB's path-based YAML key matching from working correctly; fixed in PR #172 .
RocksDB Version Unification#
PR #179 also unifies the RocksDB JNI version to 8.10.2 across all modules via rocksdb.version in the root pom.xml. Previously PD used 6.29.5 and Store used 7.7.3. The RocksDBMetricsConst.java in Store removes TickerType/HistogramType enum constants that no longer exist in the 8.x API .
PR Rollout Sequence#
| PR | Status | Scope |
|---|---|---|
#15 โ feat(server): add support for toplingdb | Closed (superseded) | Initial Server-only prototype: JAR swap, LD_PRELOAD, YAML option_path |
#130 โ feat(rocksdb): support ToplingDB provider | Closed (superseded) | Added rocksdb.provider default in PDConfig; script hardening |
#172 โ fix(toplingdb): align Easy Migrate runtime | Merged 2026-07-29 | Per-component YAML ports; JRaft CF fix; PD path fix; SHA-256 verification |
#204 โ fix(toplingdb): align distributed runtime and CI | Merged 2026-08-26 | PD/Store JAR loading in startup scripts; Ubuntu 24.04 CI; LD_PRELOAD isolation; smoke-test iteration validation |
#179 โ feat(rocksdb): add optional ToplingDB integration | Open | Comprehensive rollup: docs suite, Docker targets, cluster-test Gremlin ports, RocksDB 8.10.2 unification |
Key Files Quick Reference#
| Path | Purpose |
|---|---|
hugegraph-server/hugegraph-dist/src/assembly/static/bin/preload-topling.sh | Provider detection, JAR swap, env setup |
hugegraph-server/hugegraph-dist/src/assembly/static/bin/common-topling.sh | libaio symlink, jemalloc, .so extraction helpers |
hugegraph-server/hugegraph-dist/src/assembly/static/conf/toplingdb.yaml | Server Easy Migrate config (port 2011) |
hugegraph-pd/hg-pd-dist/src/assembly/static/conf/rocksdb_pd.yaml | PD Easy Migrate config (port 2012) |
hugegraph-store/hg-store-dist/src/assembly/static/conf/rocksdb_store.yaml | Store Easy Migrate config (port 2013) |
hugegraph-pd/hg-pd-core/src/main/java/โฆ/pd/store/HgKVStoreImpl.java | PD RocksDB KV store โ dbPath |
hugegraph-server/hugegraph-rocksdb/src/main/java/โฆ/rocksdb/RocksDBOptions.java | Server RocksDB options incl. rocksdb.provider |
docs/toplingdb/ | Integration, quickstart, operations, security, troubleshooting guides |