Usually, the task “check that something was added” hangs a request for checking MAX (id) and compares the old value with the new one.
If you want to check that something has changed, create a updated_at field for each entry in the database, put an index on it (for performance), check the necessary tables every n-time using the SELECT MAX (updated_at) FROM table query, and if different from the old - do your actions. You can conveniently, for example, show which entries have changed, simply by taking all entries where updated_at is greater than a specific value.
The updated_at field can also be used, as is the case with id, if it is not necessary to split whether a new entry is added or edited. Simply fill it in when adding a record, and not just when updating.
This request will work very quickly due to the device operation of the indices, but if there are many such requests, then it is probably better to somehow give it through an API that would cache the results for a while.
In general, this is the simplest and most appropriate architectural solution , some people create a TRIGGER to update the tables, and if the table is updated, write the date of the last update to another table and compare it with the previous one, someone checks the checksum of the table or the table file.