Skip to content

Remove the billing service UCAN stream handler and use BlobRegistry to directly insert deltas into the diff table #304

@BravoNatalie

Description

@BravoNatalie

This issue aligns with RFC#39 (removal of the UCAN stream) and aims to implement a mid-term solution to improve space usage tracking in the billing sub-system.

Objectives:

  1. Insert space usage deltas directly into the DynamoDB diff table from the BlobRegistry at the time of item additions or removals.
  2. Remove the UCAN stream handler from the billing service.

Benefits:

  • Improved Visibility: Tasks are performed immediately at the point they are needed, rather than delayed, offering clearer oversight on what needs to be done and when.
  • Explicit Coupling: Makes the connection between upload-api and billing sub-systems explicit.
  • Early Failure Detection: Surfaces failures earlier in the process, reducing debugging complexity.
  • System Consistency: Ensures consistency across the system by maintaining atomicity in operations.
  • Fixing Double Diff Entries: Resolves issues like double entries in the diff table if a blob already exists.

Implementation Details:

  • repository: w3infra
  • Update BlobRegistry.register and BlobRegistry.deregister to insert the space usage delta into the space-diff table when blob/accept and blob/remove are executed, respectively.
  • Ensure atomic updates to maintain data consistency across the system.
  • The ucan-stream is currently configured in stacks/billing-stack.js.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions