My temperature logging project is quite simple, so I understand that HTTP is probably sufficient. However, I have another project in mind that is much larger, and I'd like to know whether my design approach makes sense.
Suppose we're building an employee attendance system for a company with three office branches. Each branch has around 3,000 employees, so the total number of employees is roughly 10,000.
At each office entrance, an employee taps an RFID card to gain access. The hardware consists of an RFID reader, an MCU, an Ethernet interface, and the other required peripherals.
When an employee scans an RFID card, the reader returns only the employee's unique code. The MCU uses this code and creates an attendance record containing the employee ID, employee name, branch name, shift time, and the scan timestamp. This record is then sent to the central office server, where it is stored in a database. Admin, HR, and employees can later view the records through a web dashboard.
When we send sensor data to a server over a WiFi network using TCP/IP. I believe IP and TCP are two different protocols. IP is responsible for connecting devices using IP addresses. Once the connection is established, TCP works on top of IP
Now I'm thinking about the communication architecture and the order in which the protocols are used.
At the physical interface , we have several options, such as Ethernet or Wi-Fi. I would choose Ethernet because I think a wired connection is more secure and generally more reliable than a wireless connection
Once the Ethernet protocol is implemented , the next protocol I would implement is IP, which provides addressing so devices can communicate across the network.
Above IP, I would choose TCP rather than UDP because I don't want to lose attendance records. Although UDP has lower overhead, I think reliability is more important than speed in this application.
Once TCP provides a reliable connection, I then need to choose the application protocol. My current thinking is to use MQTT for sending attendance records from the MCU to the server, while using HTTP for the web dashboard since users will access it through a browser
Does this seem like a reasonable architecture?
This is simply one design approach that came to mind while trying to understand how protocol selection works in IoT applications. I'm not suggesting this is the best or only way to build such a system.
My goal is to check whether my understanding and thought process are on the right track. If I've misunderstood something , I'd really appreciate any corrections. I intentionally chose this larger example because I thought it would be more interesting to discuss the protocol choices and the reasoning behind them than my simple temperature logging project.