Skip to main content

Module edge

Module edge 

Source
Expand description

Edge / geo proxy mode (T3.2).

A HeliosProxy can run in edge mode: it terminates client SQL against a local in-memory cache and only forwards to the home proxy on cache miss. Writes always pass through to home, and home broadcasts invalidations back to every registered edge so cached results don’t go stale on subsequent reads.

§Coherence model — last-write-wins with TTL

  • Reads: edge looks up (query_fingerprint, params) in the local cache. Hit → serve from cache. Miss → forward to home, cache the result with the configured TTL, serve.
  • Writes: edge forwards verbatim. On success, home computes the set of touched-tables (via the analytics fingerprint) and pushes an Invalidate { tables, version } event to every registered edge.
  • Conflict resolution: each cache entry carries a monotonic version (logical wall-clock). An invalidation drops every entry whose version <= invalidation.version. Late writes (clock skew across regions) cannot resurrect stale data.

Edge → Home: HTTP/1.1 with bearer-token auth. Each edge starts up by registering with home (POST /api/edge/register) and holding the response stream open for invalidation events (chunked-transfer Server-Sent Events).

Home → Edge: same connection — home pushes event: invalidate\ndata: {...}\n\n whenever a write commits.

No per-region central registrar, no distributed consensus, no vector clocks. Picks “eventual consistency with bounded staleness” as the explicit contract — readers may see TTL-window stale data on any region after a write to another region.

Re-exports§

pub use cache::CacheEntry;
pub use cache::CacheKey;
pub use cache::EdgeCache;
pub use cache::EdgeCacheStats;
pub use registry::EdgeNode;
pub use registry::EdgeRegistry;
pub use registry::InvalidationEvent;

Modules§

cache
Per-edge query result cache.
registry
Home-side registry of subscribed edges + invalidation broadcast.

Structs§

EdgeConfig
Edge-mode runtime config.

Enums§

EdgeRole