数据到底保存在哪里

数据到底保存在哪里

本地保存成功与云端同步完成,是两个不同的结果。 本地优先软件先让内容留在设备上,再把修改送到其他设备。
下面以 NoteDeep Desktop 为例。按“本地保存 → 云端确认 → 完整路径”依次看图,先分清边界,再追数据。
specification { element component { style { color primary } } element storage { style { shape storage; color green } } element boundary { style { color muted } } } model { desktop = boundary '本地设备' { editor = component '笔记编辑器' markdown = storage 'Markdown 正文' sync = component '同步引擎' queue = storage '待提交队列' } cloud = boundary '云端' { sharedb = component 'ShareDB 文档' redis = storage '正文与操作记录' } web = component '另一台设备' desktop.editor -> desktop.markdown '先保存本地' desktop.markdown -> desktop.sync '检测内容变化' desktop.sync -> desktop.queue '持久化待提交修改' desktop.sync -> cloud.sharedb '联网后提交操作' cloud.sharedb -> cloud.redis '持久化' cloud.sharedb -> web '分发已接受的修改' } views { view local { title '01 · 本地保存' include desktop.editor, desktop.markdown, desktop.sync, desktop.queue autoLayout LeftRight } view delivery { title '02 · 云端确认' include desktop.sync, cloud.sharedb, cloud.redis, web autoLayout LeftRight } view complete { title '03 · 完整数据路径' include desktop.*, cloud.*, web autoLayout LeftRight } }

三层数据各做什么

  • Markdown 正文:可直接阅读、编辑的本地内容;断网时也能继续工作。
  • 待提交队列:记录尚未获得云端确认的修改,保存在设备磁盘上;它负责记住还要同步什么,不代替正文。
  • 云端文档与操作记录:保存云端接受的内容与版本,供在线编辑和其他设备读取。
因此,“文件已经写入”只证明本地保存;收到云端确认,才说明对应修改已被云端接受。另一台设备还需要取得这些变化,画面才会更新。

用这个区别判断问题

断网时看不到另一端更新,不等于本地笔记丢失。先查看本地正文,再检查同步状态、登录账号和网络;保留原有文件与同步状态,避免用反复覆盖文件的方式试错。
本页简化了页面树与版本转换,只解释正文主路径。案例依据为 NoteDeep 当前保存与同步实现,核对日期:2026-10-08。