What is Remote Storage?
Remote storage in DVC is where you store the actual data files, models, and artifacts tracked by DVC - separate from Git. While Git repositories contain.dvc files (metadata pointers), remote storage holds the real data. This enables teams to share large files without bloating Git repos.
Key Concept: Remote storage acts like a centralized cache. Team members push/pull data to/from remotes, similar to how Git push/pull works for code.
Why Remote Storage Matters
- Collaboration: Share datasets and models with your team
- Backup: Protect against data loss with cloud storage
- Storage efficiency: Only download data you need
- Version consistency: Ensure everyone uses the same data versions
- Scale: Store terabytes of data without Git performance issues
How Remote Storage Works
The remote storage system is implemented indvc/data_cloud.py. When you run commands like dvc push or dvc pull, DVC transfers data between your local cache and remote storage.
Architecture Overview
Supported Storage Types
DVC supports many storage backends:Amazon S3
AWS S3 buckets
Google Cloud
GCS buckets
Azure Blob
Azure storage
SSH/SFTP
Remote servers
HDFS
Hadoop filesystem
HTTP/HTTPS
Web servers
Local/NFS
Local or network drives
WebDAV
WebDAV servers
OSS
Alibaba Cloud OSS
Setting Up a Remote
Add a remote storage location:-d flag sets it as the default remote.
Remote configurations are stored in
.dvc/config (project) or .dvc/config.local (user-specific).The DataCloud Class
Remote operations are managed by theDataCloud class in dvc/data_cloud.py:67-125:
Remote Class
Each remote is represented by aRemote object from dvc/data_cloud.py:21-50:
Pushing Data
Upload tracked files to remote storage:dvc/data_cloud.py:168-198:
Pulling Data
Download tracked files from remote storage:- Are missing from your local cache
- Have checksums different from what’s in cache
- Are required by your current
.dvcfiles
Checking Status
See what would be pushed/pulled:- Files that would be pushed
- Files that would be pulled
- Files not in cache
Remote Configuration
Configure remote settings in.dvc/config:
Authentication
AWS S3
Google Cloud Storage
Azure Blob Storage
SSH
Advanced Features
Version-Aware Remotes
For cloud storage with versioning (S3, GCS, Azure):- Tracking specific object versions
- Time travel to previous data states
- Protection against accidental overwrites
Worktree Remotes
Store data alongside another DVC repository:Read-Only Remotes
Prevent accidental pushes:Custom Storage Paths
Organize remote storage:Transfer Optimization
Parallel Jobs
Partial Downloads
Only download what you need:Retry Configuration
Hash Algorithm Handling
DVC handles different hash algorithms for different storage types. Fromdvc/data_cloud.py:52-64:
- Local: Uses md5 or md5-dos2unix
- S3/GCS: Can use etag for efficiency
- HDFS: Uses native checksum
Data Transfer Flow
When you rundvc push, the data flow is:
- Collect objects: Gather all tracked files needing upload
- Check remote: Query which files already exist remotely
- Transfer: Upload missing files using storage backend
- Verify: Confirm successful uploads
dvc/data_cloud.py:157-166:
Multiple Remotes
You can configure multiple remotes for different purposes:Storage Costs and Optimization
Deduplication
DVC’s content-addressable storage means identical files are stored once, even across projects
Compression
Some storage backends support transparent compression (configure per-remote)
Lifecycle Policies
Use cloud provider features to archive or delete old data automatically
Regional Storage
Store data in regions close to compute for faster access
Troubleshooting
Connection Issues
Permission Errors
Large File Performance
Related Commands
dvc remote- Manage remote storage configurationsdvc push- Upload data to remote storagedvc pull- Download data from remote storagedvc fetch- Download to cache without checking outdvc status- Check data status vs remote
Next Steps
Data Versioning
Understand how data is tracked and versioned locally
Experiments
Share experiment results via remote storage