Sub topic 5
Regions, durability and availability
Prerequisites
This chapter assumes you can create a bucket (covered earlier) and know what an AWS Region is. It builds the working model for where S3 data lives and what "eleven nines" does and does not promise.
A bucket lives in one Region
When you create a bucket, you pick a Region such as eu-west-1. The bucket and its objects stay in that Region unless you copy them elsewhere with replication. S3 does not move data between Regions on its own.
Bucket names are global, but the bucket itself is regional. Choose the Region by:
- Latency: put data close to the users or compute that read it.
- Compliance: some rules require data to stay in a country or region.
- Cost: prices and data transfer charges differ by Region. Traffic between an EC2 instance and an S3 bucket in the same Region costs nothing for the transfer itself. Traffic to another Region is billed.
A common error is PermanentRedirect or IllegalLocationConstraintException. The first usually means a request went to the wrong Region endpoint. The second means you created a bucket outside us-east-1 without a LocationConstraint.
Durability versus availability
These two words measure different things.
| Term | Question it answers | S3 Standard design target |
|---|---|---|
| Durability | Will the object still exist and be intact later? | 99.999999999% (11 nines) per year |
| Availability | Can I read or write it right now? | 99.99% per year |
Durability is about not losing data. Availability is about being able to reach it. An object can be durable but briefly unavailable during an outage.
How S3 achieves this
With most storage classes, S3 stores each object redundantly across multiple Availability Zones (AZs) in the Region. An Availability Zone is one or more separate data centers with independent power and networking. S3 also checks stored data with checksums and repairs damaged copies.
Because copies sit in separate AZs, the loss of one AZ does not lose the object.
Storage class differences
Not every class uses three AZs.
- Standard, Standard-IA, Intelligent-Tiering and the Glacier classes (except One Zone-IA) store data across at least three AZs.
- One Zone-IA stores data in a single AZ. It costs less, but if that AZ is destroyed, the data is lost.
- Availability targets are lower for infrequent-access classes. For example, Standard-IA targets 99.9%.
Check the current figures in the S3 documentation, because AWS may update them.
What the numbers do not cover
Eleven nines protects against hardware failure. It does not protect against you.
- An accidental
delete-objector overwrite removes or replaces data as designed. - A bad lifecycle rule can expire objects you wanted.
- A compromised credential can delete data.
For those risks, use versioning, restricted permissions, and replication, which later chapters cover. Replication to another Region also helps if a whole Region is unavailable.
Check where a bucket lives
This command prints the Region of an existing bucket.
aws s3api get-bucket-location --bucket my-example-bucket-123456789012For buckets in us-east-1, the LocationConstraint field is returned as null. This is a historical quirk, not an error.
Exercise
Your team keeps reproducible thumbnails that can be regenerated at any time, and wants the cheapest option. Is S3 One Zone-IA acceptable, and what risk are you accepting?
Show answer
Yes, it can be acceptable because the data can be regenerated. The risk is that all copies sit in one Availability Zone, so the loss of that AZ would lose the objects. Lower availability is also accepted compared with Standard.
Exercise
A colleague says 99.999999999% durability means the bucket is never unreachable. What is wrong with this?
Show answer
Durability measures the chance of losing an object, not whether you can reach it. Reachability is availability, which for S3 Standard is designed at 99.99%, so short periods of unavailability are possible.