IoT Architecture Overview
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ IoT Devices โ
โ (Sensors, Trackers, Actuators, Gateways) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
MQTT / AMQP
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Message Broker โ
โ (EMQX, Mosquitto, RabbitMQ) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโผโโโโโโโโ โโโโโโโโโโโผโโโโโโโโโโ โโโโโโโโโผโโโโโโโโ
โ Processing โ โ Time-Series โ โ Alerting โ
โ Workers โ โ Database โ โ Service โ
โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโผโโโโโโโโโโ
โ API Layer โ
โ (FastAPI) โ
โโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโผโโโโโโโโโโ
โ Dashboard โ
โ (React) โ
โโโโโโโโโโโโโโโโโโโโโ
|
IoT Data Pipeline
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| # High-throughput sensor ingestion
from influxdb_client import InfluxDBClient, WriteOptions
from paho.mqtt import client as mqtt
class SensorPipeline:
def __init__(self):
self.influx = InfluxDBClient(
url=config.INFLUX_URL,
token=config.INFLUX_TOKEN
)
self.write_api = self.influx.write_api(
write_options=WriteOptions(
batch_size=1000,
flush_interval=1000 # 1 second
)
)
def on_message(self, client, userdata, msg):
# Parse topic: sensors/{device_id}/{measurement}
parts = msg.topic.split('/')
device_id = parts[1]
measurement = parts[2]
point = Point(measurement) \
.tag("device", device_id) \
.field("value", float(msg.payload)) \
.time(datetime.utcnow())
self.write_api.write(
bucket="sensors",
record=point
)
|
IoT Protocols I Work With
| Protocol | Use Case | Characteristics |
|---|
| MQTT | Sensors, telemetry | Lightweight, pub/sub, QoS levels |
| AMQP | Enterprise IoT | Reliable, transactional |
| CoAP | Constrained devices | UDP-based, REST-like |
| WebSocket | Real-time dashboards | Bidirectional, browser-native |
| HTTP | Device APIs | Simple, stateless |
Technologies for IoT
- Message Brokers: EMQX, Mosquitto, RabbitMQ
- Streaming: Kafka, Kinesis
- Time-Series: InfluxDB, TimescaleDB, QuestDB
- Processing: Python, Node.js, Go
- Dashboards: Grafana, React, custom
- Cloud: AWS IoT, GCP IoT, Azure IoT Hub
Device Management Patterns
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| class DeviceManager:
async def provision(self, device_info: DeviceInfo) -> Device:
# Generate unique credentials
credentials = self.generate_credentials(device_info)
# Register in database
device = await self.db.create_device(
id=device_info.id,
type=device_info.type,
credentials_hash=hash(credentials)
)
# Configure broker ACL
await self.broker.add_acl(
device.id,
topics=[f"devices/{device.id}/#"]
)
return device
async def heartbeat(self, device_id: str):
# Update last seen
await self.db.update_device(
device_id,
last_seen=datetime.utcnow()
)
# Check if was offline
if await self.was_offline(device_id):
await self.alerts.device_online(device_id)
|
Frequently Asked Questions
What is IoT backend development?
IoT backend development involves building server-side systems that collect, process, and analyze data from connected devices. This includes device management, real-time data ingestion, time-series storage, alerting, and integration with analytics platforms.
How much does IoT backend development cost?
IoT backend development typically costs $110-160 per hour. A basic device management platform starts around $30,000-60,000, while enterprise IoT platforms with real-time analytics, edge computing, and millions of devices range from $100,000-400,000+.
What protocols do you work with for IoT?
I implement: MQTT (most common for IoT), HTTP/REST for less frequent communication, CoAP for constrained devices, WebSockets for real-time updates, and gRPC for high-performance scenarios. MQTT is usually the best choice for device-to-cloud communication.
How do you handle IoT data at scale?
I implement: time-series databases (TimescaleDB, InfluxDB), Kafka for streaming, downsampling for historical data, edge processing to reduce bandwidth, and efficient batching. IoT data volume can be massive, architecture must handle scale from day one.
Do you work with AWS IoT or Azure IoT?
Yes. I use managed IoT platforms when appropriate: AWS IoT Core, Azure IoT Hub, Google Cloud IoT. These provide device management, secure communication, and integration with cloud services. For more control or cost optimization, I build custom solutions.
Experience:
Case Studies:
Related Technologies: Python, Kafka, RabbitMQ, PostgreSQL, Docker/Kubernetes, GCP