weed/filer/foundationdb/README.md
This package provides a FoundationDB-based filer store for SeaweedFS, offering ACID transactions and horizontal scalability.
foundationdb build tag when compilinggo build -tags foundationdb -o weed
Add the following to your filer.toml:
[foundationdb]
enabled = true
cluster_file = "/etc/foundationdb/fdb.cluster"
api_version = 740
timeout = "5s"
max_retry_delay = "1s"
directory_prefix = "seaweedfs"
| Option | Description | Default | Required |
|---|---|---|---|
enabled | Enable FoundationDB filer store | false | Yes |
cluster_file | Path to FDB cluster file | /etc/foundationdb/fdb.cluster | Yes |
api_version | FoundationDB API version | 740 | No |
timeout | Operation timeout duration | 5s | No |
max_retry_delay | Maximum retry delay | 1s | No |
directory_prefix | Directory prefix for organization | seaweedfs | No |
batch_enabled | Enable write batching (see Performance section) | false | No |
batch_size | Max operations per batch | 100 | No |
batch_interval | Max time before batch flush | 1ms | No |
For path-specific filer stores:
[foundationdb.backup]
enabled = true
cluster_file = "/etc/foundationdb/fdb.cluster"
directory_prefix = "seaweedfs_backup"
location = "/backup"
Configure via environment variables:
export WEED_FOUNDATIONDB_ENABLED=true
export WEED_FOUNDATIONDB_CLUSTER_FILE=/etc/foundationdb/fdb.cluster
export WEED_FOUNDATIONDB_API_VERSION=740
export WEED_FOUNDATIONDB_TIMEOUT=5s
export WEED_FOUNDATIONDB_MAX_RETRY_DELAY=1s
export WEED_FOUNDATIONDB_DIRECTORY_PREFIX=seaweedfs
# Start FoundationDB server
foundationdb start
# Initialize database
fdbcli --exec 'configure new single ssd'
/etc/foundationdb/fdb.cluster)fdbcli --exec 'configure new double ssd'
Use the provided docker-compose.yml in test/foundationdb/:
cd test/foundationdb
make setup
By default, write batching is disabled (batch_enabled = false). Each write commits
immediately in its own transaction. This provides optimal latency for S3 PUT operations.
When to enable batching:
Batching configuration options:
[foundationdb]
# Enable write batching (disabled by default for optimal S3 latency)
batch_enabled = true
# Maximum operations per batch
batch_size = 100
# Maximum time to wait before flushing a batch
batch_interval = "1ms"
Performance comparison:
Monitor FoundationDB cluster status:
fdbcli --exec 'status'
fdbcli --exec 'status details'
FoundationDB automatically handles:
cd weed/filer/foundationdb
go test -tags foundationdb -v
cd test/foundationdb
make test
cd test/foundationdb
make test-e2e
Connection Failures:
Transaction Conflicts:
Performance Issues:
Enable verbose logging:
weed -v=2 server -filer
Check FoundationDB status:
fdbcli --exec 'status details'
For issues specific to the FoundationDB filer store:
For FoundationDB-specific issues, consult the FoundationDB documentation.