Klaus Elk Books

IoT - Client or Server?

You are planning an IoT Device. Now, is it implemented as a client or server?

In many cases the device can take on both roles, but one will be dominant. This is an important design decision that should be taken early.

The device as client

IoT Clients
Devices as Clients
Reasons/advantages are: When using e.g. MQTT the sensors/devices publish and subscribe data to each other. Thus they have both a server and client role. The sensors however, normally start by opening an “eternal” TCP to the “broker”. In this way they are technically always TCP-clients.

The device as server

Devices as Servers
Devices as Servers

The overall pattern for an IoT Device - Client or Server

The smallest devices used for e.g. asset tracking or simple sensors emitting a single, rare value now & then are almost always clients.

“Aggregating devices” often act as servers. These devices may be physical boxes/gateways harvesting data from many smaller, separate devices. Alternatively, they may be more advanced equipment, directly giving access to many kinds of information. Based on already delivered data, some remote client decides what it wants to see next, or maybe even which local processing must be performed on the device (think e.g. Industry 4.0).

To keep the cloud-server as a “clean” server, this design may involve a central device that has the role of client towards the IoT-devices, extracting relevant data. This client then delivers the data to the cloud-web-server. This client could run on the same PC as the cloud-server. However, considering server parks etc. this “extractor-client” probably runs on one or several separate PCs. Thus it actively controls the IoT-servers that deliver the data, and hands these over to the big cloud-server.

By keeping the cloud-server as a clean server in both scenarios, it is not a problem to mix the two kinds.

Black Elk

© 2026 KlausElk.com & ElkTronic.dk