If we can assume that orders are being introduced with increasing time, then:
You can use Queue with elements that have the time-of-order and order-id properties.
Each new record added to the database is also placed in the Queue .
You can check the item at the beginning of Queue every minute.
When checking an element at the beginning of Queue , if an hour has passed from time-of-order , then search for the record with order-id in the database.
If it is found and has not been updated, send a notification, otherwise remove it from Queue .
source share