Files
nexus/wiki/concepts/Incremental-Updates.md
2026-04-21 00:02:55 +08:00

28 lines
928 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Incremental Updates"
type: concept
tags: [real-time, graph, sync]
last_updated: 2026-04-20
---
## Definition
Incremental Updates增量更新是通过文件监视器和版本控制系统钩子实现图谱实时同步的机制避免全量重建。
## Update Triggers
- **文件监视器**监听文件系统变化create、modify、delete、rename
- **Git Hooks**:在 commit、push 时触发增量更新
- **LSP 通知**textDocument/didChange 事件
## Consistency Requirements
- 原子更新:从不将图谱置于不一致状态
- 边引用验证:所有边必须指向有效节点 ID
- 文件节点优先:符号节点创建前必须存在父文件节点
## Performance Target
- 图谱更新传播到客户端:<500ms
- 内存占用:<500MB典型项目
## Connections
- [[graphd]] ← 实现 ← [[Incremental Updates]]
- [[File Watcher]] ← 触发 ← [[Incremental Updates]]