updated 2026-11-26·8 min read
Dual-Storage Architecture
How Noether pairs plain CommonMark files on disk with an embedded native Rust SQLite WAL index for instant backlinks, graph edges, and full-text search.
Pure Markdown folders slow down once a vault reaches a few thousand notes, because resolving backlinks or running full-text search means scanning files off disk over and over. On the flip side, stuffing everything into a monolithic Postgres or SQLite blob locks your writing inside a binary format you can’t open in VS Code or diff with Git.
Noether splits the two jobs: plain CommonMark .md files on disk stay the single source of truth, and an embedded native Rust SQLite database (.noether/noether.sqlite) acts as a disposable index cache for search, backlinks, and graph queries.
1. Scaling Beyond Thousands of Notes
Scanning raw .md files on every UI action stalls fast once a vault grows:
- Resolving backlinks requires scanning every file on disk for incoming
[[Wikilinks]], which means reading gigabytes of text on a 5,000-note vault. - Rendering the Graph View requires parsing the entire vault before computing a single edge.
- Unindexed full-text search spikes CPU usage and stalls the UI thread.
Putting every note solely inside a database fixes query speed, yet traps your notes inside a binary format you cannot inspect with Unix tools, edit in VS Code, or track cleanly with Git.
Keeping both layers separate gives you readable files and fast queries:
- Local CommonMark Files (
*.md): The permanent source of truth. If Noether crashes, your notes stay intact on disk. - Embedded Rust SQLite Index (
.noether/noether.sqlite): Compiled native SQLite (rusqlitein WAL mode with FTS5) acting as a metadata and block search cache.
If .noether/noether.sqlite is ever deleted or corrupted, Noether walks the Markdown files on disk, re-parses frontmatter, links, tags, and blocks, and rebuilds the SQLite cache without losing any note text.
+-------------------------------------------------------------------------+
| USER INTERFACE |
| TipTap / ProseMirror Live Preview (In-Memory Buffer) |
+-------------------------------------------------------------------------+
|
+----------------------+----------------------+
| |
(Debounced 400ms Flush) (SQLite Cache Sync)
v v
+---------------------------+ +---------------------------+
| FILE SYSTEM TRACK | | SQLITE METADATA TRACK |
| <note>.tmp.<pid> (Atomic)| | rusqlite WAL Mode (Rust) |
| v | | 256MB Memory-Mapped I/O |
| note.md on Disk | | documents, blocks, |
| (Authoritative Truth) | | document_links, tags, |
| | | blocks_fts (FTS5) |
+---------------------------+ +---------------------------+
| |
+----------------------+----------------------+
v
Tauri File System Watcher
(WriteFingerprint Echo Filter)

2. Save Lifecycle
Serializing Markdown ASTs and running SQLite transactions on every keystroke makes typing feel sluggish immediately, so Noether splits keystroke updates from disk writes across three stages:
- Tier 1: In-Memory Mutation (Instant)
ProseMirror transactions update the in-memory editor state immediately without touching disk or SQLite.
- Tier 2: Debounced Disk Write & Index Sync (400ms)
After typing pauses for 400ms (extended to 800ms while actively typing), the serializer produces UTF-8 CommonMark with YAML frontmatter, writes to <note>.tmp.<pid>, renames atomically to note.md, updates SQLite tables, and emits document:saved on the EventBus.
- Tier 3: Idle Secondary Indexing (1200ms)
Heavier vault-wide scans (such as refreshing unlinked mentions and broken embed checks) wait for a 1200ms idle debounce so rapid typing never stutters.
Why Atomic Temp-File Renames Matter
On Windows and macOS, background indexers (Windows Search Indexer, Spotlight) and antivirus scanners briefly lock files when they notice disk writes. Writing directly to note.md with standard truncation while another process holds a handle can fail or leave a 0-byte file.
Noether writes new contents to a process-scoped temporary file (<note>.tmp.<pid>) in the same directory and performs an atomic rename (fs::rename in Rust). The original note stays untouched until the new bytes are flushed.
3. Preventing Self-Write Reload Loops
Because Noether supports editing notes externally in VS Code or pulling changes with Git, the Tauri backend runs a recursive filesystem watcher (notify) over the vault.
When Noether saves a note internally, the OS watcher fires a modification event. Without filtering, that would trigger a reload loop: save note, detect change, reload note, and reset the caret.
Noether filters out its own writes using content fingerprints:
- Register Write Fingerprint
Before renaming <note>.tmp.<pid> onto note.md, Rust calls register_internal_write() to record the canonicalized path, byte size, xxHash3 (xxh3_64) hash, and timestamp in WRITE_FINGERPRINTS.
- Verify Incoming Watcher Events
When the watcher thread receives an OS event, it calls is_internal_echo() to check the file on disk against the stored size and xxHash3 hash (with a 30s cache window and 3-5s transient Windows lock fallback).
- Suppress Internal Echo
If the size and hash match the recorded internal write, the watcher discards the event.
- Emit vault-files-changed for External Edits
If an external tool modified the file, the fingerprint does not match, so Rust emits vault-files-changed to reload the buffer and re-index SQLite.
4. Embedded SQLite Schema
The relational cache sits at .noether/noether.sqlite inside the vault root. Rust opens it with PRAGMA journal_mode = WAL;, PRAGMA mmap_size = 268435456; (256 MB memory-mapped I/O), PRAGMA synchronous = NORMAL;, PRAGMA foreign_keys = ON;, PRAGMA temp_store = MEMORY;, and PRAGMA cache_size = -64000;.
Core tables track documents (hierarchy and frontmatter JSON), blocks (parsed paragraphs and checklists), document_links (wikilink graph edges), document_tags, file_manifest (mtime and content hashes for fast sync), and the blocks_fts FTS5 virtual table.
Core SQLite schema DDL (tables, indexes, and blocks_fts)
-- Document Hierarchy and Metadata
CREATE TABLE IF NOT EXISTS documents (
id TEXT PRIMARY KEY,
parent_id TEXT,
title TEXT NOT NULL DEFAULT 'Untitled',
content_json TEXT NOT NULL DEFAULT '{}',
is_daily_note INTEGER NOT NULL DEFAULT 0,
is_folder INTEGER NOT NULL DEFAULT 0,
is_bookmarked INTEGER NOT NULL DEFAULT 0,
doc_type TEXT NOT NULL DEFAULT 'base',
properties TEXT DEFAULT '{}',
created_at INTEGER NOT NULL,
updated_at INTEGER NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_docs_parent_id ON documents(parent_id);
CREATE INDEX IF NOT EXISTS idx_docs_title ON documents(title);
CREATE INDEX IF NOT EXISTS idx_docs_is_folder ON documents(is_folder);
-- Parsed Blocks & Tasks
CREATE TABLE IF NOT EXISTS blocks (
id TEXT PRIMARY KEY,
document_id TEXT NOT NULL,
parent_block_id TEXT,
content_text TEXT NOT NULL,
block_type TEXT NOT NULL DEFAULT 'paragraph',
order_index REAL NOT NULL,
is_task INTEGER NOT NULL DEFAULT 0,
task_completed INTEGER NOT NULL DEFAULT 0
);
CREATE INDEX IF NOT EXISTS idx_blocks_document_id ON blocks(document_id);
CREATE INDEX IF NOT EXISTS idx_blocks_doc_order ON blocks(document_id, order_index);
CREATE INDEX IF NOT EXISTS idx_blocks_is_task ON blocks(is_task, task_completed);
-- Bidirectional Wikilink Graph Edges
CREATE TABLE IF NOT EXISTS document_links (
source_document_id TEXT NOT NULL,
target_document_id TEXT NOT NULL,
link_text TEXT,
PRIMARY KEY (source_document_id, target_document_id)
);
CREATE INDEX IF NOT EXISTS idx_doc_links_target ON document_links(target_document_id);
-- Tag Associations
CREATE TABLE IF NOT EXISTS document_tags (
document_id TEXT NOT NULL,
tag TEXT NOT NULL,
PRIMARY KEY (document_id, tag)
);
CREATE INDEX IF NOT EXISTS idx_doc_tags_tag ON document_tags(tag);
-- Disk Sync Manifest
CREATE TABLE IF NOT EXISTS file_manifest (
relative_path TEXT PRIMARY KEY,
mtime INTEGER NOT NULL,
size INTEGER NOT NULL,
content_hash TEXT NOT NULL,
indexed_at INTEGER NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_manifest_mtime ON file_manifest(mtime);
-- Full-Text Search Virtual Table
CREATE VIRTUAL TABLE IF NOT EXISTS blocks_fts USING fts5(
block_id UNINDEXED,
document_id UNINDEXED,
content_text,
tokenize = 'unicode61 remove_diacritics 1'
);5. Instant Backlink Resolution
Instead of grepping through every Markdown file in the vault, incoming backlinks resolve through a single indexed query against document_links:
SELECT
d.id,
d.title,
dl.link_text
FROM document_links dl
JOIN documents d ON dl.source_document_id = d.id
WHERE dl.target_document_id = ?
ORDER BY d.updated_at DESC;
When you rename a note from Architecture Ideas to Core Engine Blueprint:
- Noether renames the
.mdfile on disk. - Updates
title = 'Core Engine Blueprint'indocuments. - Rewrites referencing
[[Architecture Ideas]]wikilinks across your other Markdown files and updates their cached rows.
6. Related Architecture Reading
- Systems & Performance Engineering: How debounced saves, view suspension, and Windows working-set trimming keep the UI responsive.
- Events & Relational Storage: How extensions register custom SQLite tables with
this.defineTable()without touching core tables. - Micro-Kernel & Core Isolation: How the host keeps core registries and stores decoupled from extensions.
- Model Context Protocol (MCP) Tools: How local AI assistants query the vault and register custom tools.