Configuration
Required Settings
Set to
b2The B2 bucket name (e.g.,
my-backup-bucket)Optional prefix for all objects (e.g.,
backups/)Authentication
Backblaze application key ID
Backblaze application key
Examples
- Basic Setup
- With Prefix
- CI/CD
Getting B2 Credentials
Create a Bucket
- Log in to your Backblaze account
- Navigate to “B2 Cloud Storage” → “Buckets”
- Click “Create a Bucket”
- Choose:
- Bucket name:
my-backup-bucket - Files in bucket: Private (recommended)
- Encryption: Server-Side Encryption (optional, Cloudstic encrypts client-side)
- Bucket name:
- Click “Create a Bucket”
Generate Application Keys
- Navigate to “App Keys” in the B2 dashboard
- Click “Add a New Application Key”
- Configure:
- Name:
cloudstic-backup - Allow access to: Specific bucket → select your bucket
- Type of access: Read and Write
- Name:
- Click “Create New Key”
- Save the key immediately — it’s only shown once!
Features
Streaming Uploads
The B2 store uses the Blazer library for efficient uploads:- Streaming writes: No need to buffer entire files in memory
- Automatic retries: Handles transient network errors
- Parallel uploads: Multiple chunks uploaded concurrently
Operation Timeouts
All B2 operations have a 5-minute timeout to handle network issues gracefully:Object Lifecycle
B2 supports automatic lifecycle policies:- Navigate to your bucket in the B2 dashboard
- Click “Lifecycle Settings”
- Configure:
- Keep only the last N versions
- Delete old files after X days
Cloudstic snapshots are immutable objects, so lifecycle policies can safely delete old snapshot objects after retention policies expire.
Cost Optimization
Pricing Overview (as of 2024)
- Storage: 5/TB/month)
- Downloads: $0.01/GB (first 3x storage free)
- API calls: Class B (List) $0.004/10k, Class C (Upload) free
- Example Costs
- Daily Backups
Scenario: 500 GB backupMonthly costs:
- Storage: 500 GB × 2.50**
- Downloads: First 1.5 TB free per month
- API calls: Minimal (packfiles reduce calls)
- Storage: 500 GB × 11.50
- Downloads: $0.09/GB
Reduce API Costs
Enable packfiles (default) to bundle small objects:Free Download Allowance
B2 includes 3x your storage in free downloads monthly:- 100 GB stored → 300 GB free downloads/month
- 500 GB stored → 1.5 TB free downloads/month
Performance
Upload Speed
B2 upload performance depends on:- Network bandwidth: B2 can saturate gigabit connections
- Concurrency: Cloudstic uses parallel uploads
- Packfiles: Reduce overhead for many small files
- 100 Mbps connection: ~10-12 MB/s sustained
- 1 Gbps connection: ~100-120 MB/s sustained
Download Speed
Downloads are similarly fast, with global CDN acceleration available.Troubleshooting
Authentication Errors
If you see “failed to create b2 client”:Bucket Not Found
If you see “bucket not found or accessible”:Slow Uploads
If uploads are slow:- Check network speed:
speedtest-cli - Enable packfiles: Default, but verify:
-enable-packfile=true - Increase concurrency: B2 automatically uses parallel uploads
- Consider compression: Enabled by default with zstd
Timeout Errors
If operations time out (5-minute default):Advanced Features
Signed URLs
The B2 store supports generating time-limited download URLs:Streaming Writers
For large objects, use streaming writes:Prefix Isolation
Use prefixes to isolate multiple repositories in one bucket:Comparison with S3
- Backblaze B2
- Amazon S3
Pros:
- Lower storage costs (0.023/GB)
- Free downloads (3x storage allowance)
- Simple, predictable pricing
- No multi-region complexity
- Single region per bucket
- Slightly higher latency than S3
- Fewer third-party integrations