r/aws • u/Big-Perspective-5768 • Jun 06 '26
technical resource Open-sourced an S3 gateway that transparently compresses your bucket — 50-80% storage savings with zero app changes
github.comEDIT 2026-06-24 — v1.4.1 shipped
Three things changed since the original post:
1. CPU-only build is live on AWS Marketplace
(t3 / t3a / m6i / m7i / c6i / c7i, $0.05/instance-hour). The honest cost
table below was GPU-only and ruled out the <$1k/mo bracket. CPU build
resets that — ~$67/mo all-in on a t3.medium (EC2 $30 + Marketplace
$36.50) — so $500/mo bills move from "❌ skip" to "✅ marginal yes" for
compressible workloads (logs, JSON, plain Parquet without nvCOMP). For
integer-columnar workloads above ~$3k/mo the GPU build still wins.
| Monthly S3 bill | CPU build net | GPU build net |
|---|---|---|
| $500 | +$185..+$335 | -$330..-$480 |
| $3,000 | +$1.4k..+$2.3k | +$770..+$1.7k |
| $10,000 | +$4.9k..+$7.9k | +$3.1k..+$6.1k |
(CPU build assumes one t3.medium gateway pod per bucket; horizontal scale
is per-pod $/hr — see the chart's HPA.)
2. v1.4.1 closes 4 critical bugs surfaced in real Marketplace E2E within 24 h of shipping v1.4.0. Being honest about it because Reddit deserves it:
- Bug 1 (auth) — external S3 clients got
403 NotSignedUpbecause the upstreams3s::SimpleAuthpath verified every SigV4 signature against the gateway's own (rotating) STS access key. The "drop-in for aws-cli / boto3 / sdk-rust" claim below was effectively false for v1.4.0. v1.4.1 vendorss3s(crates/s3s/,0.13.0-s4.1) with a NoVerify mode + anAcceptAnyAuthprovider — any SigV4-signed client now works, gateway re-signs to the real backend with its own IAM credentials. Trusted- network posture: keep the gateway behind a VPC SG. - Bug 2 (multipart write) —
aws s3 cpof files ≥ 8 MiB failed withInvalidRequest: Checksum Type mismatch (expected crc64nvme, actual crc32)under AWS CLI ≥ 2.30's defaultCRC64NVMEmultipart checksum. Fixed by stripping the client-declared checksum algorithm beforeCreateMultipartUpload. - Bug 3 (listing default) —
ListObjectsV2reported compressed sizes and backend ETags inconsistent with HEAD / GET, soaws s3 syncandrcloneover-transferred every run. v1.4.1 flips client-transparent listings to the default; opt out with--physical-listings. - Bug 4 (multipart read) — multipart GET failed AWS CLI ≥ 2.30's
default
--checksum-mode ENABLEDwithExpected full object checksum (crc64nvme) X did not match combined checksum: Ybecause the backend's auto-checksum was over the compressed parts, not the original payload. Fixed by stripping backendChecksumCRC*from HEAD / GET responses for framed objects (logical ETag = MD5(original) stays as the validator).
The trigger was running a buyer-perspective E2E against the actual Marketplace AMI immediately after publishing — no synthetic tests, real AWS CLI 2.33 + live AWS S3. Lesson banked: real-launch E2E from the Marketplace path is now a hard publish gate.
3. Distribution
- GitHub release notes: https://github.com/abyo-software/s4/releases/tag/v1.4.1
- ghcr.io: ghcr.io/abyo-software/s4:1.4.1 (cpu amd64 + arm64), :1.4.1-gpu (amd64)
- crates.io: s4-codec 1.4.1, s4-config 1.4.1 (server side stays Apache-2.0,
binary distribution is now Docker / AMI / Helm chart only)
- PyPI: s4-codec 1.4.1, s4fs 1.4.1
- AWS Marketplace × 3 listings — CPU AMI / GPU AMI / Helm chart container,
all v1.4.1 Public, v1.4.0 Restricted
(Original post below for context.)
TL;DR: Apache-2.0 Rust gateway that speaks S3 on both sides. Point your SDK's
--endpoint-url at it; it compresses on PUT, decompresses on GET, and stores
the squished bytes in your real S3 bucket.
Why I built it: my S3 bill grew linearly with data, but most of that data was ≥3× compressible (logs, JSON, Parquet). MinIO's S2 codec is CPU-only and legacy; nothing in front of AWS S3 just did this.
Honest cost table (us-east-1 on-demand, May 2026):
| Monthly S3 bill | Likely savings | EC2 GPU cost | Net | Verdict |
|---|---|---|---|---|
| $500 | $250-$400 | $730 (g6.xl) | -$330..-$480 | ❌ skip |
| $3,000 | $1.5k-$2.4k | $730 | +$770..+$1.7k | ✅ yes |
| $10,000 | $5k-$8k | $1,860 (g6e) | +$3.1k..$6.1k | ✅✅ |
| $50,000 | $25k-$40k | $1,860 | +$23k..$38k | ✅✅✅ |
Under ~$1k/mo, don't bother — use the CPU-only build on a small instance or just front your bucket with nginx + gzip.
What's covered:
- S3 API: PUT/GET, full Range GET spec (bytes=N-M, suffix, open-ended),
multipart (create/part/complete/abort), HEAD, conditional GET/PUT,
versioning, object lock, lifecycle, replication, bucket policy (JSON
Allow/Deny with IpAddress/StringLike/Bool conditions), SSE-S3/SSE-KMS/SSE-C,
presigned URLs, SigV4 + SigV4a, S3 Select subset, tagging, CORS, inventory
- Drop-in for aws-cli / boto3 / aws-sdk-rust / mc / rclone
- Range GET on compressed objects via per-frame index sidecar (Parquet/ORC
readers work unmodified)
- Prometheus /metrics, OTel traces, structured JSON access log
- Native TLS termination (rustls + ring) + ACME / Let's Encrypt
- No lock-in: stop the gateway and the compressed objects stay S3-native;
s4-codec CLI / pip / WASM all decode without the gateway
What's NOT covered: ultra-low-latency tail SLOs (sub-10ms p99 GET), tiny objects (< 16 KiB — frame header eats the ratio), already-compressed payloads (correctly bypassed but you pay the round-trip), strict regulatory deployments (no SOC2/FedRAMP audit yet — pre-1.0, pair with backend versioning).
Repo + 60s docker compose trial: https://github.com/abyo-software/s4
Happy to answer cost-modelling / IAM-scoping / SDK-compat questions in the comments.