When performing a scan with a pre-existing database, the application will identify pre-existing devices and update them rather than adding duplicate entries.
Possible Implementation
After polling a device, search the database for a duplicate unique_name.
If found:
Full Replace (preferred): Cascade delete the old entry and add the new one.
Update: Add the device_id of the match to the polled device. Compare each entry and update them.
Concerns
The application may be interested in tracking changes in device state over time. What would be the best way to do that?
Objective
When performing a scan with a pre-existing database, the application will identify pre-existing devices and update them rather than adding duplicate entries.
Possible Implementation
After polling a device, search the database for a duplicate
unique_name
.If found:
device_id
of the match to the polled device. Compare each entry and update them.Concerns
The application may be interested in tracking changes in device state over time. What would be the best way to do that?