I have 20 factory machines all processing tasks. I have a database adapter that talks to a MYSQL database that the machines store all their info in. Is it safe to have each factory machine panel have it’s own database adapter and updater thread? The updater thread just continuously checks to see if the panel’s current taskID is the same as the current in the database and if not it repopulates the panel with information about the new task.
I’m not certain if having too many connections will add overhead or not?
Rather than having many connection all doing same task create one process which maintains the list of taskid (if it is different for all machines) and checks the current taskid in database. if it is changed then send message to all the machines (which has change in their taskid)to update their panels. This will avoid unnecessary load on database and will also handle increase in number of machines without any impact.