Deciding how much you're willing to pay when lawyers demand old data.
When you put data into Cold Storage (like AWS Glacier), getting it back isn't instantaneous. Providers offer different Service Level Agreements (SLAs) for retrieval. You can pay a premium to have a robotic arm fetch your tape in 5 minutes (Expedited), wait 3-5 hours for a normal queue (Standard), or wait up to 48 hours to fetch it for pennies (Bulk).
When you issue a restore command via the API, you must explicitly specify which tier of service you want. If you choose Expedited for a massive 50TB dataset, you will be billed thousands of dollars on your next invoice.
# AWS Boto3 Glacier Restore Example
import boto3
s3 = boto3.client('s3')
def restore_archive(bucket, key, urgency):
# urgency must be 'Expedited', 'Standard', or 'Bulk'
response = s3.restore_object(
Bucket=bucket,
Key=key,
RestoreRequest={
'Days': 7, # Keep it warm for 7 days after restoring
'GlacierJobParameters': {
'Tier': urgency
}
}
)
return "Restore initiated!"
A typical pricing structure looks like this:
- Expedited (1-5 mins): $0.03 per GB + $10.00 per 1000 requests.
- Standard (3-5 hrs): $0.01 per GB + $0.05 per 1000 requests.
- Bulk (5-12 hrs): $0.0025 per GB + $0.025 per 1000 requests.