ESC
Type to search guides, tutorials, and reference documentation.
Verified by Garnet Grid

Edge Computing Architecture

Design edge computing systems. Covers edge deployment patterns, IoT data processing, edge-cloud synchronization, latency optimization, offline-first architectures, and edge ML inference.

Edge computing processes data near the source — on factory floors, in retail stores, on vehicles, in cell towers — instead of sending everything to a centralized cloud. The motivations are concrete: a self-driving car can’t wait 100ms for a cloud API to decide whether to brake. A factory sensor generating 10GB per hour can’t afford the bandwidth costs of streaming to the cloud. A retail kiosk in a dead zone needs to work without internet.

This guide covers the architecture patterns for building edge computing systems that are reliable, secure, and manageable at scale.


Edge Computing Spectrum

         ← Lower latency                    More compute power →

┌──────────┐  ┌──────────┐  ┌────────────┐  ┌──────────────┐
│ Device    │  │ Edge     │  │ Regional    │  │ Cloud         │
│ Edge      │  │ Gateway  │  │ Edge        │  │ (Centralized) │
├──────────┤  ├──────────┤  ├────────────┤  ├──────────────┤
│ Sensors,  │  │ On-prem  │  │ CDN PoPs,  │  │ Full compute │
│ cameras,  │  │ servers, │  │ 5G MEC,    │  │ storage,     │
│ actuators │  │ gateways │  │ wavelength │  │ analytics    │
├──────────┤  ├──────────┤  ├────────────┤  ├──────────────┤
│ < 1ms    │  │ 1-10ms   │  │ 10-50ms    │  │ 50-200ms     │
│ latency  │  │ latency  │  │ latency    │  │ latency      │
└──────────┘  └──────────┘  └────────────┘  └──────────────┘

Edge Deployment Patterns

Pattern 1: Edge Filtering (Process Locally, Send Summaries)

# Industrial IoT: Process sensor data at edge, send only anomalies to cloud
import numpy as np
from collections import deque

class EdgeSensorProcessor:
    def __init__(self, window_size=100, anomaly_threshold=3.0):
        self.readings = deque(maxlen=window_size)
        self.anomaly_threshold = anomaly_threshold
    
    def process_reading(self, sensor_id, value, timestamp):
        self.readings.append(value)
        
        if len(self.readings) < 10:
            return None  # Insufficient data
        
        mean = np.mean(self.readings)
        std = np.std(self.readings)
        z_score = abs(value - mean) / std if std > 0 else 0
        
        if z_score > self.anomaly_threshold:
            # Only send anomalies to cloud (reduces bandwidth 90%+)
            return {
                "type": "anomaly",
                "sensor_id": sensor_id,
                "value": value,
                "z_score": round(z_score, 2),
                "mean": round(mean, 2),
                "std": round(std, 2),
                "timestamp": timestamp,
            }
        
        # Periodically send aggregated summaries (every 5 min)
        return None  # Normal reading, process locally only

Pattern 2: Edge ML Inference

# Deploy lightweight ML model at edge for real-time classification
import onnxruntime as ort
import numpy as np

class EdgeMLInference:
    def __init__(self, model_path="model.onnx"):
        # Load quantized model (INT8 for edge deployment)
        self.session = ort.InferenceSession(
            model_path,
            providers=["CPUExecutionProvider"],
        )
        self.input_name = self.session.get_inputs()[0].name
    
    def predict(self, input_data):
        """Run inference locally — no cloud roundtrip needed."""
        input_array = np.array(input_data, dtype=np.float32)
        result = self.session.run(None, {self.input_name: input_array})
        
        prediction = result[0]
        confidence = float(np.max(prediction))
        
        return {
            "class": int(np.argmax(prediction)),
            "confidence": round(confidence, 4),
            "inference_time_ms": self._last_inference_time,
        }

Pattern 3: Offline-First with Sync

// Edge application that works offline and syncs when connected
class OfflineFirstStore {
  constructor() {
    this.localDB = new IndexedDB("edge-store");
    this.syncQueue = [];
    this.isOnline = navigator.onLine;
    
    window.addEventListener("online", () => this.syncToCloud());
    window.addEventListener("offline", () => this.isOnline = false);
  }
  
  async write(record) {
    // Always write locally first
    const timestamped = {
      ...record,
      _localTimestamp: Date.now(),
      _synced: false,
      _version: crypto.randomUUID(),
    };
    
    await this.localDB.put(timestamped);
    
    if (this.isOnline) {
      this.syncToCloud();
    }
    
    return timestamped;
  }
  
  async syncToCloud() {
    const unsynced = await this.localDB.query({ _synced: false });
    
    for (const record of unsynced) {
      try {
        const result = await fetch("/api/sync", {
          method: "POST",
          body: JSON.stringify(record),
          headers: { "Content-Type": "application/json" },
        });
        
        if (result.ok) {
          record._synced = true;
          await this.localDB.put(record);
        }
      } catch {
        break; // Network issue, retry later
      }
    }
  }
}

Cloud Edge Services

ServiceProviderBest For
AWS IoT GreengrassAWSIoT device management, local Lambda
Azure IoT EdgeAzureIndustrial IoT, containerized modules
GCP Distributed CloudGCPEdge Kubernetes, retail/telecom
AWS WavelengthAWS5G ultra-low latency
Azure Stack EdgeAzureOn-premises AI inference
CloudFlare WorkersCloudflareCDN-edge compute, global distribution

Edge-Cloud Synchronization

PatternLatency ToleranceConsistencyBest For
Eventual syncMinutes to hoursEventually consistentIoT telemetry, logs
Queue-basedSecondsOrdered deliveryTransaction processing
CRDTsVariableAutomatically resolvedCollaborative editing, counters
Change Data CaptureSecondsSequentially consistentDatabase replication

Anti-Patterns

Anti-PatternProblemFix
Cloud-first fallbackEdge device useless without internetDesign offline-first, sync when possible
Sending raw data to cloudBandwidth costs explodeFilter, aggregate, and compress at edge
No remote managementCan’t update edge software remotelyOTA update mechanism from day one
Ignoring securityEdge devices are physically accessibleHardware security modules, encrypted storage
Single edge architectureNot all edges have same constraintsTiered architecture: device → gateway → regional → cloud

Checklist

  • Edge tier defined: device, gateway, regional, or CDN edge
  • Offline-first: application works without cloud connectivity
  • Data filtering: only necessary data sent to cloud
  • ML models optimized for edge (quantized, ONNX)
  • Sync strategy: eventual consistency, conflict resolution defined
  • Remote management: OTA updates, remote diagnostics
  • Security: device identity, encrypted storage, secure boot
  • Monitoring: edge health metrics, sync queue depth
  • Bandwidth budget: edge-to-cloud data transfer limits set
  • Fallback: graceful degradation when edge fails

:::note[Source] This guide is derived from operational intelligence at Garnet Grid Consulting. For edge computing consulting, visit garnetgrid.com. :::

Jakub Dimitri Rezayev
Jakub Dimitri Rezayev
Founder & Chief Architect • Garnet Grid Consulting

Jakub holds an M.S. in Customer Intelligence & Analytics and a B.S. in Finance & Computer Science from Pace University. With deep expertise spanning D365 F&O, Azure, Power BI, and AI/ML systems, he architects enterprise solutions that bridge legacy systems and modern technology — and has led multi-million dollar ERP implementations for Fortune 500 supply chains.

View Full Profile →