Files
nexus/wiki/entities/Yjs.md
2026-05-03 05:42:12 +08:00

39 lines
1.1 KiB
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: "Yjs"
type: entity
tags: []
last_updated: 2026-03-05
---
## Identity
**Type:** Product产品/开源库)
**Source:** [[nexus-spatial-discovery]]
## Definition
Yjs 是 [[Nexus Spatial]] 采用的协作引擎——基于 CRDTConflict-free Replicated Data Types无冲突复制数据类型的实时协同编辑库用于多用户空间协作场景下的冲突无关并发编辑。
## Why CRDT for Spatial Collaboration
传统 OTOperational Transform方案在高延迟、离线编辑场景下存在冲突风险。CRDT 的优势:
| 特性 | OT | CRDT (Yjs) |
|------|-----|-------------|
| 离线编辑 | 需要复杂补偿 | 天然支持 |
| 节点延迟容忍 | 低 | 高 |
| 实现复杂度 | 高 | 中 |
| 网络分区恢复 | 困难 | 自动 |
## 在 Nexus Spatial 中的应用
- 多用户同时编辑 3D 节点图
- 实时协作状态同步WebRTC P2P
- 无需中心服务器协调——去中心化协作
- 支持 100+ 并发协作者(无写入冲突)
## Connections
- [[Nexus-Spatial]] ← 协作引擎
- [[Command-Theater]] ← 协作界面