Edge Computing Deployments
HeliosDB Lite runs at edge sites such as stores, factory floors and vehicles as a single server process: heliosdb-lite start keeps data in a local data directory, serves SQL over the PostgreSQL wire and a REST API on the same machine, and can run in the background with --daemon, so point-of-sale and on-site applications keep working without a round trip to a central database.
Problem Being Solved
Core Problem Statement
The result is either over-provisioned edge hardware (expensive, power-hungry) or under-featured applications that sacrifice critical functionality by relying entirely on cloud connectivity that may be unreliable, high-latency, or unavailable.
Who Suffers Most
Retail Technology Vendors: Point-of-sale systems, inventory management kiosks, and in-store analytics platforms at retail locations require local databases for offline operation (stores cannot afford downtime during internet outages), but traditional databases demand over-provisioned in-store hardware that inflates per-location deployment costs.
Edge AI Application Developers: Computer vision, anomaly detection, and predictive maintenance applications running on edge devices (surveillance cameras, industrial equipment, autonomous vehicles) generate significant local data (video metadata, ML inference results, sensor time-series) that must be stored, queried, and analyzed at the edge before selective sync to cloud. These developers face Hobson's choice: sacrifice data management sophistication by using flat files or embedded key-value stores, or abandon true edge deployment by streaming all data to cloud for processing (bandwidth-prohibitive, latency-unacceptable). The market for edge AI applications is constrained by infrastructure limitations rather than algorithmic capabilities.
Concrete Examples with Code, Config & Architecture
Example 1: Industrial IoT Sensor Network - Factory Deployment
Scenario: Manufacturing facility with 200 sensors (temperature, vibration, pressure) reporting to edge gateway every second.
HeliosDB Lite Configuration (helios-edge.toml):
[database]
data_directory = "/var/lib/helios/data"
listen_address = "0.0.0.0:5432"
max_connections = 10 # Limited for edge environment
# Memory constraints for edge deployment
shared_buffers = "16MB" # Small buffer pool for limited RAM
work_mem = "2MB" # Per-operation memory limit
maintenance_work_mem = "8MB"
# Flash storage optimization (SD card)
wal_level = "minimal" # Reduce write amplification
fsync = true # Ensure durability (important for sensors)
wal_compression = true # Compress WAL to reduce writes
checkpoint_timeout = "30min" # Less frequent checkpoints (reduce writes)
# Direct I/O for flash
direct_io = true # Bypass OS page cache (better for flash)
io_scheduler = "noop" # Simple scheduler for SD cards
# Edge-specific features
[edge]
enable_offline_mode = true
max_offline_duration = "7d" # Buffer 7 days of data if cloud unreachable
sync_interval = "5m" # Sync to cloud every 5 minutes when online
[replication]
# Logical replication to cloud
enabled = true
publication_name = "edge_to_cloud"
publication_tables = ["sensor_readings", "alerts"]
subscriber_host = "cloud-helios.example.com"
subscriber_port = 5432
retry_on_failure = true
max_retry_interval = "1h"
[logging]
log_destination = "syslog" # Forward logs to centralized syslog
log_level = "warning" # Minimal logging to reduce disk writes
Sensor Data Schema:
-- Optimized schema for time-series sensor data
CREATE TABLE sensors (
sensor_id TEXT PRIMARY KEY,
sensor_type TEXT NOT NULL,
location TEXT NOT NULL,
calibration_date TIMESTAMPTZ
);
CREATE TABLE sensor_readings (
id BIGSERIAL PRIMARY KEY,
sensor_id TEXT NOT NULL REFERENCES sensors(sensor_id),
timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW(),
value NUMERIC NOT NULL,
unit TEXT NOT NULL
);
-- Hypertable-style partitioning for time-series (optional)
CREATE INDEX idx_sensor_readings_time ON sensor_readings(timestamp DESC);
CREATE INDEX idx_sensor_readings_sensor ON sensor_readings(sensor_id, timestamp DESC);
-- Local alert detection
CREATE TABLE alerts (
id BIGSERIAL PRIMARY KEY,
sensor_id TEXT NOT NULL,
alert_type TEXT NOT NULL,
severity TEXT NOT NULL,
description TEXT,
triggered_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
acknowledged_at TIMESTAMPTZ,
resolved_at TIMESTAMPTZ
);
-- Aggregated statistics (pre-computed to reduce cloud sync data)
CREATE TABLE sensor_statistics_hourly (
sensor_id TEXT NOT NULL,
hour_bucket TIMESTAMPTZ NOT NULL,
min_value NUMERIC,
max_value NUMERIC,
avg_value NUMERIC,
stddev_value NUMERIC,
sample_count INTEGER,
PRIMARY KEY (sensor_id, hour_bucket)
);
Example 2: Retail Point-of-Sale with Offline Support
Scenario: Retail store with 10 POS terminals requiring local database for offline operation.
Database Schema:
-- POS transaction schema
CREATE TABLE products (
sku TEXT PRIMARY KEY,
name TEXT NOT NULL,
description TEXT,
price NUMERIC(10, 2) NOT NULL,
stock_quantity INTEGER NOT NULL,
last_sync TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE transactions (
transaction_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
register_id TEXT NOT NULL,
employee_id TEXT NOT NULL,
transaction_time TIMESTAMPTZ NOT NULL DEFAULT NOW(),
total_amount NUMERIC(10, 2) NOT NULL,
payment_method TEXT NOT NULL,
synced_to_cloud BOOLEAN DEFAULT false
);
CREATE TABLE transaction_items (
id BIGSERIAL PRIMARY KEY,
transaction_id UUID NOT NULL REFERENCES transactions(transaction_id),
sku TEXT NOT NULL REFERENCES products(sku),
quantity INTEGER NOT NULL,
unit_price NUMERIC(10, 2) NOT NULL,
discount NUMERIC(10, 2) DEFAULT 0
);
CREATE INDEX idx_transactions_sync ON transactions(synced_to_cloud, transaction_time);
Example 3: Fleet Management - Vehicle Edge Computing
Scenario: Delivery fleet vehicles with onboard edge devices processing GPS, diagnostics, and cargo sensors.
HeliosDB Lite Embedded in Vehicle:
[database]
data_directory = "/mnt/emmc/helios"
listen_address = "127.0.0.1:5432" # Local only (vehicle network)
max_connections = 5
# Vehicle-optimized configuration
shared_buffers = "64MB"
work_mem = "4MB"
# Flash storage (eMMC) optimization
direct_io = true
wal_compression = true
checkpoint_timeout = "1h" # Reduce wear on eMMC
# Vehicle power management
[edge.power_management]
enable_low_power_mode = true
idle_timeout = "5m" # Enter low power after 5 min idle
wake_on_insert = true # Wake for new data
[replication]
# Sync to cloud when vehicle returns to depot (WiFi)
enabled = true
sync_on_network_available = true
wifi_ssid_whitelist = ["DEPOT_WIFI_1", "DEPOT_WIFI_2"]
Vehicle Data Schema:
-- GPS tracking
CREATE TABLE gps_positions (
id BIGSERIAL PRIMARY KEY,
timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW(),
latitude NUMERIC(9, 6) NOT NULL,
longitude NUMERIC(9, 6) NOT NULL,
speed_kph NUMERIC(5, 2),
heading INTEGER, -- 0-359 degrees
altitude_meters INTEGER
);
-- Vehicle diagnostics
CREATE TABLE vehicle_diagnostics (
id BIGSERIAL PRIMARY KEY,
timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW(),
engine_temp_celsius INTEGER,
oil_pressure_psi INTEGER,
battery_voltage NUMERIC(4, 2),
fuel_level_percent INTEGER,
odometer_km INTEGER,
error_codes TEXT[]
);
-- Cargo/delivery tracking
CREATE TABLE deliveries (
delivery_id UUID PRIMARY KEY,
pickup_address TEXT NOT NULL,
delivery_address TEXT NOT NULL,
pickup_time TIMESTAMPTZ,
delivery_time TIMESTAMPTZ,
status TEXT NOT NULL,
cargo_weight_kg NUMERIC(8, 2),
signature_image_path TEXT,
gps_at_delivery_lat NUMERIC(9, 6),
gps_at_delivery_lon NUMERIC(9, 6)
);
Vehicle Application (Go):
package main
import (
"context"
"database/sql"
"fmt"
"log"
"time"
_ "github.com/lib/pq"
)
type VehicleEdgeApp struct {
db *sql.DB
vehicleID string
}
func NewVehicleEdgeApp(vehicleID string) (*VehicleEdgeApp, error) {
// Connect to local HeliosDB-Lite on vehicle edge device
db, err := sql.Open("postgres",
"host=localhost port=5432 user=vehicle_app dbname=fleet sslmode=disable")
if err != nil {
return nil, err
}
// Test connection
if err := db.Ping(); err != nil {
return nil, err
}
log.Printf("Vehicle %s connected to local edge database", vehicleID)
return &VehicleEdgeApp{
db: db,
vehicleID: vehicleID,
}, nil
}
func (app *VehicleEdgeApp) RecordGPSPosition(lat, lon, speed, heading float64) error {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
_, err := app.db.ExecContext(ctx,
`INSERT INTO gps_positions (timestamp, latitude, longitude, speed_kph, heading)
VALUES (NOW(), $1, $2, $3, $4)`,
lat, lon, speed, int(heading))
if err != nil {
log.Printf("Failed to record GPS: %v", err)
return err
}
return nil
}
func (app *VehicleEdgeApp) RecordDiagnostics(engineTemp, oilPressure int, batteryVoltage float64, fuelLevel int) error {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
_, err := app.db.ExecContext(ctx,
`INSERT INTO vehicle_diagnostics
(timestamp, engine_temp_celsius, oil_pressure_psi, battery_voltage, fuel_level_percent)
VALUES (NOW(), $1, $2, $3, $4)`,
engineTemp, oilPressure, batteryVoltage, fuelLevel)
if err != nil {
log.Printf("Failed to record diagnostics: %v", err)
return err
}
// Check for alerts (local processing)
if engineTemp > 100 {
log.Printf(" ALERT: Engine temperature high: %d°C", engineTemp)
// Store alert locally, sync to cloud later
}
return nil
}
func (app *VehicleEdgeApp) CompleteDelivery(deliveryID string, lat, lon float64, signaturePath string) error {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
_, err := app.db.ExecContext(ctx,
`UPDATE deliveries
SET delivery_time = NOW(),
status = 'completed',
gps_at_delivery_lat = $2,
gps_at_delivery_lon = $3,
signature_image_path = $4
WHERE delivery_id = $1`,
deliveryID, lat, lon, signaturePath)
if err != nil {
log.Printf("Failed to complete delivery: %v", err)
return err
}
log.Printf(" Delivery %s completed (recorded locally, will sync to cloud)", deliveryID)
return nil
}
func (app *VehicleEdgeApp) GetTodayStats() (map[string]interface{}, error) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
var stats struct {
DistanceKM float64
DeliveriesCount int
AvgSpeedKPH float64
MaxEngineTemp int
}
err := app.db.QueryRowContext(ctx,
`SELECT
(SELECT COALESCE(SUM(ST_Distance(
ST_SetSRID(ST_MakePoint(longitude, latitude), 4326)::geography,
LAG(ST_SetSRID(ST_MakePoint(longitude, latitude), 4326)::geography)
OVER (ORDER BY timestamp)
)) / 1000, 0)
FROM gps_positions
WHERE timestamp >= CURRENT_DATE) as distance_km,
(SELECT COUNT(*)
FROM deliveries
WHERE delivery_time >= CURRENT_DATE) as deliveries_count,
(SELECT AVG(speed_kph)
FROM gps_positions
WHERE timestamp >= CURRENT_DATE) as avg_speed,
(SELECT MAX(engine_temp_celsius)
FROM vehicle_diagnostics
WHERE timestamp >= CURRENT_DATE) as max_engine_temp`).
Scan(&stats.DistanceKM, &stats.DeliveriesCount, &stats.AvgSpeedKPH, &stats.MaxEngineTemp)
if err != nil {
return nil, err
}
return map[string]interface{}{
"distance_km": stats.DistanceKM,
"deliveries_count": stats.DeliveriesCount,
"avg_speed_kph": stats.AvgSpeedKPH,
"max_engine_temp": stats.MaxEngineTemp,
}, nil
}
func (app *VehicleEdgeApp) Run() {
// Simulate vehicle telemetry collection
ticker := time.NewTicker(5 * time.Second)
defer ticker.Stop()
log.Println("Vehicle edge application running...")
for range ticker.C {
// Record GPS position
lat, lon := simulateGPS()
speed := simulateSpeed()
heading := simulateHeading()
app.RecordGPSPosition(lat, lon, speed, heading)
// Record diagnostics
engineTemp := simulateEngineTemp()
oilPressure := simulateOilPressure()
batteryVoltage := simulateBatteryVoltage()
fuelLevel := simulateFuelLevel()
app.RecordDiagnostics(engineTemp, oilPressure, batteryVoltage, fuelLevel)
// Periodic stats
if time.Now().Minute() == 0 { // Every hour
stats, err := app.GetTodayStats()
if err == nil {
log.Printf("Today's stats: %+v", stats)
}
}
}
}
// Simulation functions (replace with actual sensor readings)
func simulateGPS() (float64, float64) {
return 37.7749 + (rand.Float64()-0.5)*0.01, -122.4194 + (rand.Float64()-0.5)*0.01
}
func simulateSpeed() float64 { return 50 + rand.Float64()*30 }
func simulateHeading() float64 { return rand.Float64() * 360 }
func simulateEngineTemp() int { return 80 + rand.Intn(30) }
func simulateOilPressure() int { return 40 + rand.Intn(20) }
func simulateBatteryVoltage() float64 { return 12.5 + rand.Float64()*1.5 }
func simulateFuelLevel() int { return 30 + rand.Intn(70) }
func main() {
app, err := NewVehicleEdgeApp("VEHICLE_042")
if err != nil {
log.Fatalf("Failed to initialize vehicle app: %v", err)
}
defer app.db.Close()
app.Run()
}
Example 4: Remote Site Monitoring - Solar Farms
Scenario: Solar farm installations in remote locations with limited connectivity.
Example 5: Embedded Database in Desktop Application
Scenario: Desktop application (Windows/Mac/Linux) needs embedded database.
Adoption Strategy
Phase 1: Proof of Concept (Weeks 1-4)
Objectives: Validate HeliosDB Lite on target edge hardware; measure resource usage and performance.
Activities: 1. Week 1: Deploy HeliosDB Lite on target edge device (Raspberry Pi, NUC, etc.). Run synthetic benchmarks (TPC-C style) to measure throughput, latency, memory usage. Compare to current solution (SQLite, cloud-dependent, etc.).
Week 2: Implement simple edge application using HeliosDB Lite. Simulate realistic workload (sensor ingestion, local queries, periodic sync). Measure end-to-end latency improvements vs cloud-dependent approach.
Week 3: Test offline operation and sync functionality. Test conflict resolution scenarios.
Week 4: Stress testing on constrained hardware. Run edge application under memory pressure (limited RAM), high write load (stress SD card/eMMC), and concurrent access (multiple processes). Validate stability and performance degradation characteristics.
Phase 2: Pilot Deployment (Weeks 5-12)
Objectives: Deploy to 10-50 edge locations; validate real-world performance and operational characteristics.
Activities: 1. Weeks 5-6: Deploy HeliosDB Lite to 10 pilot edge locations. Monitor resource usage, query performance, sync behavior. Establish baseline metrics.
Weeks 7-8: Expand to 30 locations. Introduce realistic failure scenarios (power cycles, network outages, hardware failures). Validate recovery behavior and data durability.
Weeks 9-10: Scale to 50 locations. Test edge-to-cloud sync at scale (50 devices syncing simultaneously). Measure cloud infrastructure requirements (bandwidth, compute for sync ingestion).
Weeks 11-12: Operational validation. Train operations team on edge database management (monitoring, troubleshooting, updates). Document runbooks and establish support procedures. Conduct post-pilot review.
Phase 3: Full Rollout
Objectives: Scale to full production deployment (100s-1000s of edge locations); optimize for operational efficiency.
Activities: Finalize operational procedures (remote updates, monitoring dashboards, alerting). Begin realizing hardware cost savings at scale.
Weeks 21-24: Optimization phase. Tune edge database configurations per location type (high-traffic vs low-traffic). Implement predictive maintenance (identify failing edge devices before failure). Build self-service tools for edge management.
Ongoing: Continuous improvement. Expand use cases (new edge applications leveraging database). Contribute learnings back to HeliosDB Lite project. Explore edge AI integration (store ML inference results).
Conclusion
Edge computing represents one of the fastest-growing technology markets, driven by requirements for real-time processing, offline operation, bandwidth optimization, and data sovereignty, yet infrastructure constraints—particularly the mismatch between traditional database resource requirements and cost/power-constrained edge hardware—artificially limit the sophistication of edge applications and force organizations into expensive over-provisioning or architectural compromises that sacrifice functionality.
Performance depends on workload and hardware. Published figures are measured on representative fixtures; see the benchmarks page and reproduce them on your own workload.