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.
https://vixcpp.com/registry/pkg/vix/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.
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.
vix add @vix/edge_app
vix depsgit clone https://github.com/vixcpp/edge_app.gitAdd the include/ directory to your project and ensure dependencies are available.
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 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.
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.
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.
Synchronization can be conditional on network availability:
app.set_network_probe([] {
return true;
});If the probe returns false, synchronization is skipped.
The outbox ensures:
- operations remain durable until acknowledged
- failures keep operations in the queue
- successful operations are removed deterministically
This enables safe offline execution.
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 runtime flow:
- configure edge metadata
- enqueue local operations
- run application logic
- attempt synchronization
- remove acknowledged operations
Example:
app.enqueue(op);
if (network_available())
{
app.flush_outbox();
}| Operation | Complexity |
|---|---|
| enqueue operation | O(1) |
| outbox flush | O(n) |
| edge status snapshot | O(1) |
Edge workloads should remain deterministic and lightweight.
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.
Run:
vix build
vix testTests verify:
- edge metadata
- outbox operations
- synchronization hooks
- edge endpoints
- offline execution behavior
MIT License
Copyright (c) Gaspard Kirira