Highlights

Contents

Part II
02

Buckets, objects and metadata

We give media bytes stable identities and keep application facts where they can be queried safely. The object name and the permission to access it are different things. We will build the object address, choose immutable versions, distinguish metadata types, and inspect consistency boundaries.

CHAPTER ATLAS / FOLLOW THE READING PATHCHAPTER ATLAS / FOLLOW THE READING PATH1Local, block, file,object storage2Buckets, objects andmetadata3Presigned URLs and directupload4Multipart uploads5Checksums and integrity6Replication anddistributed file systems7Lifecycle and retention8Case study: the mediaupload path

#Section 5Bucket, object, key, and metadata

A worker needs to find the clip uploaded for a match. A bucket is an object service’s container or administrative namespace. An object is the stored byte sequence together with object-associated attributes. A key names that object within the bucket. Metadata describes it, but the term needs its owner stated.

Heron might place an immutable source at a key such as tenant-a/clips/c7/source-v1. The bucket and key identify a stored object; the database separately says who owns clip c7, which match it belongs to, and whether viewers may play it. A predictable key is not an authorization check.

THE BUCKET AND KEY LOCATE BYTES; THE DATABASE ROW SAYS WHO MAY SEE THEMTHE BUCKET AND KEY LOCATE BYTES; THE DATABASE ROW SAYS WHO MAY SEE THEMobject storeheron-media/tenant-a/clips/c7/source-v15 GBdatabaseclip c7 · owner ana · match m7active_source = source-v1 · publishedknowing the key is not permission
Figure 13.5Illustrative names. The application should not derive permission merely from a caller knowing the key.

The API may provide content type, size, checksums, tags, or user metadata as object attributes. Those do not replace relational queries over clip visibility, processing status, and ownership. The S3 object model is one concrete example; bucket types and guarantees must be checked rather than generalized blindly.

#Section 6Immutable keys and version identity

A viewer starts downloading a source while another upload overwrites the same key. If processing or range requests silently see different bytes, the clip can become inconsistent. An immutable object identity names bytes that will not be changed after publication.

Upload to a new object identity, verify it, then atomically change the database’s active pointer. Old readers keep using the previous identity while new readers use the new one. Object versioning can supply another identity dimension, but application references must preserve the version they mean rather than accidentally requesting the latest bytes.

UPLOAD v2 BESIDE v1, VERIFY IT, THEN FLIP ONE DATABASE POINTERUPLOAD v2 BESIDE v1, VERIFY IT, THEN FLIP ONE DATABASE POINTERsource-v1source-v2active pointerold readers keep v1bytes never change in place; retention decides how long v1 stays
Figure 13.6Versioned publication. Retention determines how long old references remain valid.

The cost is retained old content and explicit cleanup. Three full illustrative versions of a 5,000,000,000-byte clip total 15,000,000,000 bytes before replication or encoding. Versioning protects earlier bytes only under its actual retention and deletion rules; it is not an excuse to ignore storage growth.

#Section 7Storage attributes versus application facts

The object reports a content type and checksum. The database reports that the clip is private and still processing. These facts answer different questions. Treat object metadata supplied by the client as input to validate, not as a statement that the bytes are safe or belong to the claimed user.

Heron records expected length, checksum type, uploader, and a reserved object identity during upload initiation. On completion it compares observed storage attributes with the reservation, then starts inspection or conversion. Only a later publication state permits viewers to obtain playback access.

For an illustrative population of 100 clips per day retained for 30 days, there are 3,000 metadata records. At the shared assumed 500 bytes per record, metadata payload is 1,500,000 bytes. Indexes, row versions, and database overhead are separate. The media bytes under the same clip assumptions are 15,000,000,000,000 bytes, so their transfer and storage paths differ dramatically.

3,000 CLIPS: 1,500,000 B OF METADATA STEERS 15,000,000,000,000 B OF MEDIA3,000 CLIPS: 1,500,000 B OF METADATA STEERS 15,000,000,000,000 B OF MEDIA1.5 MB3,000 × 500 B15 TB = 3,000 × 5 GBthe small record owns the large object (not to scale)
Figure 13.7Illustrative media workload added for this unit. Database and object implementation overhead are excluded.

#Section 8Consistency is a product and operation property

A design claims that object storage is always eventually consistent. That generalization can be wrong for the chosen service and operations. S3’s general-purpose object API documents strong read-after-write behavior for relevant object operations, but this does not create a transaction across the metadata database and the object service.

Name the operation. Reading a completed object by exact key, listing a container, retrieving metadata, changing access policy, and reading a cross-region replica may have different guarantees. Check current primary documentation and the selected bucket type rather than applying an old memory of one product to every operation.

A STRONG OBJECT READ SAYS NOTHING ABOUT WHETHER THE DATABASE POINTER WAS COMMITTEDA STRONG OBJECT READ SAYS NOTHING ABOUT WHETHER THE DATABASE POINTER WAS COMMITTEDobject operationc7/source-v2visible by exact keyapplication publicationpointer still at v1?two systems, two commits: coordinate them explicitly
Figure 13.8Consistency boundaries. Strong object reads do not atomically commit a database row.

A retry after a lost upload-completion reply can query the exact reserved identity and verify expected length and checksum. That uses the storage guarantee to recover one step. It still needs an idempotent database state transition to publish the relationship once, and must not accept another user’s object merely because the key exists.