Data Tiers
Data Tiers
How data is organized using @tier1, @tier2, and @tier3. Every service uses the same data organization patterns for consistent backup strategies and storage management.
How Tiers Work
The tier system uses symbolic links so services can use consistent @tier1, @tier2, and @tier3 paths while the actual storage can be anywhere you want.
Tier Classification
| Tier | Purpose | Backup | Examples |
|---|---|---|---|
| @tier1 | Configuration & Secrets | Yes (encrypted) | Config files, API keys, certificates |
| @tier2 | Persistent Application Data | Yes | Databases, user content, application state |
| @tier3 | Cache & Temporary Data | No | Logs, cache, temporary files, media transcodes |
Directory Structure
Project Level
project/
├── @tier1 -> /path/to/tier1/storage/project/
├── @tier2 -> /path/to/tier2/storage/project/
├── @tier3 -> /path/to/tier3/storage/project/
└── .env -> @tier1/.envHost Level
node/.host/
├── @tier1 -> /path/to/tier1/storage/
├── @tier2 -> /path/to/tier2/storage/
└── @tier3 -> /path/to/tier3/storage/What Goes Where
@tier1 - Config and Secrets
Small, critical stuff that rarely changes:
| |
Storage needs:
- Fast, reliable storage (SSD recommended)
- Encrypted if possible
- Multiple backup copies
- Version control friendly
@tier2 - User Data and Databases
Important stuff that changes regularly:
| |
Storage needs:
- Good performance for databases
- Regular automated backups
- RAID or redundancy recommended
- Sized for data growth
@tier3 - Cache and Temp Files
Stuff you can recreate if lost:
| |
Storage needs:
- Large capacity
- Fast for better performance
- Can use cheaper storage
- Automated cleanup helpful
Shared Data
Services can share data through the shared directory:
@tier3/shared/
├── project1/
│ ├── service1/downloads/
│ └── service2/media/
└── project2/
└── service1/files/Example - Media Pipeline:
| |
Setup and Management
Initial Setup
| |
This creates:
- All necessary directories
- Symbolic links for each project
- Host-level tier links
- Shared directory structure
Backup Automation
| |
What gets backed up:
- @tier1: Critical configs (rclone with encryption)
- @tier2: User data (rclone with verification)
- @tier3: Usually not backed up (too large, recreatable)
Docker Integration
| |
Storage Examples
Development Setup
| |
Production Setup
| |
Home Server Setup
| |
Recovery Procedures
@tier1 Recovery (Critical)
- Restore from latest backup
- Verify file permissions
- Test service startup
- Check certificate dates
@tier2 Recovery (Data)
- Restore from daily backup
- Run database integrity checks
- Verify application data
- Test user access
@tier3 Recovery (Cache)
- Clear cache directories
- Let services rebuild cache
- Monitor performance
- Optionally restore from backup for speed
Best Practices
Choosing Tiers
Put in @tier1:
- Configuration files
- SSL certificates
- Database schemas
- API keys and passwords
- Service discovery configs
Put in @tier2:
- User uploads
- Database data files
- Application state
- User settings
- Important business data
Put in @tier3:
- Application logs
- Transcoded media
- Search indexes
- Temporary processing files
- Downloaded content
Security
- @tier1: Encrypt, restrict access, version control
- @tier2: Regular backups, access controls, integrity checks
- @tier3: Cleanup policies, capacity monitoring
This tier system keeps your data organized and makes backup/recovery straightforward across all nodes.
Last updated on