In the Areas extension (https://lab.civicrm.org/extensions/org.civicoop.areas) an administrator can define areas such as West Coast and a contact living in a city in West Coast is linked to the area West Coast.
Every time an address is updated the linked areas of that contact is also updated.
However we need to have a solution for the use case when an administrator adds or changes an existing Area.
My idea is that a cron job runs every day and queries the contact table and checks contact for contact the linked areas. This would probably work fine a small database but I am worried that this job times out in a large database.
How would a solution look like if the database has for example 1.000.000 records?