I am trying to create a web app that allows you to control various devices simultaneously. The simplified design is as follows:
- One main background process continuously polls a database table for any device control requests - Once it sees a request, it spawns two threads: send and receive thread - Send thread periodically polls the commands table - Receive thread updates the responses table - The view basically writes to the commands table and polls the responses table First of all, is this a good design? Should the communication between the threads and the view be through the database (SQLite)? Also, its worth mentioning that there the database is updated quite often since the device is being controlled in real-time.