Skip to content

persistentStorage#1318

Draft
alexcos20 wants to merge 6 commits intomainfrom
feature/persistentStorage
Draft

persistentStorage#1318
alexcos20 wants to merge 6 commits intomainfrom
feature/persistentStorage

Conversation

@alexcos20
Copy link
Copy Markdown
Member

@alexcos20 alexcos20 commented Apr 7, 2026

What it is

Persistent Storage is a simple bucket + file store intended for long-lived artifacts that Ocean Node needs to keep across requests (and potentially across restarts), and to reference later (e.g. as file objects for compute).

Key primitives:

  • Bucket: a logical container for files.
  • File: binary content stored inside a bucket.
  • Bucket registry: a local SQLite table that stores bucket metadata (owner, access lists, createdAt).

Architecture (high level)

Components

  • Handlers (protocol layer): src/components/core/handler/persistentStorage.ts

    • Implements protocol commands such as create bucket, list files, upload, delete, and get buckets.
    • Validates auth (token or signature) and applies high-level authorization checks.
  • Persistent storage backends (storage layer): src/components/persistentStorage/*

    • PersistentStorageFactory: shared functionality (SQLite bucket registry, access list checks).
    • PersistentStorageLocalFS: local filesystem backend.
    • PersistentStorageS3: stub for future S3-compatible backend.
  • HTTP routes (HTTP interface): src/components/httpRoutes/persistentStorage.ts

    • Exposes REST-ish endpoints under /api/services/persistentStorage/... that call the same handlers.

Features

  • Create bucket

    • Creates a bucket id (UUID), persists it in SQLite with owner and accessListJson, and creates a local directory (localfs).
  • List buckets (by owner)

    • Returns buckets from the registry filtered by owner (mandatory arg).
    • Applies ACL filtering for non-owners.
  • Upload file

    • Writes a stream to the backend.
    • Enforces bucket ACL.
  • List files

    • Returns file metadata (name, size, lastModified) for a bucket.
    • Enforces bucket ACL.
  • Delete file

    • Deletes the named file from the bucket.
    • Enforces bucket ACL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant