Our web servers (IIS 10) share a common database (SQL Server 2016). They poll some data from the database on a regular interval. When one of the web servers processes a request leading to a change in that data, it will update the database and its own data. But the other web server instances do not know of this data change, thus have old data until the next poll.
How should we instruct the other web server instances to update their data instantly?
Example:
- Database table tblUserRoles stores all roles for all users.
- Web servers poll this list once per day.
- When the admin revokes a user's rights, the web server processing the request knows to update the database and its own UserRoleList immediately.
- But how do the other web servers know to update their UserRoleList?
Possible Solution:
- An internal service maintains a list of all active web server instances.
- When a web server [A] processes a request that changes the data, it updates the database, updates its own data list and requests the active server list [B-Z].
- Web server A invokes data list update for servers B-Z by calling each of them using an internal URL (e.g. /internal/update-user-roles)
- Servers B-Z now update their data by polling data from the database.