Whenever a StateVariable gets a new StateVariableValue the associated UserAlertRule's should be evaluated and notifications queued up for all users that have rules.
I believe that each User can have their own AWS SNS topic assigned to them. Then, whenever their user account needs to get a notification we just hit the AWS SNS API with the message and the topic name. Pretty much fire-and-forget. It may make sense to hit the SNS API with an asynchronous worker via something like Sidekiq. That way SNS going down won't crash everything, just delay delivery.
Whenever a StateVariable gets a new StateVariableValue the associated UserAlertRule's should be evaluated and notifications queued up for all users that have rules.
I believe that each User can have their own AWS SNS topic assigned to them. Then, whenever their user account needs to get a notification we just hit the AWS SNS API with the message and the topic name. Pretty much fire-and-forget. It may make sense to hit the SNS API with an asynchronous worker via something like Sidekiq. That way SNS going down won't crash everything, just delay delivery.