Phase Plan: - 05-PLAN.md: Combined execution plan for efficiency - 05-RESEARCH.md: Domain research on volumes and MinIO Test Scripts (4): - 01-volumes-test.sh: Volume persistence verification - 02-minio-test.sh: MinIO S3 API testing - 03-persistence-test.sh: Database persistence verification - 99-final-verification.sh: End-to-end verification Documentation (6 files): Tutorial: Docker volumes, MinIO S3 How-to: Manage volumes Reference: Volume syntax Explanation: Storage↔S3 parallels Infrastructure: - docker-compose.yml: MinIO S3 + PostgreSQL + test container - Named volumes: minio-data, db-data, test-data (INF-04 compliant) Key concepts: - Named volumes = EBS volumes - MinIO = S3 bucket (100% API compatible) - Data persistence across container lifecycle Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.6 KiB
1.6 KiB
Explanation: Parallelismi Storage Docker ↔ AWS
Core Concepts
Docker Named Volume = EBS Volume
| Aspect | Docker | AWS EBS |
|---|---|---|
| Creation | docker volume create | aws ec2 create-volume |
| Lifecycle | Indipendent dal container | Indipendente dall'istanza |
| Persistence | Sopravvive a docker rm | Sopravvive a ec2 terminate |
| Mount | volumes: section in compose | Attach to /dev/sdX |
| Backup | docker run --rm tar | EBS snapshots |
MinIO = S3
| Aspect | MinIO | AWS S3 |
|---|---|---|
| API | 100% S3 compatible | Native S3 |
| Endpoint | http://localhost:9000 | https://s3.amazonaws.com |
| Pricing | Free (self-hosted) | Pay-per-use |
| Use case | Local dev/test | Production |
Storage Architecture Patterns
Database with Persistent Storage
Locale:
db:
image: postgres
volumes:
- db-data:/var/lib/postgresql/data
Cloud: RDS con EBS storage
Object Storage
Locale:
minio:
image: minio/minio
volumes:
- minio-data:/data
Cloud: S3 bucket
Key Differences
- Scope: Volumes = single host, EBS = AZ-wide
- Performance: Local filesystem vs network storage
- Backup: tar vs EBS snapshots
- Scaling: Manual vs S3 infinite scale
When to Use What
| Use Case | Locale | Cloud |
|---|---|---|
| Dev database | PostgreSQL + Volume | RDS |
| File storage | Volume | EFS |
| Objects | MinIO | S3 |
| Backup | tar to host | S3 Glacier |
Conclusion
Docker volumes e MinIO seguono gli stessi principi di EBS e S3, permettendoti di praticare localmente prima di deployare in cloud.