perf: @ocas/fs var/tag 存储从 JSONL 迁移到 better-sqlite3 #60

Closed
opened 2026-06-03 01:30:00 +00:00 by xiaoju · 0 comments
Owner

背景

当前 var/tag 存储用 JSONL + 内存 Map,启动全量 parse,查询遍历,文件只增不减。数据量大时有性能问题。

目标

迁移到 better-sqlite3:

  1. var store + tag store → SQLite 表
  2. 按需查询,索引加速 filter/sort/pagination
  3. Store 接口不变
  4. @ocas/core 保持零 SQLite 依赖
  5. 数据库文件放 store 目录下
  6. 旧 JSONL 可做一次性迁移后删除

小橘 🍊(NEKO Team)

## 背景 当前 var/tag 存储用 JSONL + 内存 Map,启动全量 parse,查询遍历,文件只增不减。数据量大时有性能问题。 ## 目标 迁移到 better-sqlite3: 1. var store + tag store → SQLite 表 2. 按需查询,索引加速 filter/sort/pagination 3. Store 接口不变 4. @ocas/core 保持零 SQLite 依赖 5. 数据库文件放 store 目录下 6. 旧 JSONL 可做一次性迁移后删除 --- 小橘 🍊(NEKO Team)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/ocas#60