S3-compatible object storage with active-active replication
Managed: AWS S3 → Self-hosted: MinIO (for learning, open-source)
→ Hands-on Lab: Active-Active Replication on Kubernetes
MinIO supports multi-site active-active replication, allowing objects to be synchronized across multiple MinIO deployments. This feature is available in the open-source version (not enterprise-only).
┌─────────────────┐ ┌─────────────────┐
│ Site 1 │◄───────►│ Site 2 │
│ MinIO │ async │ MinIO │
│ (R/W) │ sync │ (R/W) │
└─────────────────┘ └─────────────────┘
┌─────────┐ ┌─────────┐
│ Source │──────────►│ Target │
│ (R/W) │ replicate│ (R only)│
└─────────┘ └─────────┘
┌─────────┐ ┌─────────┐
│ Site 1 │◄─────────►│ Site 2 │
│ (R/W) │ replicate │ (R/W) │
└─────────┘ └─────────┘
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Site 1 │◄───►│ Site 2 │◄───►│ Site 3 │
│ (R/W) │ │ (R/W) │ │ (R/W) │
└─────────┘ └─────────┘ └─────────┘
▲ ▲
└───────────────────────────────┘
MinIO supports arbitrary number of sites. All sites sync with each other.
mc admin replicate add site1 site2 site3| Requirement | Details |
|---|---|
| IDP | All sites must use same identity provider |
| Initial data | Only one site can have existing data |
| Latency | Dictated by slowest link |
| Feature | Supported |
|---|---|
| Object replication | Yes |
| Delete replication | Yes |
| Delete markers | Yes |
| Existing objects | Yes (with resync) |
| Metadata changes | Yes |
| Versioning required | Yes |
┌─────────────────────────────────────────────────────────────┐
│ ✓ Same bucket name │
│ ✓ Versioning enabled │
│ ✓ Same object locking config (if used) │
│ ✓ Same encryption settings │
│ ✓ Sufficient network bandwidth │
└─────────────────────────────────────────────────────────────┘
| Factor | Requirement |
|---|---|
| Bandwidth | Must exceed replication throughput needs |
| Latency | Higher latency = slower replication |
| Bottleneck | Replication speed = slowest link in mesh |
Site Replication syncs everything (buckets, IAM, policies) with one command:
mc admin replicate add site1 site2→ See lab/ for Kubernetes deployment
Objects have replication status in metadata:
| Status | Meaning |
|---|---|
PENDING |
Queued for replication |
COMPLETED |
Successfully replicated |
FAILED |
Replication failed |
REPLICA |
This is a replicated copy |
Check status:
mc stat site1/mybucket/myobject┌─────────────────┐ ┌─────────────────┐
│ Primary │────────►│ DR Site │
│ (Active) │ async │ (Standby) │
│ R/W traffic │ │ Warm standby │
└─────────────────┘ └─────────────────┘
- Primary handles all traffic
- DR site receives replicated data
- Manual failover when needed
Pattern 2: Active-Active (Two Sites) ← Lab
┌─────────────────┐ ┌─────────────────┐
│ Site 1 │◄───────►│ Site 2 │
│ R/W traffic │ async │ R/W traffic │
└─────────────────┘ └─────────────────┘
▲ ▲
│ │
Users in Users in
Region 1 Region 2
- Both sites accept writes
- Users connect to nearest site
- Eventual consistency between sites
MinIO uses last-write-wins based on object version timestamps:
Site 1: PUT object (t=100)
Site 2: PUT object (t=101) ← This wins
Result: Site 2's version replicated to Site 1
Important: Ensure clock synchronization (NTP) across sites!
# Replication status for bucket
mc replicate status site1/mybucket
# List replication rules
mc replicate ls site1/mybucket
# Check remote target status
mc admin bucket remote ls site1/mybucket| Metric | What it means |
|---|---|
| Pending count | Objects waiting to replicate |
| Failed count | Objects that failed replication |
| Replication lag | Time between write and replication |
| Bandwidth usage | Network between sites |
| Aspect | Single Site | Multi-Site |
|---|---|---|
| Complexity | Simple | More setup |
| Availability | Zone-level | Region-level |
| Latency | Low | Eventually consistent |
| Cost | Lower | Network + storage costs |
| Consistency | Strong | Eventual |
-
Enable versioning first
- Required for replication
- Can't disable after objects exist
-
Match configurations across sites
- Same bucket settings
- Same encryption
- Same lifecycle policies
-
Plan bandwidth
- Estimate replication throughput
- Consider peak write loads
-
Sync clocks (NTP)
- Critical for conflict resolution
- Use same NTP source if possible
-
Monitor replication lag
- Alert on high pending counts
- Track failed replications
-
Test failover
- Verify clients can switch sites
- Test data consistency