3 ms·
Triggers are synchronous and is not much different than the application updating this value when the underlying data is updated, except for the reliability that
by buckbova 10y ago
Triggers are synchronous and is not much different than the application updating this value when the underlying data is updated, except for the reliability that always when the data is updated the trigger will for sure fire.
Postgres triggers are row by row so depending on your use cases they can be quite slow.
Ideally I'd cache all these values and invalidate the global cache through the application. This would require one set of services or each set of services managing their own cache. Anytime a room is updated, boot and reload the cache for that room.
Let the db stay normalized.