Create

Sign in to ReadmeX

or

How we handle your data: Privacy Policy

ReadmeX

Your AI reading companion

What would you like to catch up on?

Pick a briefing, or ask your own question.

Your community and people briefings stay personal to you.

Story

WeKnora v0.9.0 data architecture and tenant isolation

AI summary

A technical analysis of WeKnora v0.9.0 examines its relational data model, SQL migrations, vector indexing, and multi-tenant isolation. It reports that PostgreSQL and SQLite maintain separate, non-interchangeable migration histories, while relational tables are authoritative and vector embeddings are derived data that can be rebuilt from chunk text. The analysis also says tenant isolation relies on application-layer predicates rather than database row-level security: authentication middleware places tenant information in context, service-layer code passes it onward, and repository methods explicitly apply tenant_id conditions. The supplied material consists of one analysis and does not independently corroborate its findings.

In-depth insight

The analysis cites migration directories, model files, and repository paths, helping developers and operators understand WeKnora's data boundaries, migration behavior, and the application steps responsible for tenant isolation.

《WeKnora 深度技术解析》第 5 章 数据底座:多租户模型、仓储与迁移

本章基于 WeKnora v0.9.0 的 PostgreSQL 与 SQLite 双迁移历史。所有表名、字段与索引均可在 migrations/ 与 internal/types/ 中对照。

WeKnora 的功能看起来是“上传文档、检索、问答、Agent、Wiki”,但在这些能力之下,真正决定系统边界的是数据模型:哪些数据属于谁、以什么粒度隔离、哪些是事实来源、哪些只是派生索引、升级时如何演进。本章不讨论具体业务算法,而是把数据库这一层拆开,回答四个问题:

  • 多租户在表结构、查询和上下文里分别怎样落地;
  • 关系库与向量索引之间是什么关系,谁是权威、谁可重建;
  • 仓储层提供了什么抽象,又刻意不提供什么保证;
  • 迁移体系如何在 PostgreSQL 与 SQLite 两条历史上演进,失败时会发生什么。

后面的知识生命周期、检索、Agent 章节都会反复引用这里的表与约束。如果这一层理解错了,后面的很多“偶发问题”会被误判成算法问题。

Some source content is omitted. Continue reading on the original site.

#WeKnora#PostgreSQL#SQLite#GORM#golang-migrate

Original · 40 min readRead the original
Group chat

No comments yet. Start the conversation.