{"canonical_url":"https://engineer.company/glossary/content-addressed-storage/","content_markdown":"# Content-addressed storage\n\n## What it is\n\nContent-addressed storage names an object by a digest computed from its contents. A client looking up an object supplies that name, which the storage system resolves to a location. One common representation couples the digest algorithm to the encoded result. A receiving client can recompute the digest and compare it before using the object. Changing a file ordinarily produces a new address, while storing the exact same representation again can return the same address. The storage system still needs places to keep replicas and indexes telling it where to find them.\n\nThe distinction becomes important once a system puts structure around the bytes. Git hashes a structured object that includes a header identifying its type and length. The name of a Git blob consequently need not equal the bare digest of its file contents. In the Open Container Initiative image format a descriptor names a particular representation of a component and can record its size and media type. An image manifest in turn names the objects it depends on. A digest of a compressed layer is a claim about that stored compressed representation. Decompressing it may yield bytes that another part of the image format identifies separately.\n\nA service can offer mutable names beside immutable object identities. A channel called `stable` can move from one release manifest digest to another. A client pinning the digest gets the named version when it can be fetched, while a client following the channel gets whatever the publisher currently associates with it. The channel can be useful for discoverability. A deployment or an audit that needs stable evidence can record the resolved identity at the time it made the decision.\n\n## Why it matters\n\nCaches can keep verified data under a digest without checking every time whether the name now means something else. A browser receiving a new page can discover an updated stylesheet at a different path. It can also keep the previously cached stylesheet available to old pages until they are replaced. That reduces coordination between publication and expiration. During a partial update, a client that already has the older document can still request the resource that document describes, provided the origin or cache retains it.\n\nStorage systems can exploit equality. If two image manifests refer to the same layer digest, the registry can store one copy and distribute it to clients that do not have it. Git can likewise reference an unchanged subtree from more than one commit. That does not mean every similar document takes no extra space. The hash compares the underlying representation. Reordering keys in a JSON object or changing its compression may produce new bytes even though an application interprets the payload the same way. If reuse depends on semantically equivalent output, choose a stable encoding and specify it as part of the protocol.\n\nIntegrity and authenticity are distinct concerns. Matching the digest gives confidence that the bytes available to the reader are the bytes referred to by a particular descriptor, under the assumptions of the algorithm. Establish the choice of descriptor, the requirements for safe execution and the client’s access separately. A trusted manifest, verified signature and access policy can establish those other parts of the decision. Record what was checked so that a correct hash is not interpreted as a blanket approval.\n\n## What it looks like in practice\n\nConsider a web release that contains an HTML document and an image. The build hashes the image and gives its URL a suffix derived from that identity. It then writes the exact URL into the HTML. The release uploads all objects that the new document refers to, checks those objects from the serving path and publishes the new document after its dependencies are available. Keep the old image for at least as long as the older document can still be used. A reader retrieving either version can verify that the same URL continues to carry its expected image. The public web address of the HTML can stay stable as the referenced assets change.\n\nA container release applies a related idea with different boundaries. Build an image once and record the manifest digest. Test that artifact, associate the test result with its digest and ask each environment to pull the same digest. For a multi-platform image, record whether the identifier belongs to an image index or a concrete platform manifest. The runtime may select a platform-specific child from the index. When a report names only a mutable image tag, resolving that tag after the incident may lead to a newer artifact than the one the operator is trying to inspect.\n\nThe [Engineer ApS credits](/credits/) describe this site's single stylesheet bundle and its content fingerprint. That is an example at the URL boundary. A page references the bundle version that was built for it, so separate pages can share the file and a newer bundle can have a new address. A complete general-purpose object store has additional responsibilities, including verifying incoming uploads, controlling access and reclaiming objects that are no longer referenced.\n\n## Where it goes wrong\n\nPublishing a mutable pointer before its objects are present creates a dangling reference. Readers can see the new pointer even though some data it names is missing. Stage dependencies first, and test them through the same path a reader uses. Tie retention to all published and staged manifests, including release versions that are still eligible for rollback. Reclaiming an object merely because the latest manifest stopped mentioning it can break other versions.\n\nSome pipelines recalculate a digest from a decoded value and compare it with a digest of the encoded wire object. Those comparisons answer different questions. Verify the exact representation named by the format and record versioned canonicalisation rules where a format deliberately hashes a structured value. Test equivalent encodings and altered object types so the implementation proves where equality begins and ends.\n\nShortening identifiers is useful in a display label. In a storage lookup, a shortened digest loses collision resistance and can become ambiguous as the data set grows. Decide whether a short string is a human hint, an abbreviation expanded by an unambiguous lookup or an actual addressing rule. Include the digest algorithm in interoperable references, and check both declared size and recomputed digest when the format provides them.\n\n## Further reading\n\n- [OCI image descriptor specification](https://github.com/opencontainers/image-spec/blob/main/descriptor.md) explains how descriptor digests identify image components.\n- [Git internals and objects](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects) shows how Git turns object representations into identifiers.\n- [Docker image pulls](https://docs.docker.com/reference/cli/docker/image/pull/) documents pulling an image by an immutable digest.\n\n\u003chttps://engineer.company/glossary/content-addressed-storage/\u003e\n","date_modified":"2026-11-24T02:36:24Z","description":"How content-derived names let clients verify objects and reuse them reliably, with examples from web assets, images and Git.","formats":{"gemtext":"https://engineer.company/glossary/content-addressed-storage/index.gmi","gopher":"https://engineer.company/glossary/content-addressed-storage/gophermap","html":"https://engineer.company/glossary/content-addressed-storage/","json":"https://engineer.company/glossary/content-addressed-storage/index.json","markdown":"https://engineer.company/glossary/content-addressed-storage/index.md","pdf":"https://engineer.company/glossary/content-addressed-storage/index.pdf"},"kind":"page","language":"en","title":"What is content-addressed storage?","url":"https://engineer.company/glossary/content-addressed-storage/","version":1}