Edge REST API
Where a REST interface belongs in an edge architecture-and where Banalytics provides the local operating boundary around it.
A REST API is an integration surface, not an edge architecture. It can expose a local device, a model, a business service, or a gateway; the edge design still needs to own source connectivity, lifecycle, data quality, event response, access, and failure behaviour at the physical site.
Use REST where request-response is the right contract
REST over HTTP is a useful boundary for configuration, lookup, bounded command requests, reports, and integrations with business applications. Its strengths are familiar tooling, explicit resources, widely supported security mechanisms, and a request-response mental model. It is not automatically the best transport for high-rate telemetry, real-time media, continuous device state, or a local safety path.
At the edge, REST should be assigned a clear role. An API may sit on an industrial PC beside equipment, inside a gateway, in a local model sidecar, or in an enterprise service. Each location changes latency, reachability, data ownership, and incident response. The central question is not "does this system have an API?" but "which responsibility may depend on that API being available?"
Banalytics is the local orchestration and monitoring layer around such interfaces. It can connect physical sources, run local tasks, retain configured data, create events and actions, monitor the node, and supervise approved helper services. It should not be described as a general-purpose REST API gateway or native OPC UA/REST integration where a specific connector has not been implemented.
Place Banalytics at the physical and operational boundary
| Architecture placement | What Banalytics owns | What the REST interface owns |
|---|---|---|
| On the same edge host as equipment | Local devices, media, tasks, rules, storage, health, dashboard context, and selected delivery. | A local device, gateway, or application API for a bounded resource or service. |
| Beside a local API sidecar | Lifecycle and observability of surrounding physical workflows; supervision of the sidecar process. | Specialist transformation, vendor SDK, model inference, or a custom resource interface. |
| Between field systems and enterprise REST services | Local acquisition, normalisation, event authority, outage behaviour, and smallest useful export. | Enterprise record, workflow, reporting, identity, or cross-site business integration. |
| At a remote-access boundary | Authenticated access to the local environment and controlled visibility of approved resources. | A tested local web or HTTP application, exposed only within its explicit allow-list and compatibility limits. |
This model preserves local autonomy. If an upstream REST service is slow or unavailable, the edge node can continue acquisition, local processing, and the defined event workflow. The remote service receives a delayed, retried, or reconciled outcome according to an explicit contract; it does not become a hidden dependency for every local signal.
Choose a pattern that matches the workload
| Pattern | When it fits | Design boundary |
|---|---|---|
| Local API sidecar | A vendor SDK, research model, or protocol adapter needs its own runtime and exposes a local HTTP interface. | Keep it on localhost or a restricted local network where possible; define health, timeout, schema, and restart rules. |
| Event-to-REST adapter | A selected Banalytics event must create or update an external business record. | Make delivery idempotent; include event ID, source time, retries, failure queue or record, and an acknowledgement policy. |
| REST-to-event adapter | An approved external request should initiate a bounded local workflow. | Validate identity, authorisation, input range, asset state, and expiry before converting a request into an event or action. |
| Operational web interface | Authorised users need a local device or service page without direct inbound exposure. | Use a narrow host allow-list, test compatibility, and do not treat the proxy as a universal browser or reverse proxy. |
| Bulk or asynchronous exchange | Payloads are large, high-rate, or require durable decoupling. | Prefer a message, file, database, or dedicated streaming interface; REST can manage the job rather than carry every sample. |
The Process component is a useful operating boundary for a local API sidecar, bridge, data collector, or AI service. It can start and stop the process tree, capture output or redirect it to files, and run the helper under a named lifecycle. The helper remains its own implementation with its own API contract.
Specify failure behaviour as carefully as the endpoint
A production edge API contract needs more than a path and a JSON example. It should define asset identity, source time, units, schema version, allowed request rate, response semantics, error classes, authentication, authorisation, idempotency, retention, audit requirements, and what happens when either side restarts.
- Use resource identity that survives replacement. Avoid relying only on a transient host address or UI label.
- Separate command request from completion. A
202 Acceptedor TCP response is not proof of a physical outcome; define status and acknowledgement resources. - Carry source time and quality. Arrival time alone cannot distinguish live data, a buffered replay, and a stale measurement.
- Make retries safe. Use idempotency keys or correlation IDs for event-driven delivery and commands.
- Bound resources. Set connection, request, and response-size limits, then expose timeout and backlog conditions as operational signals.
- Version deliberately. Add fields compatibly, publish schema changes, and retain a rollback plan for both client and service.
Keep custom HTTP work explicit and reviewable
Banalytics provides general extension points rather than a claim of a universal built-in REST connector. A small, trusted integration can use Java Action for controlled in-process logic; its documented default imports include common networking APIs. A command-line wrapper can use Command Line Action for a short, bounded call. A larger, long-running or dependency-heavy integration belongs in a separately supervised Process or a purpose-built module.
For local service-to-service data exchange, ZeroMQ Socket or MQTT may be a better fit than HTTP when the workflow is event-driven or throughput-sensitive. The local Banalytics layer can then convert selected service output into events, dashboards, retained records, and approved external delivery through Event Manager. Keep the specialist HTTP service independent from the physical operating workflow wherever possible.
The WebRTC HTTP Proxy has a different role: it opens an agent-reachable trusted HTTP or HTTPS application inside the portal through an authenticated WebRTC connection. It uses allow-lists, limits, and a sandboxed rendering model. It is intended for tested internal administration pages and embedded-device interfaces, not as a transparent REST proxy or general Internet browser.
Do not turn convenience APIs into an uncontrolled control plane
Edge interfaces often sit close to cameras, machinery, buildings, and sensitive local networks. Apply least privilege at each boundary: separate service identities, restrict host reachability, use TLS where the route requires it, store secrets outside source code, log privileged requests, and give read-only integrations no command permission.
A REST request that can affect equipment must be treated as a supervised command workflow. The local control system validates interlocks and current state; Banalytics may coordinate the authorised workflow and expose its result, but it does not replace PLC, DCS, SIS, or other safety authority. For day-to-day operation, observe the node itself through System Monitor so host pressure, storage exhaustion, and runtime faults are visible beside interface errors.
Use a REST boundary when it improves ownership and operability
- Place Banalytics where the physical sources, local tasks, and immediate response need to survive independently.
- Put REST at a bounded service or enterprise boundary, with documented resources and owners.
- Use a local sidecar or gateway for custom REST needs rather than implying unsupported native connectivity.
- Export the smallest useful, contextualised outcome instead of every raw input.
- Exercise disconnection, timeout, restart, duplicate request, and unauthorised-request scenarios before production rollout.
A good edge REST architecture makes each interface replaceable and each failure diagnosable. Banalytics contributes the local operating shell: it keeps the system close to equipment, observable by operators, and independent of the availability of a single remote API.