Skip to content

vixcpp/edge_app

Repository files navigation

edge_app

Edge-first application runtime for modern C++.

edge_app provides a minimal runtime designed for distributed and edge environments. It extends vix/service_app with primitives required for offline-first execution, store-and-forward synchronization, and low-latency edge deployments.

Header-only. Layered. Deterministic.

Download

https://vixcpp.com/registry/pkg/vix/edge_app

Why edge_app?

Modern systems increasingly run outside centralized data centers:

  • edge nodes
  • local gateways
  • offline-first environments
  • distributed compute nodes
  • IoT aggregation services

These systems require capabilities that typical backend runtimes do not provide:

  • reliable operation without network access
  • local buffering of operations
  • deterministic synchronization
  • store-and-forward data propagation
  • lightweight runtime suitable for edge devices

In many systems these concerns are:

  • implemented ad-hoc
  • tightly coupled with business logic
  • inconsistent across deployments
  • difficult to test in isolation

edge_app provides a minimal edge runtime that standardizes these patterns.

It enables:

  • edge node metadata
  • offline operation queue (outbox)
  • store-and-forward synchronization
  • deterministic edge status endpoints
  • explicit synchronization hooks

No distributed framework required. No message broker required. No cloud dependency.

Just a minimal edge runtime.

Dependency

edge_app depends on:

  • vix/service_app
  • (transitively) vix/api_app
  • (transitively) vix/web_app
  • (transitively) vix/app

Architecture layering:

vix/app
  ↑
vix/web_app
  ↑
vix/api_app
  ↑
vix/service_app
  ↑
edge_app

This ensures:

  • clear infrastructure layers
  • deterministic execution model
  • minimal runtime complexity

Dependencies are installed automatically via Vix Registry.

Installation

Using Vix Registry

vix add @vix/edge_app
vix deps

Manual

git clone https://github.com/vixcpp/edge_app.git

Add the include/ directory to your project and ensure dependencies are available.

Core concepts

Edge metadata

Each edge node exposes basic identity and deployment metadata:

EdgeInfo info;
info.node_id = "edge-1";
info.environment = "production";
info.region = "eu-west";

app.set_edge_info(info);

Endpoint:

  • GET /_edge/info

Example response:

{
  "node": "edge-1",
  "region": "eu-west",
  "environment": "production"
}

Edge status

Edge nodes expose runtime state and queue information.

Endpoint:

  • GET /_edge/status

Example response:

{
  "node": "edge-1",
  "outbox": 3
}

This allows operators to observe synchronization backlog.

Offline operation queue (outbox)

Operations generated while offline are stored locally:

EdgeOperation op;
op.id = "event-1";
op.kind = "put";
op.key = "orders/42";
op.payload = "{...}";

app.enqueue(op);

Operations remain stored until synchronization succeeds.

Store-and-forward synchronization

edge_app allows implementing custom synchronization logic:

app.on_sync([](const std::vector<EdgeOperation>& ops) {

    std::vector<SyncResult> results;

    for (const auto& op : ops)
    {
        // send operation to upstream service
        results.push_back({true, ""});
    }

    return results;
});

Calling:

app.flush_outbox();

will attempt to synchronize queued operations.

Network probe

Synchronization can be conditional on network availability:

app.set_network_probe([] {
    return true;
});

If the probe returns false, synchronization is skipped.

Deterministic synchronization

The outbox ensures:

  • operations remain durable until acknowledged
  • failures keep operations in the queue
  • successful operations are removed deterministically

This enables safe offline execution.

Standard endpoints

edge_app exposes operational endpoints:

Endpoint Purpose
/_edge/info Edge node metadata
/_edge/status Runtime edge status

These endpoints allow orchestration systems to inspect edge nodes.

Typical edge flow

Typical runtime flow:

  1. configure edge metadata
  2. enqueue local operations
  3. run application logic
  4. attempt synchronization
  5. remove acknowledged operations

Example:

app.enqueue(op);

if (network_available())
{
    app.flush_outbox();
}

Complexity

Operation Complexity
enqueue operation O(1)
outbox flush O(n)
edge status snapshot O(1)

Edge workloads should remain deterministic and lightweight.

Design philosophy

edge_app focuses on:

  • deterministic edge execution
  • offline-first reliability
  • explicit synchronization logic
  • minimal runtime overhead
  • embeddable edge services

It does not attempt to replace:

  • distributed databases
  • full replication frameworks
  • streaming platforms
  • service meshes

Those belong to infrastructure layers outside the application runtime.

Tests

Run:

vix build
vix test

Tests verify:

  • edge metadata
  • outbox operations
  • synchronization hooks
  • edge endpoints
  • offline execution behavior

License

MIT License
Copyright (c) Gaspard Kirira

About

Edge-first application runtime for distributed environments. Designed for low-latency deployments, offline-first execution, and edge synchronization workflows.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors