Skip to content

BlobService ​

BlobStore service: large objects stored, read and deleted by id.

An object is split into chunks of up to 256KB, each identified by the SHA-256 digest of its bytes. Every upload is its own blob with its own id, even when another blob holds the same bytes; identical chunks are stored once underneath and shared. Deleting a blob ends its hold on its chunks; the storage of chunks no blob, retained history or reader still needs is reclaimed in the background.

A member of a group with other members refuses uploads and deletes with FAILED_PRECONDITION, reason BLOB_NOT_REPLICATED: blob bytes are held only on the member that writes them.

Transport

All methods are available via:

  • gRPC on port 7080 — native high-performance API
  • REST/JSON on port 7081 — HTTP/JSON transcoding via embedded structured-proxy

Methods ​

UploadBlob ​

Upload an object as a stream of chunks and store it as a new blob.

HTTP: POST /v1/blobs

Request: stream BlobChunk

FieldTypeDescription
databytesChunk data (up to 256KB per message). On upload the messages' data, concatenated in order, is the object; their sizes need not match the stored chunk size.
sequenceuint32Chunk sequence number (0-based, for ordering verification).
operationOperationRefUpload only, on the first message: the client operation the upload carries out. The upload then takes effect at most once however the call is retried, and every attempt names the same blob, so a retry after a lost answer never leaves a second blob behind. A retry of an operation that already took effect stores nothing and is refused with FAILED_PRECONDITION, reason OPERATION_SETTLED; ErrorInfo metadata blob_id names the blob the operation stored. Absent stores the upload unbound. Set on a later message, it is refused with INVALID_ARGUMENT.

Response: UploadBlobResponse

FieldTypeDescription
blob_idstringThe blob's id: 32 lowercase hex digits naming this upload. Two uploads of the same bytes get different ids.
chunk_idsstring[]The SHA-256 digest of each chunk in object order (hex, 64 chars each), repeated where the object repeats a chunk.
total_sizeuint64Total size of the uploaded blob in bytes.
dedup_chunksuint32Number of distinct chunks whose bytes the store already held and now shares instead of storing again.

DownloadBlob ​

Download a blob, returned as a stream of chunks in object order. The whole blob is read as it stood when the download began, however slowly the stream is consumed.

HTTP: GET /v1/blobs/{blob_id}

Request: DownloadBlobRequest

FieldTypeDescription
blob_idstringBlob identifier returned from UploadBlob.

Response: stream BlobChunk

FieldTypeDescription
databytesChunk data (up to 256KB per message). On upload the messages' data, concatenated in order, is the object; their sizes need not match the stored chunk size.
sequenceuint32Chunk sequence number (0-based, for ordering verification).
operationOperationRefUpload only, on the first message: the client operation the upload carries out. The upload then takes effect at most once however the call is retried, and every attempt names the same blob, so a retry after a lost answer never leaves a second blob behind. A retry of an operation that already took effect stores nothing and is refused with FAILED_PRECONDITION, reason OPERATION_SETTLED; ErrorInfo metadata blob_id names the blob the operation stored. Absent stores the upload unbound. Set on a later message, it is refused with INVALID_ARGUMENT.

DeleteBlob ​

Delete a blob. Chunks other blobs share stay readable through them.

HTTP: DELETE /v1/blobs/{blob_id}

Request: DeleteBlobRequest

FieldTypeDescription
blob_idstringBlob identifier returned from UploadBlob.

Response: DeleteBlobResponse

FieldTypeDescription
chunks_deleteduint32Chunks whose storage this call reclaimed. Reclamation happens in the background once nothing needs a chunk any more, so a delete reports 0; its effect is that the blob no longer holds its chunks.

GetBlobMeta ​

Get blob metadata (chunk count, total size) without downloading.

HTTP: GET /v1/blobs/{blob_id}/meta

Request: GetBlobMetaRequest

FieldTypeDescription
blob_idstringBlob identifier returned from UploadBlob.

Response: BlobMeta

FieldTypeDescription
blob_idstringBlob identifier.
total_sizeuint64Total size in bytes.
chunk_countuint32Number of chunks, counting repeats.
chunk_idsstring[]The SHA-256 digest of each chunk in object order (hex, 64 chars each).

Types ​

BlobChunk ​

A single blob chunk in a streaming upload/download.

FieldTypeDescription
databytesChunk data (up to 256KB per message). On upload the messages' data, concatenated in order, is the object; their sizes need not match the stored chunk size.
sequenceuint32Chunk sequence number (0-based, for ordering verification).
operationOperationRefUpload only, on the first message: the client operation the upload carries out. The upload then takes effect at most once however the call is retried, and every attempt names the same blob, so a retry after a lost answer never leaves a second blob behind. A retry of an operation that already took effect stores nothing and is refused with FAILED_PRECONDITION, reason OPERATION_SETTLED; ErrorInfo metadata blob_id names the blob the operation stored. Absent stores the upload unbound. Set on a later message, it is refused with INVALID_ARGUMENT.

BlobMeta ​

Blob metadata.

FieldTypeDescription
blob_idstringBlob identifier.
total_sizeuint64Total size in bytes.
chunk_countuint32Number of chunks, counting repeats.
chunk_idsstring[]The SHA-256 digest of each chunk in object order (hex, 64 chars each).

DeleteBlobRequest ​

Request to delete a blob.

FieldTypeDescription
blob_idstringBlob identifier returned from UploadBlob.

DeleteBlobResponse ​

Response after blob deletion.

FieldTypeDescription
chunks_deleteduint32Chunks whose storage this call reclaimed. Reclamation happens in the background once nothing needs a chunk any more, so a delete reports 0; its effect is that the blob no longer holds its chunks.

DownloadBlobRequest ​

Request to download a blob.

FieldTypeDescription
blob_idstringBlob identifier returned from UploadBlob.

GetBlobMetaRequest ​

Request for blob metadata.

FieldTypeDescription
blob_idstringBlob identifier returned from UploadBlob.

OperationRef ​

A reference to one client operation: what a client persists before sending a write and sends again with every retry of it, on any connection and to any member.

FieldTypeDescription
issuerbytesThe logical client: 16 bytes the client chooses once and keeps across its restarts (a random value, or a digest of a stable application identity). Independent clients use different issuers; a connection, session or server is not an issuer.
incarnationuint64The issuer's incarnation the number belongs to, from EnrollIssuerResponse.
sequenceuint64The operation's number within the incarnation, allocated by the client: starting at EnrollIssuerResponse.next_sequence, each new write takes the next number, and a retry of a write keeps its number. Numbers are an identity, not an execution order: writes with different numbers may run concurrently and complete in any order.
deploymentbytesThe deployment that enrolled the incarnation, 16 bytes, from EnrollIssuerResponse.deployment. A server of another deployment refuses the reference with INVALID_ARGUMENT, reason FOREIGN_OPERATION, rather than admit it as a new operation.

UploadBlobResponse ​

Response after a complete blob upload.

FieldTypeDescription
blob_idstringThe blob's id: 32 lowercase hex digits naming this upload. Two uploads of the same bytes get different ids.
chunk_idsstring[]The SHA-256 digest of each chunk in object order (hex, 64 chars each), repeated where the object repeats a chunk.
total_sizeuint64Total size of the uploaded blob in bytes.
dedup_chunksuint32Number of distinct chunks whose bytes the store already held and now shares instead of storing again.