Documents
standalone-compactor
standalone-compactor
Type
External
Status
Published
Created
Mar 11, 2026
Updated
Mar 11, 2026
Source
View

import { Code } from '@astrojs/starlight/components';
import dbWithoutCompactor from '/../examples/src/db_without_compactor.rs?raw';
import standaloneCompactor from '/../examples/src/standalone_compactor.rs?raw';

By default, SlateDB starts a background compactor inside each Db instance.
If you want to run compaction as a separate service (for example, on dedicated compute), you can:

  1. Open the Db with compaction disabled.
  2. Start a standalone compactor in a separate process.

Both processes must use the same ObjectStore and database path (the path is the prefix inside your object store).

Create a Db with no compactor#

To prevent Db from starting the embedded compactor, set Settings::compactor_options to None and use Db::builder:

Run a compactor without a Db#

You can run the standalone compactor using the SlateDB CLI:

slatedb --env-file .env --path <db-path> run-compactor

The compactor runs until interrupted (Ctrl-C), then shuts down gracefully.

Alternatively, you can embed the compactor in your own process using CompactorBuilder and call run:

standalone-compactor | Dosu