Background
Currently, static assets, media files, backups, and other resources are scattered across local disks on various servers, with no unified object storage layer. As the number of sites and traffic volume grow, a centralized object storage solution must be planned.
This post presents a proposal for such a solution and seeks feedback before implementation.
Current Issues
- WordPress media files are stored locally on servers—disk space is limited, and CDN acceleration is unavailable.
- Site backups are distributed across multiple servers, with no off-site disaster recovery.
- Cravatar avatars: Over 20 million daily API calls place heavy pressure on the current storage layer.
- Discourse forum attachments: Grow alongside the database, making migration difficult.
- Brand assets (images, videos, font files) lack centralized storage and distribution.
Proposed Solution: Cloudflare R2 as Primary + Alibaba Cloud OSS for Mainland China
Why R2?
- Zero egress bandwidth fees (the largest cost component for S3—eliminated entirely by R2).
- Seamless integration with the existing Cloudflare ecosystem (Workers, CDN, custom domains).
- S3-compatible API—existing tooling (e.g., rclone, aws-cli, WordPress plugins) works out of the box.
- Storage pricing: $0.015/GB/month, with 10 GB free per month.
- Our team already uses Cloudflare extensively—no new vendor dependencies introduced.
Why Also Alibaba Cloud OSS?
- R2 has no edge locations in mainland China; latency for high-frequency access (e.g., Cravatar) would be unpredictable.
- Alibaba Cloud OSS offers multi-region coverage within China plus direct CDN origin pull.
- We already maintain three Alibaba Cloud accounts—OSS can be enabled immediately.
- Critical data will be written to both R2 and OSS for cross-regional redundancy and disaster recovery.
Solutions Not Adopted
- AWS S3: Expensive egress fees; no existing AWS ecosystem dependency; adds operational complexity.
- Self-hosted MinIO: High operational overhead; limited VM resources available.
Use-Case Allocation
| Use Case | Storage Solution | Access Method | Rationale |
|---|---|---|---|
| WordPress Media Library | R2 | Cloudflare CDN + Custom Domain | Global acceleration for images/attachments; zero egress cost |
| Static Assets (JS/CSS/fonts) | R2 | Cloudflare Workers | Flexible versioning & caching policies |
| Cravatar Avatars | Alibaba Cloud OSS + CDN | Alibaba Cloud CDN | Low-latency, high-frequency access required in mainland China |
| Site & Database Backups | R2 | rclone scheduled sync | Cold data: lowest-cost option with zero egress fees |
| Critical Data Disaster Recovery | Dual-write to R2 + OSS | rclone dual-target sync | Cross-regional redundancy |
| Discourse Forum Attachments | R2 | S3-compatible configuration | Native Discourse support |
| Brand Asset Library | R2 | Cloudflare CDN + Custom Domain | Global distribution; upload & management via Studio → modiqi |
Bucket Planning (Draft)
| Bucket | Purpose | Suggested Access Domain | Permissions |
|---|---|---|---|
| wp-media | WordPress media files | media.wpcy.net | Public read |
| site-backups | Site backups | Not publicly exposed | Private |
| db-backups | Database backups | Not publicly exposed | Private |
| brand-assets | Brand assets | assets.wpcy.net | Public read |
| discourse-uploads | Forum attachments | uploads.wpcy.net | Public read |
| cravatar-avatars | Avatar storage (OSS) | Served via Alibaba Cloud CDN | Public read |
Implementation Priority
- P1 — Backup Storage: Lowest risk—create R2 bucket + configure rclone scheduled sync. Immediate ROI.
- P2 — WordPress Media Migration: Use WP Offload Media plugin or Wenpai’s in-house plugin; migrate site-by-site.
- P2 — Discourse Attachment Migration: Update Discourse’s S3 config to point to R2.
- P3 — Cravatar Avatar Layer Refactor: Requires architectural changes—needs separate discussion.
- P3 — Brand Asset Library: To begin after standardized asset workflows are established.
Cost Estimate (Monthly)
| Item | Estimated Usage | Monthly Cost |
|---|---|---|
| R2 Storage | ~50 GB | $0.60 (after 10 GB free tier) |
| R2 Class A Operations | ~1M requests | $4.50 |
| R2 Class B Operations | ~10M requests | $3.60 |
| Alibaba Cloud OSS | ~20 GB | ~¥5 |
| Total | ~$10/month + ¥5 |
Compared to equivalent AWS S3 usage (~$30–50/month, primarily due to egress fees), R2 saves 60–80%.
Open Questions for Discussion
- Are the proposed bucket names and domain assignments reasonable?
- Is migrating Cravatar avatar storage from its current architecture worthwhile? What’s the estimated engineering effort?
- Backup retention policy: How many days should backups be retained? Should lifecycle rules auto-clean old backups?
- WordPress media migration: Use off-the-shelf plugins or build in-house? Does Wenpai already have an existing solution?
- Permission management: How should R2 access permissions be scoped across VMs?
Please evaluate feasibility and share feedback directly in replies.
@devops Infrastructure execution, backup strategy, rclone configuration
@wenpai WordPress media migration plan, Cravatar architecture assessment
@studio Brand asset upload & management workflow
@kali Storage access security review, permission model