Add Fastly Object Storage support to helix-shared-storage
- Dominant language
- JavaScript
- Stars
- 15
- Forks
- 16
- Avg merge
- 23h 18m
- Merged PRs (30d)
- 14
Description
Currently, `helix-shared-storage` supports AWS S3 and Cloudflare R2 through the AWS S3 SDK. Per the discussion in adobe/helix-deploy-plugin-edge#77, specifically https://github.com/adobe/helix-deploy-plugin-edge/pull/77#issuecomment-3554569809, both Fastly and Cloudflare offer object storage services that should be supported.
## Current State
The package currently supports:
- AWS S3 (primary storage)
- Cloudflare R2 (mirrored writes via S3-compatible API)
Configuration uses environment variables:
- `CLOUDFLARE_ACCOUNT_ID` / `r2AccountId`
- `CLOUDFLARE_R2_ACCESS_KEY_ID` / `r2AccessKeyId`
- `CLOUDFLARE_R2_SECRET_ACCESS_KEY` / `r2SecretAccessKey`
## Proposal
Add Fastly Object Storage as an additional mirroring target. Fastly Object Storage provides an S3-compatible API, similar to Cloudflare R2.
Implementation should follow the existing R2 pattern:
1. Add Fastly-specific configuration parameters (account ID, credentials, endpoint)
2. Create a third S3Client instance for Fastly Object Storage
3. Add Fastly client to the parallel write operations in the Bucket class
4. Support disabling Fastly mirroring via configuration (similar to `HELIX_STORAGE_DISABLE_R2`)
Key code areas:
- `storage.js` line 739: R2 client initialization
- `storage.js` line 148-158: Bucket constructor where clients array is populated
- Configuration parameters in `fromContext()` method
This maintains the existing architecture while extending support to both major edge computing platforms.
Contributor guide
Research direction
Start in storage.js with the Bucket constructor around lines 148-158, the fromContext() configuration parameters, and R2 client initialization around line 739. Follow the existing R2 pattern for Fastly configuration, client creation, and parallel writes, including a disable option; done means Fastly Object Storage can be configured as an optional mirroring target.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, javascript
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100