forming / System Design Archive

Composable Service Stack

Composable Service Stack 把文件、媒体 AI、元数据后台、搜索和前台展示分给成熟服务:OpenList + COS 管大文件,Immich 管图片视频 AI,Directus 管人工 metadata overlay,Meilisearch 管动态检索,Astro/MyBlog 只负责阅读空间和知识展示。

OpenList + Tencent COSImmichDirectusMeilisearchAstro Presentation Shelladmin-next Gateway
Inspiration

借鉴对象

  • NAS storage stack
  • Google Photos / Immich
  • Headless CMS
  • Meilisearch
  • Plex media library
  • Digital asset management
Rejected

拒绝的方案

  • 把 MyBlog 写成全能后端,因为媒体库、CMS、搜索引擎和对象存储都有成熟系统。
  • 把 OpenList 当 CMS 或 Obsidian 写作真源,因为它只适合 content control plane、文件访问、metadata/API/URL 抽象和大文件后端,不负责文章编辑 authority、metadata overlay、工作流、Graph 和搜索权威。
  • 继续让 Pagefind 承担动态实体搜索权威,因为 Pagefind 更适合构建期静态文档。
  • 把 Directus 或 Meilisearch 写成已部署事实,因为当前它们仍是 target runtime。
  • 把大文件放入 Directus / MySQL,因为 EPUB、PDF、图片和视频应留在 OpenList / COS。
Runtime

运行方式

  • OpenList + 腾讯云 COS 当前已作为 content control plane 下的大文件 / blob 后端验证:bucket myblog-media-1410041307,region ap-shanghai,挂载点 /腾讯云COS,验证对象 _verify/openlist-cos.txt。
  • OpenList + server storage integration 当前 active:/Obsidian 是 Local driver,root=/home/vault/Obsidian,只作为 Linux hot mirror 的 public access identity;/腾讯云COS 与 /夸克网盘 是冷层和 blob backend;root disk 维护入口是 npm run server:openlist-storage。
  • Immich 当前是 skeleton-installed-not-started:/srv/immich、.env、docker-compose.yml、check-readiness.sh 和 Nginx vhost 已存在,但 DNS、独立存储和 root disk 空间未满足启动条件。
  • Directus 是 target-not-deployed structured content / metadata layer:近期承接 books、visuals、collections、knowledge_objects 的人工策展字段;AI-native publishing cutover 后可承接 articles、drafts、factpacks、citations、author_contracts、critic_reports 和 runtime_runs 的 Directus/Postgres truth;它不保存大文件原件。
  • Meilisearch 是 target-not-deployed search runtime,后续索引 KnowledgeObject snapshot、OpenList file index、Directus metadata 和 Immich import snapshot;上线前 Pagefind 继续承担静态文章搜索。
  • infra/composable-stack 提供 Directus + Meilisearch 的可复刻 Docker Compose skeleton、.env.example 和 check-readiness.sh;服务器侧已同步到 /srv/myblog/services/composable-stack/,但 .env 未创建、容器未启动,它是部署入口,不是已运行事实。
  • Astro/MyBlog 当前是 presentation shell:组织 Feed、Drawer、Reader、Visual Collection、Graph 和公开路由,只消费 API、snapshot、manifest 和 Astro content collection;manifest 是 projection/cache,不是人工 metadata truth。
  • apps/admin-next 只做 gateway、import pipeline、runtime cache、OpenList proxy、MySQL runtime bridge 和服务间 glue;不得扩张成完整 CMS、媒体库或搜索引擎。
  • Dify 是 target-not-deployed AI workflow orchestrator,只负责 research、writer、critic、SEO、summary、prompt 和 agent workflow;Dify durable output 必须写回 Directus/Postgres,不能成为 CMS 或数据库。
  • OpenList/COS 文件索引拥有书籍 existence authority;public-data/books/books-index.json 只保存 path / modified / size / sourceType / cover cache 输入;public-data/books/books.metadata.json 是 P0 editable metadata layer。build script 不得内联 const overlays,也不得让 manifest、localStorage 或 OpenList 决定 tags、description、status、collection。
Tradeoff

取舍

  • 组合成熟服务会增加部署和观测复杂度,但避免在 MyBlog 内重复实现媒体库、CMS、搜索和对象存储。
  • Directus / Meilisearch 引入后会多一层同步和索引延迟,但换来动态对象、人工策展和全文 / 语义搜索的稳定权威。
  • MyBlog 保持展示壳会限制它直接写入所有状态,但这让前台部署简单、边界清晰,也更容易缓存。
  • COS 能缓解 root disk 压力,但不能替代 Immich/Postgres 的数据库盘和热缓存卷。
  • Compose skeleton 让后续部署更可复刻,但在 root disk 只有数 GB 可用时必须保持未启动。
Future Direction

后续方向

  • 部署 Directus 并建模 books、visuals、collections、knowledge_objects 的 metadata overlay,再按 AI-native publishing plan 迁移 articles、factpacks、citations、author_contracts、runtime_runs 和 critic_reports。
  • 部署 Meilisearch 并建立 KnowledgeObject snapshot index,逐步替代 Pagefind 对动态实体的缺口。
  • 建立 canonical file index:OpenList/COS scan -> normalized file objects -> Directus overlay -> Meilisearch index -> MyBlog snapshot。
  • 实现 Immich API importer,把 asset、album、tag、face、semantic metadata 导入 VisualCollection / KnowledgeObject snapshot。
  • 把 Search、Graph、Timeline 和 Drawer 的对象来源统一到 KnowledgeObject projection。