What gets replicated
The cloud does not store a replica of your SQLite file. It stores governed projections you approve column-by-column.
Pipeline stages
1. Application writes (device)
Your application reads and writes a normal SQLite database (source.db). Omega’s module does not require application code changes beyond using SQLite.
2. Capture (device)
On startup thesqlite-replication module:
- Discovers user tables (excludes
sqlite_*and internal__omega_*tables). - Installs
AFTER INSERT/UPDATE/DELETEtriggers that append to__omega_journal(Pipeline B tables). - Computes a schema fingerprint (SHA-256 of canonical column metadata).
event_ts included in an accepted batch. For state tables (Pipeline B), each journal entry records commit_seq, operation, primary key JSON, full row JSON (except deletes), and schema_hash.
3. Publish (device → MQTT)
Every 5 seconds (or when batch size reaches 512 KiB), the module publishes at QoS 1:- Pipeline A:
sync/telemetry/batchwithbatch_id(UUIDv7) and monotonicbatch_seq - Pipeline B:
sync/rows/batchwithbatch_id,journal_epoch, and row operations
org_id, project_id, or device_id in payloads — the broker derives tenant scope from the mTLS session.
4. Broker ingest (cloud)
The MQTT broker:- Authenticates the device (mTLS or username/password).
- Enforces topic ACLs (devices cannot publish on
sync/ingest/control). - Strips any untrusted tenant fields from JSON.
- Publishes to
edge_ingress_exchangewith routing keys for the target pipeline:
Wire details: ilyama edge-client-guide.
5. Edge worker intake (cloud)
The edge worker (not the integration worker) owns all ingest and governance:- Dedupes on
(device_id, batch_id). - Records segment metadata in the batch ledger.
- Upserts a lineage — one row per
(device_id, source_table).
edge_state_* directly.
6. Schema classification (cloud)
When a batch carries a newschema_hash:
Default production policy treats the first schema for a table as ambiguous → schema review required.
On schema miss, both pipelines stage first, then advance governance:
- Pipeline A (telemetry): rows land in
edge_staged_rows, then lineage classification and review queue run. - Pipeline B (rows/batch): paused lineages stage incoming batches with
staging_reason=schema_review; active lineages follow the live materialization path.
pause_lineage for review-only pauses — it keeps publishing while the cloud holds rows.
7. Staging (cloud)
While lineage is paused or materialization is blocked, row bodies are stored inedge_staged_rows (Timescale) with a reason:
Staging is server-side. The device may continue publishing during schema review; the cloud holds rows until you approve.
8. Schema review (operator)
An operator:- Claims the review (
queued→in_review). - Inspects staged sample rows.
- Approves with column actions (
mirror,map,ignore, …) or rejects.
9. Replay and materialization (cloud)
- Replay drains staged rows into the provisioned telemetry or state target.
- Live batches on an active lineage write directly to
edge_ts_*oredge_state_*.
edge_ts_p{project8}_{source_table}. Golain enables Timescale compression on these hypertables with a 1 day compression policy.
10. Downlink control (cloud → device)
When the edge worker needs to pause ingestion, grant a presigned URL, or push cloud-authoritative state, it stagesEdgeIngestControlRequestedV2 on the MQTT downlink exchange. The broker delivers the JSON body on sync/ingest/control at QoS 1.
→ Downlink control
11. Query (operator / product)
Query materialized data via:GET .../edge/lineages/{id}/mirror-rows- platform-tui Written view
- QueryScript against the lineage’s
edge_ts_*hypertable for telemetry
Two kinds of “pause”
Operators often confuse these — they behave differently:
Schema approval sets lineage active in the database but does not automatically send
resume_lineage unless the device was paused by a downlink control message.
→ Backpressure