ReadBackend and WriteBackend traits, allowing you to choose the storage solution that best fits your needs.
SupportedBackend Enum
local:or no prefix → Localrclone:→ Rclonerest:→ RESTopendal:→ OpenDAL
Local Backend
Stores repository data on the local filesystem or network-mounted storage.Features
- Direct filesystem access
- Fastest performance for local storage
- Post-create and post-delete command hooks
- Automatic directory structure creation
- Supports all major filesystems
Repository Format
Configuration Options
post-create-command- Command to run after creating a filepost-delete-command- Command to run after deleting a file
%file- Full file path%type- File type directory name (e.g., “snapshots”, “data”)%id- Hexadecimal file ID
Directory Structure
Usage Examples
REST Backend
Connects to a REST server compatible with the restic REST protocol.Features
- HTTP/HTTPS transport
- Retry logic with exponential backoff
- Custom CA certificates and client certificates
- Configurable timeouts
- Password authentication via URL
- Range request support for partial reads
Repository Format
Configuration Options
retry- Retry attempts ("false","off","default"[5], or a number)timeout- Request timeout (e.g.,"10m","30s","600"for seconds)cacert- Path to CA certificate file for verifying servertls-client-cert- Path to client certificate for mutual TLS
REST Server Compatibility
The backend is compatible with:- restic REST server
- rustic-server
- Any server implementing the restic REST protocol
Usage Examples
Rclone Backend
Uses rclone to access any of the 70+ cloud storage providers that rclone supports.Features
- Access to 70+ cloud providers via rclone
- Automatic rclone process management
- Secure authentication with random credentials
- Automatic REST server detection
- Version checking for security
- Passes through all REST backend options
Repository Format
Requirements
- rclone >= 1.52.2 installed and in PATH
- Configured rclone remote
Configuration Options
rclone-command- Custom rclone command (default:"rclone serve restic --addr localhost:0")use-password- Enable authentication (default:true, requires rclone >= 1.52.2)rest-url- Explicit REST URL to use (skips auto-detection)- Plus all REST backend options
How It Works
- Spawns an rclone process serving the restic REST protocol
- Automatically detects the REST server URL from rclone output
- Generates random username/password for authentication
- Creates a REST backend connected to the rclone server
- Cleans up rclone process on drop
Usage Examples
OpenDAL Backend
Uses Apache OpenDAL for access to multiple cloud storage providers.Features
- Support for 40+ storage services
- Native implementation (no external processes)
- Retry logic with jitter
- Connection pooling
- Bandwidth throttling
- Concurrent request limiting
- Parallel directory creation for initialization
Repository Format
opendal: determines the storage service. Provider-specific options are passed in the options map.
Configuration Options
retry- Retry attempts ("false","off","default"[5], or a number)connections- Maximum concurrent connectionsthrottle- Bandwidth limit (format:"<bandwidth>,<burst>", e.g.,"10MB,50MB")
- Uses byte size units:
kB,MB,GB,kiB,MiB,GiB - Format:
"bandwidth,burst" - Example:
"10MB,50MB"= 10MB/s bandwidth, 50MB burst
Supported Services
Amazon S3
Google Cloud Storage
Azure Blob Storage
Local Filesystem (via OpenDAL)
Other Supported Services
- Object Storage: MinIO, Wasabi, DigitalOcean Spaces, Cloudflare R2
- Cloud Providers: Alibaba Cloud OSS, Tencent Cloud COS, Huawei Cloud OBS
- Specialized: WebDAV, HTTP, IPFS, Redis, Etcd, and many more
Usage Examples
Feature Flags
Backend support is controlled by cargo features:opendal, rclone, rest
opendal- Enables OpenDAL backendrclone- Enables Rclone backendrest- Enables REST backend
Choosing a Backend
Local
Best for: Local backups, NAS, network-mounted storage Pros:- Fastest performance
- Simplest setup
- No external dependencies
- Command hooks for integration
- Limited to accessible filesystems
- No built-in cloud support
REST
Best for: Self-hosted REST servers, custom server implementations Pros:- Simple HTTP protocol
- Works with existing REST servers
- Good for self-hosted solutions
- TLS support
- Requires running a server
- Network latency
Rclone
Best for: Quick cloud access, many providers, existing rclone configs Pros:- 70+ cloud providers
- Reuses rclone configuration
- Mature and well-tested
- Easy cloud migration
- External rclone dependency
- Extra process overhead
- Slightly slower than native implementations
OpenDAL
Best for: Production cloud deployments, performance-critical applications Pros:- Native implementation
- Better performance than rclone
- Advanced features (throttling, connection pooling)
- No external processes
- Fewer providers than rclone
- Provider-specific configuration
- More complex setup
Related Documentation
- Backend Traits - Core backend interface
- Backend Options - Configuration structure
- Repository - Using backends with repositories