Replication Rules and Filtering
What You'll Learn
You'll learn how to control exactly which objects get replicated across regions by setting up filters based on prefixes, tags, and creation time.
Why Filtering Matters
Remember from our last lesson that cross-region replication copies objects between buckets—but you don't always want to replicate everything. Maybe you only need to replicate customer photos, not temporary logs. Or only objects created after a certain date. That's where replication rules and filters come in.
Three Types of Filters
Prefix-Based Filters
Think of prefixes like folder paths. If you only want to replicate objects in images/products/, you set a prefix filter. Objects stored under logs/ or temp/ won't replicate.
Example scenario: Replicate only /invoices/2024/ to your backup region, leaving /scratch/ local.
Tag-Based Filters
Tags are key-value labels you attach to objects. A filter like Department=Finance means only objects tagged with that pair will replicate.
Example scenario: Tag sensitive documents with Compliance=Required and replicate only those to your audit region.
Time-Based Filters
Specify a creation date threshold. Only objects created after that timestamp will replicate—useful when starting replication mid-project.
Example scenario: Enable replication on January 1st but only replicate objects created from that date forward, not historical data.
Combining Filters
You can layer filters: replicate objects with prefix /reports/ and tag Priority=High and created after March 1st. The more specific your rules, the tighter your control over replication traffic and costs.
Key Takeaway: Replication filters using prefixes, tags, and timestamps let you selectively replicate only the objects that matter, saving bandwidth and storage costs while maintaining precise control over your data distribution.