Lifecycle, security, and operations
Operate and recover R2
Monitor object operations, storage, errors, and credentials while maintaining tested copies for data whose loss is unacceptable.
8 minute lesson
Track bucket ownership, bindings, S3 credentials, lifecycle rules, custom domains, object count, storage, and error rates. Rotate credentials without committing them or breaking every client at once.
R2 durability does not replace every backup requirement. Decide whether accidental deletion, application corruption, or account compromise requires versioned copies, replication, or an independent export. Test restoration into a separate prefix.
Delete one disposable object, restore it from the chosen recovery copy, and verify metadata as well as body bytes.
Inventory before deleting or changing lifecycle rules:
npx wrangler r2 object get practice-files/reports/july.pdf --file restored.pdf --remote
shasum -a 256 restored.pdf
Compare the checksum with the source or manifest. Object replication and lifecycle cleanup are not the same as a recoverable backup. Restore into a different key or bucket first, verify the application can read it, and only then change the production object.
Lesson completed