High-frequency Double One-Way asymmetric database synchronization — the SymmetricDS replacement with no triggers and no JVM: cursor-based polling over masked views, positional catalog with schema versioning, hyper-compressed msgpack envelope and idempotent at-least-once delivery. All from config + rules.
sym_* tables that disappear: state is ONE table (speculum_state)The extract_window rule is GENERIC: node, channel, entity, catalog, peer and window size arrive in the scheduled_task payload — a deployment decision, never baked into the package. Any failure (catalog, DB, encode, network, status ≠ 200) leaves the cursor where it was: the next tick retransmits.
The catalog declares, per entity and schema version, the positional map and the per-field coercion. The target resolves (entity_id, schema_version) against ITS copy and reconstructs names+types → a DB deploy bumps the version and both ends coexist (zero-downtime, no schema drift).
no changes — types already optimal
alphanumeric → numeric: compresses amounts/ids stored as text
serializes as text — never truncates leading zeros (BINs, codes)
DATETIME → Int64 UNIX (~24B→8B) with a deterministic UTC inverse (exact round-trip on any host)
the fetch re-reads the cursor edge ($gte) and the tiebreak by PK filters out what was already emitted; full window ⇒ empty tiebreak ⇒ the next tick re-reads the WHOLE edge (may duplicate ONCE, never skips).
the target applies upsert/delete by PK: the duplicate is absorbed. The squash collapses N versions of a PK down to the latest within the window.
every envelope already emits monotonic Offset/WindowSeqID; the receiver knows first/last_offset.
consume ACKs per offset → acked_offset → atomic retransmission from the point of failure. New columns in speculum_state, the wire format does not change.
Speculum reads EXCLUSIVELY through the views: masking happens inside the source engine. Channel B travels separately (updates/config towards the Core) — two independent flows, never a bidirectional link with locks.
All from config + rules over existing directives: @DbFindRowsSorted (range col$op + order + limit), @DbFindRow/@DbInsertRow/@DbUpdateRow, @Concat, @CodecEncode(msgpack), @send and the native scheduler. What was added to the engine —generic and reusable— was engine.function_libs: Lua libraries that travel WITH the compound and whose functions become invocable as @functions from the rules (the positional-codec helpers, with no builtins in the core).
reads updates from ITS OWN database by cursor and emits them as msgpack windows — the host activates it with scheduled_tasks + its connections. Libs are multi-variant: OPTIONAL source + .ljbc/.luac54/.luac55 — the loader picks per runtime; opaque (--no-source) = declaring supported runtimes. Auditable contract: nap variants (supported runtimes) + pack coherence (stale variant = FAIL). Tested on ALL engines (19/19).
receives windows and applies them ATOMICALLY (@DbTx: one bad event = the whole window rolls back and the emitter retransmits)
.napspeculum-common (helpers+catalog+schema) + speculum-reader + speculum-writer, Ed25519 — any AlchemyBridge mounts common + its mode(s) and acquires the sync without recompiling; tampered or unverified does NOT start
each end runs BOTH modes for opposite channels: channel-A reader + channel-B writer next to the Core — and the mirror image on the other side
model: node_tsThe SAME table can receive updates from both sides: origin column mappable per entity (corporate naming rules), (origin, cursor) index in that order, and per-table model (ts default · node_ts · extensible). A later local edit travels again. Tested with two instances and writers on both sides: identical convergence and full quiescence with nothing circulating. The echo is cut; CONFLICTS (same PK edited on both sides at once) are a separate policy.