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
| Capability | Benefit |
|---|---|
| Offline Resilience | Operate fully offline, auto-sync on reconnect |
| IoT Integration | Smart equipment monitoring, sensors |
| Multi-Location Sync | Real-time data across franchise networks |
| Edge Computing | Reduced 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
| Component | Location | Purpose |
|---|---|---|
| Sync Service | Cloud (Rust) | Centralized sync coordination |
| Edge Sync Agent | Edge | Local sync management |
| Sync Queue | Both | Offline operation queue |
| Conflict Resolver | Cloud | Merge strategy execution |
Sync Flow
Conflict Resolution
| Strategy | Description | Use Case |
|---|---|---|
| Last-Write-Wins | Most recent timestamp wins | Simple updates |
| Server-Wins | Cloud always wins | Critical data |
| Client-Wins | Edge always wins | Offline-first |
| Merge | Combine changes | Complex objects |
| Custom | Business logic | Special 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 Type | Protocol | Data |
|---|---|---|
| Temperature Sensors | MQTT | Cooler/freezer temps |
| Smart Thermostats | MQTT | HVAC control |
| Energy Monitors | MQTT | Power consumption |
| POS Terminals | HTTP | Transaction data |
| Printers | CUPS | Print jobs |
| Cameras | RTSP | Video 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
| Metric | Target |
|---|---|
| Events/Second | 10,000+ |
| Latency | Under 100ms |
| Retention | 90 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.
| Alert | Trigger | Action |
|---|---|---|
| Temperature High | Exceeds threshold | SMS to manager |
| Temperature Low | Below threshold | SMS to manager |
| Door Open | Open >5 min | Staff notification |
| Equipment Offline | No data >15 min | Manager alert |
| Energy Spike | over 150% baseline | Dashboard alert |
Device MDM
Device Lifecycle
Managed Devices
| Device | OS | Management |
|---|---|---|
| OlympusEdge Server | Linux | Full MDM |
| Staff Tablets | Android/iOS | MDM Lite |
| Kiosk Devices | Android | Kiosk Mode |
| Printers | Embedded | Config only |
| IoT Sensors | Embedded | Firmware 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
| Action | Description |
|---|---|
| Push Config | Update device configuration |
| Push Firmware | OTA firmware updates |
| Remote Restart | Restart device remotely |
| Remote Wipe | Factory reset (tablets) |
| Lock Device | Disable 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
| Feature | Behavior |
|---|---|
| Order Entry | Full functionality offline |
| Payments | Queued for processing |
| Time Clock | Local recording, sync later |
| Menu Display | Cached menu data |
| Reports | Limited 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
- Prioritize critical data - Orders and payments sync first
- Handle conflicts gracefully - Use appropriate merge strategies
- Monitor sync lag - Alert on extended offline periods
- Test offline scenarios - Verify behavior before deployment
- Secure IoT devices - Use device certificates
- Plan for scale - Consider sync volume at peak times
Related Documentation
- Edge Infrastructure - OlympusEdge