Skip to content

[Usability] Stream Creation #43

@gaoteng-git

Description

@gaoteng-git

问题描述:
首次写入某个 stream 的 wallet 获得独占访问权,其他 wallet 无法读写。

架构选择:

方案 A: 每用户 1 个 Stream(共享命名空间)

用户 A (Wallet A) → Stream 1 (所有表共用)
key = "memcells:id1"
key = "profiles:id2"

  • 优点: Stream 数量少,管理简单
  • 缺点: Key 命名空间需要前缀,表遍历需要扫描整个stream效率低下

方案 B: 每表 1 个 Stream(逻辑隔离)

用户 A (Wallet A):
→ Stream 1 (memcells 表)
→ Stream 2 (profiles 表)
→ Stream 3 (episodes 表)

  • 优点: 逻辑清晰,独立操作
  • 缺点: Stream 数量多,管理复杂

Stream 创建策略:

策略 1: 后端预分配

  • 管理员创建 stream 池
  • 用户注册时分配 stream ID
  • 简单,无需用户创建stream

策略 2: 客户端创建

  • 部署脚本自动创建 stream
  • 失败时回退到后端分配
  • Stream ID 保存在 .env 文件

待确认问题:

  1. 采用方案A还是方案B?
  2. 采用策略1还是策略2?
  3. 客户端 stream 创建的具体步骤,复杂程度?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions