SurrealDB brings database power to the outermost edge: phones, browsers, IoT gateways, retail kiosks, and anything in between. Deploy the same engine you use in the cloud as a lightweight binary or WebAssembly module.

Pushing every read or write to the cloud introduces latency, drains batteries, and fails when connectivity is patchy.
Traditional embedded stores solve a slice of the problem but force developers to manage separate replication and access-control stacks.
Edge services fail when connectivity drops, breaking user experience and critical operations.
Hand-rolling bespoke stores, replication layers, and API wrappers creates operational overhead.
Same multi-model database, everywhere
Embed SurrealDB in-process with the Rust crate for native apps and services, or connect from edge runtimes over HTTP/WebSocket.
Design offline flows with local storage and app-managed synchronization. Use history/versioning to aid conflict detection and reconciliation.
Mix document, graph, and time-series reads in a single statement to power complex edge applications.
Use SurrealKV (file-backed) for crash-safe local storage, or in-memory for ephemeral workloads.
use surrealdb::{engine::local::{File, Mem}, Surreal}; // In-memory (ephemeral) let db = Surreal::new::<Mem>(()).await?; // Or file-backed (persistent) let db = Surreal::new::<File>("/var/lib/myapp/edge.db").await?;
-- Write logic once DEFINE TABLE reading SCHEMALESS PERMISSIONS FOR create, select WHERE $auth.id = device; INSERT reading CONTENT { device: $auth.id, ts: time::now(), value: fn::get_device_input($auth.id) };
From industrial IoT to mobile field apps, SurrealDB powers edge applications across industries.
-- Industrial IoT: Aggregate sensor data and run safety rules LET $sensor_data = ( SELECT value, ts FROM sensors WHERE device = $device AND ts > time::now() - 1h ); LET $anomaly_score = fn::edge_inference($sensor_data); IF $anomaly_score > 0.8 THEN INSERT INTO alerts { device: $device, severity: "critical", score: $anomaly_score }; END;
Keep checkout lines moving when the store’s WAN link is saturated.
-- Each register runs SurrealDB locally with file-backed storage -- Transactions post locally; application syncs to peers or central when online BEGIN TRANSACTION; INSERT INTO transactions { register: $register_id, items: $cart_items, total: $total_amount, timestamp: time::now() }; -- App-managed sync via HTTP/WebSocket when connectivity is available COMMIT;
Field technicians record inspections and photos in remote areas with offline-first functionality.
-- Store forms, images (as references), and graph links locally INSERT INTO inspections { technician: $user_id, asset: $asset_id, photos: $photo_files, notes: $inspection_notes, location: $gps_coords, timestamp: time::now() }; -- Graph links to assets for relationship queries RELATE inspections:$inspection_id ->inspected-> assets:$asset_id; -- App feels native offline; updates are sent by the app when connectivity returns
Vehicles stream telemetry, require local classification, and must pass compliance audits.
-- SurrealDB runs locally, logging time-series data INSERT INTO telemetry { vehicle: $vehicle_id, speed: $current_speed, engine_temp: $engine_temp, location: $gps_coords, timestamp: time::now() }; -- Optional: call a defined function for local inference or classification LET $classification = fn::vehicle_ai_analysis($telemetry_data); UPDATE telemetry SET classification = $classification WHERE id = $telemetry_id;
Meet regulatory requirements without wrapping your DB in yet another proxy.
Use TLS for data-in-transit security between edge nodes and services. Manage keys and secrets with your platform of choice.
Row- and record-level permissions, roles, and authentication (incl. JWT) are defined in schema and enforced consistently.
With SurrealKV, query historical versions of data for auditing and troubleshooting without external changelog systems.
Keep sensitive data local and sync only the fields you choose. Implement redaction or aggregation in application logic.
Process reads and writes locally to minimize round trips and improve UX.
Reduce network usage with local aggregation and selective synchronization.
Fewer network calls can reduce power consumption on mobile devices.
Consolidate data, queries, and access control to simplify your stack.
Iterate on schema and edge logic together with a single query language.
Use one permission model from edge to core, with optional historical queries for audits.


Start building intelligent applications for the edge with realtime, on-device decision making in one database.