Skip to main content

Data Sync & IoT Services

Seamless data synchronization and IoT device management for cloud and edge deployments.

Overview

The Data Sync & IoT Services platform enables seamless operation between cloud and edge deployments, supporting the OlympusEdge architecture. Restaurants can operate fully offline with automatic sync on reconnect.

Business Value

CapabilityBenefit
Offline ResilienceOperate fully offline, auto-sync on reconnect
IoT IntegrationSmart equipment monitoring, sensors
Multi-Location SyncReal-time data across franchise networks
Edge ComputingReduced cloud costs and latency

Architecture

┌─────────────────────────────────────────────────────────────────┐
│ Cloud (GCP Cloud Run) │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Sync Service │ │ IoT Gateway │ │ Device MDM │ │
│ │ (Rust) │ │ (Rust) │ │ (Rust) │ │
│ └────────┬────────┘ └────────┬────────┘ └────────┬────────┘ │
│ │ │ │ │
│ └────────────────────┼────────────────────┘ │
│ │ │
│ ┌───────────┴───────────┐ │
│ │ Cloud Spanner DB │ │
│ └───────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘

┌───────────┴───────────┐
│ Pub/Sub / WebSocket │
└───────────┬───────────┘

┌─────────────────────────────────────────────────────────────────┐
│ Edge (OlympusEdge Server) │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Edge Sync │ │ IoT Hub │ │ Local DB │ │
│ │ Agent │ │ (MQTT) │ │ (SQLite) │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────────┘

Data Sync Engine

Sync Architecture

ComponentLocationPurpose
Sync ServiceCloud (Rust)Centralized sync coordination
Edge Sync AgentEdgeLocal sync management
Sync QueueBothOffline operation queue
Conflict ResolverCloudMerge strategy execution

Sync Flow

Conflict Resolution

StrategyDescriptionUse Case
Last-Write-WinsMost recent timestamp winsSimple updates
Server-WinsCloud always winsCritical data
Client-WinsEdge always winsOffline-first
MergeCombine changesComplex objects
CustomBusiness logicSpecial cases

Sync Configuration

{
"sync_config": {
"interval_seconds": 30,
"batch_size": 100,
"retry_attempts": 5,
"conflict_strategy": "last_write_wins",
"tables": {
"orders": {"priority": "high", "strategy": "server_wins"},
"menu_items": {"priority": "low", "strategy": "server_wins"},
"time_punches": {"priority": "high", "strategy": "merge"}
}
}
}

Sync Status Dashboard

┌─────────────────────────────────────────────────────────────────┐
│ SYNC STATUS All Locations │
├─────────────────────────────────────────────────────────────────┤
│ │
│ LOCATION STATUS │
│ ─────────────────────────────────────────────────────────── │
│ 🟢 Downtown SF Synced 5 sec ago Pending: 0 │
│ 🟢 Oakland Synced 12 sec ago Pending: 0 │
│ 🟡 Phoenix Syncing... Pending: 45 │
│ 🔴 Portland Offline 2 min Pending: 128 │
│ │
│ SYNC METRICS (Last Hour) │
│ ─────────────────────────────────────────────────────────── │
│ Syncs Completed: 4,521 │
│ Records Synced: 89,432 │
│ Conflicts: 12 (0.01%) │
│ Avg Latency: 1.2 sec │
│ │
└─────────────────────────────────────────────────────────────────┘

IoT Gateway Service

Supported Devices

Device TypeProtocolData
Temperature SensorsMQTTCooler/freezer temps
Smart ThermostatsMQTTHVAC control
Energy MonitorsMQTTPower consumption
POS TerminalsHTTPTransaction data
PrintersCUPSPrint jobs
CamerasRTSPVideo streams

MQTT Topics

olympus/{tenant_id}/{location_id}/
├── sensors/
│ ├── temperature/{device_id}
│ ├── humidity/{device_id}
│ └── energy/{device_id}
├── equipment/
│ ├── cooler/{device_id}/status
│ ├── oven/{device_id}/status
│ └── hvac/{device_id}/status
├── alerts/
│ └── {severity}/{alert_id}
└── commands/
└── {device_id}/action

Telemetry Ingestion

MetricTarget
Events/Second10,000+
LatencyUnder 100ms
Retention90 days raw, 1 year aggregated

IoT Dashboard

┌─────────────────────────────────────────────────────────────────┐
│ IOT MONITORING Downtown SF │
├─────────────────────────────────────────────────────────────────┤
│ │
│ TEMPERATURE SENSORS │
│ ─────────────────────────────────────────────────────────── │
│ Walk-In Cooler 34°F ✓ (Target: 32-38°F) │
│ Walk-In Freezer -5°F ✓ (Target: -10 to 0°F) │
│ Prep Cooler 36°F ✓ (Target: 32-40°F) │
│ Wine Fridge 55°F ✓ (Target: 50-58°F) │
│ │
│ EQUIPMENT STATUS │
│ ─────────────────────────────────────────────────────────── │
│ 🟢 Oven 1 Running Temp: 425°F │
│ 🟢 Oven 2 Idle Temp: 75°F │
│ 🟢 Fryer 1 Running Oil: 350°F │
│ 🟡 HVAC Cooling Target: 68°F │
│ │
│ ENERGY (Today) │
│ ─────────────────────────────────────────────────────────── │
│ Usage: 245 kWh Cost: $36.75 vs Yesterday: -8% │
│ │
│ ALERTS │
│ ─────────────────────────────────────────────────────────── │
│ ⚠️ Walk-In Cooler door left open >5 min (2 hrs ago) │
│ │
└─────────────────────────────────────────────────────────────────┘

IoT Alerts

warning

Temperature alerts for walk-in coolers and freezers are food safety critical. Failure to respond within 30 minutes may result in health code violations and spoiled inventory. Ensure SMS notification numbers are always current for on-duty managers.

AlertTriggerAction
Temperature HighExceeds thresholdSMS to manager
Temperature LowBelow thresholdSMS to manager
Door OpenOpen >5 minStaff notification
Equipment OfflineNo data >15 minManager alert
Energy Spikeover 150% baselineDashboard alert

Device MDM

Device Lifecycle

Managed Devices

DeviceOSManagement
OlympusEdge ServerLinuxFull MDM
Staff TabletsAndroid/iOSMDM Lite
Kiosk DevicesAndroidKiosk Mode
PrintersEmbeddedConfig only
IoT SensorsEmbeddedFirmware OTA

Device Provisioning

# Device enrollment API
POST /api/v1/mdm/devices/enroll
{
"device_id": "edge-001",
"device_type": "olympus_edge",
"tenant_id": "tenant-123",
"location_id": "loc-456",
"serial_number": "SN123456"
}

# Response
{
"enrollment_token": "ey...",
"config_url": "https://...",
"status": "pending_activation"
}

Remote Management

ActionDescription
Push ConfigUpdate device configuration
Push FirmwareOTA firmware updates
Remote RestartRestart device remotely
Remote WipeFactory reset (tablets)
Lock DeviceDisable lost/stolen device

Edge Sync Agent

Agent Architecture

┌─────────────────────────────────────────────────────────────────┐
│ Edge Sync Agent │
├─────────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │
│ │ Sync Queue │ │ Conflict │ │ Offline Operation │ │
│ │ Manager │ │ Detector │ │ Queue │ │
│ └──────┬──────┘ └──────┬──────┘ └───────────┬─────────────┘ │
│ │ │ │ │
│ ┌──────┴────────────────┴─────────────────────┴─────────────┐ │
│ │ Local SQLite Database │ │
│ └────────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌───────────────────────────┴───────────────────────────────┐ │
│ │ WebSocket / HTTP to Cloud │ │
│ └────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘

Offline Capabilities

FeatureBehavior
Order EntryFull functionality offline
PaymentsQueued for processing
Time ClockLocal recording, sync later
Menu DisplayCached menu data
ReportsLimited to local data

Sync Queue

┌─────────────────────────────────────────────────────────────────┐
│ SYNC QUEUE Portland (Offline)│
├─────────────────────────────────────────────────────────────────┤
│ │
│ QUEUED OPERATIONS: 128 │
│ ─────────────────────────────────────────────────────────── │
│ Orders: 45 (Priority: High) │
│ Payments: 38 (Priority: Critical) │
│ Time Punches: 12 (Priority: High) │
│ Menu Updates: 0 (Priority: Low) │
│ Other: 33 (Priority: Normal) │
│ │
│ QUEUE AGE │
│ ─────────────────────────────────────────────────────────── │
│ Oldest: 2 min ago │
│ Newest: 5 sec ago │
│ │
│ ESTIMATED SYNC TIME: ~45 seconds (when online) │
│ │
│ ⚠️ Offline since 14:32:15 │
│ Last sync: 14:30:42 │
│ │
└─────────────────────────────────────────────────────────────────┘

API Reference

Sync Status

GET /api/v1/sync/status/{location_id}

# Response
{
"location_id": "loc-123",
"last_sync": "2026-01-18T14:35:00Z",
"status": "synced",
"pending_count": 0,
"latency_ms": 1200
}

Force Sync

POST /api/v1/sync/trigger
{
"location_id": "loc-123",
"priority": "high"
}

Device Telemetry

GET /api/v1/iot/devices/{device_id}/telemetry?period=24h

# Response
{
"device_id": "sensor-001",
"readings": [
{"timestamp": "2026-01-18T14:00:00Z", "value": 34.5, "unit": "F"},
{"timestamp": "2026-01-18T14:05:00Z", "value": 34.8, "unit": "F"}
]
}

Best Practices

  1. Prioritize critical data - Orders and payments sync first
  2. Handle conflicts gracefully - Use appropriate merge strategies
  3. Monitor sync lag - Alert on extended offline periods
  4. Test offline scenarios - Verify behavior before deployment
  5. Secure IoT devices - Use device certificates
  6. Plan for scale - Consider sync volume at peak times