Skip to main content

BLOBS

Working with BLOBs (Binary Large Objects)

Use cases

Technical design

Definitions

  • BLOB.OwnerRecord: QName of the record that owns the BLOB
  • BLOB.OwnerRecordField: Name of the field that owns the BLOB
  • CUD collection: Collection of CUDs (Create, Update, Deactivate) that are executed in the same transaction

Components overview

  • ~wdoc.sys.Workspace.BLOB~covrd1✅: WDoc for storing BLOB metadata
    • This is the only WRecord that can be referenced from CDocs
    • CDocs reference BLOBs by fields of the blob type
    • blob type is implemented as a ref to WDoc record
  • ~tuc.HandleBLOBReferences~covrd2✅: Handling fields of the blob type by command processor

CP: tuc.HandleBLOBReferences

  • Validate that every modified record its blob fields satisifies the following conditions:
    • ~err.BLOBOwnerRecordIDMustBeEmpty~covrd3✅: Target BLOB.OwnerRecordID must be empty
    • ~err.BLOBOwnerRecordMismatch~covrd4✅: BLOB.OwnerRecord does not match the record QName
    • ~err.BLOBOwnerRecordFieldMismatch~covrd5✅: BLOB.OwnerRecordField does not match the record field name
    • ~err.DuplicateBLOBReference~covrd6✅: Multiple records in CUD collection cannot refer to the same BLOB
  • ~cmp.UpdateBLOBOwnership~covrd7✅: Operator of the CP that updates the BLOB.OwnerRecordID and BLOB.OwnerRecordField fields in the BLOB table

Footnotes

  1. [~server.blobs/wdoc.sys.Workspace.BLOB~impl] pkg/sys/sys.vsql:63:impl

  2. [~server.blobs/tuc.HandleBLOBReferences~impl] pkg/processors/command/impl.go:538:impl, pkg/sys/blobber/provide.go:27:impl

  3. [~server.blobs/err.BLOBOwnerRecordIDMustBeEmpty~impl] pkg/sys/blobber/provide.go:55:impl

  4. [~server.blobs/err.BLOBOwnerRecordMismatch~impl] pkg/sys/blobber/provide.go:68:impl

  5. [~server.blobs/err.BLOBOwnerRecordFieldMismatch~impl] pkg/sys/blobber/provide.go:69:impl

  6. [~server.blobs/err.DuplicateBLOBReference~impl] pkg/sys/blobber/provide.go:61:impl

  7. [~server.blobs/cmp.UpdateBLOBOwnership~impl] pkg/processors/command/impl.go:537:impl