How do you control Crab object-storage cost?
Crab cost follows unique bytes, object-store operations, retrieval, and transfer. Each lever targets a different term.
A cheaper storage class does not guarantee a cheaper repository.
Suppose a Crab repository stores 10 TB and reads 2 TB from origin each month. Storage is only one line on the bill:
storage + requests + retrieval + transfer + early-deletion chargesMove the wrong 8 TB into archive and the storage line falls while restore delay and other charges rise.
MONTHLY COST RECEIPT / 10,000 GB / 2,000 GB READ
Which line item did the policy move?
REPOSITORY PLACEMENT
Simple and immediately readable
Standard
10,000 GB
Storage
$230.00
Requests
$4.00
Retrieval
$0.00
Transfer
$180.00
Early deletion
$0.00
This is the baseline. Transfer, not storage, is already the largest line item.
The receipt uses Crab’s embedded S3 us-east-1 rates as an illustration. Use
your current region, negotiated contract, and provider calculator for a real
decision.
Measure four inputs
Start with repository inventory and Crab’s cost report:
crab du --remote
crab doctor --cost --json > before.json
crab optimize repo --jsonThen add evidence the object listing cannot provide:
- Origin bytes read by workflow.
- GET, PUT, LIST, and restore request counts.
- Cache-served versus origin-served bytes.
- Required time to first readable byte.
Crab’s live inventory may infer Standard class when provider listings do not expose storage class consistently. Retrieval estimates are incomplete without access telemetry. Keep the pricing-table version from the report so the model is reproducible.
Use at least one full release, training, and recovery cycle. A quiet week can make monthly data look archival.
Match the control to the bill term
| Bill term | First control to inspect |
|---|---|
| Stored GB keeps growing | Deduplication, retained roots, GC |
| Too many object operations | Xorb packing and range coalescing |
| Repeat origin reads | Local or shared cache |
| Cold reachable bytes cost too much | Lifecycle tiering |
| Retrieval charges rise | Move the threshold later |
| Early-delete charges appear | Respect class retention periods |
Do not change all controls together. The next bill will not show which change worked.
Reduce bytes before moving bytes
Use this order:
- Measure unique chunk growth and deduplication.
- Review recovery roots and collect unreachable objects.
- Optimize the live xorb layout.
- Tier only the cold, reachable tail.
- Cache repeat reads close to the workload.
Tiering first can archive objects GC would remove. Repacking first can rewrite objects that retention policy will release.
Preview layout work before changing remote objects:
crab gc --scope repo --dry-run
crab optimize plan --include-xorbs --profile ml --json
crab optimize xorbs --profile ml --dry-runLarger xorbs can reduce requests, but sparse reads may fetch extra range bytes. Record both sides of that trade.
Tier xorbs, not repository metadata
Crab lifecycle plans target .crab/xorbs/ only. Refs, manifests, shards,
file indexes, and Git packs stay directly readable.
Why? A 4 KiB shard may unlock a 40 GB model. Archiving that metadata saves almost nothing and can block every hydration plan that needs it.
The opt-in defaults transition xorbs to a warm class after 30 days and a deep-cold class after 180 days. Those numbers are starting points, not proof that the data is cold.
LIFECYCLE SORTER / SELECT AN OBJECT
INVENTORY OBJECT
.crab/xorbs/a1/a1f4…
age: 10 days
PREFIX GATE
XORB ELIGIBLE
rule: .crab/xorbs/ only
DESTINATION
STANDARD
The object matches the xorb prefix but has not reached the 30-day transition.
Build separate age and access rows:
| Set | Example evidence | Starting policy |
|---|---|---|
| Hot | Read daily by developers or CI | Standard |
| Warm | Read in a monthly model test | Direct-read infrequent class |
| Cold | Read only by quarterly recovery drill | Restore-compatible archive |
Shared xorbs follow object age and lifecycle prefix, not the branch that first uploaded them. Confirm that every workflow using a shared object can tolerate the destination class.
Plan now; do not assume apply is supported
Generate the provider policy without mutation:
crab tier plancrab tier plan --apply currently fails closed for S3, GCS, and Azure because
Crab does not yet have a qualified conditional, prefix-preserving lifecycle
write path. S3’s lifecycle API has no conditional write.
That distinction matters: the plan is useful evidence, but it is not proof that Crab changed the bucket. Manage the reviewed lifecycle policy through your qualified infrastructure workflow until safe apply support exists.
When a provider adapter becomes qualified, --merge will preserve unrelated
rules and replace Crab-managed rules. Still inspect broader Terraform or
bucket rules that overlap .crab/xorbs/.
Treat restore time as a cost
Some classes remain directly readable with a retrieval fee. Other archive classes require a provider restore before Crab can hydrate their xorbs.
RESTORE DISPATCH / SELECT A WORKLOAD
What should happen when cold data is requested?
STORAGE CLASS
Standard-IA
READ POLICY
direct read
APPLICATION RESULT
BYTES READABLE
no restore step
Read immediately
Retrieval fees may apply, but the object does not need provider restore staging.
crab hydrate 'models/current/**'Choose behavior per workload:
- CI can use
--no-restoreand fail instead of waiting. - Scheduled jobs can request a lower-cost bulk restore.
- Incident recovery can request the fastest supported tier.
- Warm data should stay directly readable.
Restored copies are temporary. Model restore-request charges, retrieved GB, the restored-copy duration, and the complete wait until hydration finishes.
Run a recovery drill before relying on an archive objective. Record:
- Time to request all restores.
- Time until every xorb is readable.
- Retrieval and transfer bytes.
- Hydration duration after restore.
A cheap class fails the policy if the release or incident cannot wait.
Watch minimum retention
In Crab’s embedded S3 table, Standard-IA has a 30-day minimum, Glacier Instant and Flexible Retrieval have 90-day minimums, and Deep Archive has 180 days. Other providers differ.
Deleting or rewriting earlier can create a charge for the remaining period.
Class-aware crab gc blocks early deletion by default and estimates the
penalty.
Include migration cost in payback:
payback months =
transition requests + temporary storage + retrieval + operator time
------------------------------------------------------------------
expected monthly savingsReject a migration whose payback exceeds the repository or policy lifetime.
Cache the repeated path
A local cache avoids repeat origin reads on one machine. A shared cache can do the same across developers and CI.
Caching does not reduce origin storage. Count cache compute, disk, and cross-zone traffic, then subtract avoided origin retrieval and transfer.
Use byte-weighted hit rate. A 95% object hit rate is weak evidence if the largest xorbs are the misses.
Review one change per billing window
Keep a compact record:
- Baseline dates and pricing-table version.
- Workflow access and restore evidence.
- One control changed.
- Expected bill and availability effect.
- Rollback or infrastructure revert path.
- First complete billing window for review.
End with one decision: keep the policy, adjust one measured threshold, or collect more evidence.
Review the crab tier, crab optimize, and pricing tables before changing provider policy.
KNOWLEDGE PROOF
Check the decision, not your memory.
What should you do before moving Crab objects to a cheaper storage class?