
Managing object lifecycles is one of the simplest ways to control storage costs, keep buckets organized, and automate data hygiene. Backblaze B2 has supported lifecycle rules for years through our B2 Native APIs and the web application. Today, we’re expanding that support by adding S3 compatible lifecycle rule APIs, making it easier for you to use S3 tools and workflows to manage your data on Backblaze B2 (check out the docs: S3 Put Lifecycle Configuration, S3 Get Lifecycle Configuration, S3 Delete Lifecycle Configuration). This provides you with more flexibility and control over object management—all with Backblaze’s signature simplicity and affordability.
What’s new
You can now create, edit, and manage lifecycle rules on B2 Cloud Storage using standard S3 compatible APIs, including:
Lifecycle rules can be applied to:
- Entire buckets
- Specific prefixes (e.g.,
logs/, images/monkeys/) - Nested folders with overlapping logic (e.g.,
animals/ and animals/cows/)
New survey: The Hidden Cost of Cloud Storage
We surveyed over 400 IT decision makers and one thing stood out. Surprise charges affect almost everyone. Learn what’s driving them—and how to avoid them.
Why this matters
1. Seamless migrations from AWS
If you’re moving workloads from AWS S3, you can bring your existing lifecycle configurations with minimal changes. This reduces work while migrating your workloads to Backblaze B2.
2. More flexibility for complex data structures
With support for nested and overlapping prefixes, you can apply precise expiration rules to different datasets with overlapping prefixes in the same bucket. Whether you’re managing rapidly changing logs or long-term archives, lifecycle rules allow more controlled, automated retention.
3. Increased functionality for multi-cloud architectures
For teams looking to capitalize on multi-cloud architecture, this means more seamless integration up and down the stack.
4. Cost optimization
We apply the most cost-saving configuration for you in case of overlapping rules.
How it works
S3 compatible lifecycle rules define automated actions based on object age or status. With Backblaze B2, you can use rules to:
- Delete objects after a set number of days
- Hide objects after a set number of days
- Expire noncurrent versions
- Delete multipart uploads that are incomplete for a set number of days
- Set multiple rules for nested prefixes for granular control
For example:
<LifecycleConfiguration>
<Rule>
<ID>DeleteTempFiles</ID>
<Status>Enabled</Status>
<Filter>
<Prefix>temp/</Prefix>
</Filter>
<Expiration>
<Days>30</Days>
</Expiration>
</Rule>
</LifecycleConfiguration>
This configuration automatically hides objects under temp/ after 30 days.
Example use cases
- Automated cleanup for short-lived objects: Temporary files, build artifacts, or test data can expire automatically after a given retention period.
- Compliance-driven policies: Organizations with strict retention and deletion requirements can enforce rules consistently across buckets.
- Automated cleanup of incomplete multipart uploads: Save money by removing partial upload fragments that were never completed due to network interruptions, client failures, or abandoned sessions automatically.
- Tiered retention for nested prefixes: Allow broad retention for the general dataset while enforcing a faster cleanup cycle for a particular subset that changes more frequently or has lower long-term value. For example, you can apply a 30-day expiration rule to all objects under the prefix
temp/, while assigning a shorter 7-day expiration rule to the more specific prefixtemp/webserver/.
How it complements existing B2 Lifecycle Rules
Backblaze continues to support lifecycle rules through the B2 Native API, which many customers use today. The new S3 compatible support offers an additional path for lifecycle automation, especially for customers with S3 style infrastructure or tooling.
Although both S3 compatible and B2 Native lifecycle rules can coexist, we strongly recommend using a single method depending on your workflow preferences to manage lifecycle rules.
Getting started
You can begin using lifecycle rules today through:
- S3 compatible SDKs
- S3 CLI tools
- Direct API calls
Refer to Backblaze S3 Compatible API documentation for more details, specifically:
Most customers can apply their existing AWS lifecycle rules directly, without modification.
Availability
S3 compatible lifecycle rules are now available.
Wrapping up
Lifecycle rules help automate routine object cleanup and give teams predictable control over object retention. With the addition of S3 compatible lifecycle APIs, Backblaze B2 makes it even easier for customers to bring their existing S3 workflows to our platform while continuing to use the lifecycle management strategies they already trust.
Get started with Backblaze today by signing up for an account or contacting Sales.