1

Let's imagine a scenario: When a user posts a message on a blog post, the original author will be notified via a push notification and email.

Should these messages be sent when the user sends the message and let him have a little longer loading time, or should I use a background service to watch the database and do the job without the need of an user? In the case of a background service I would need IAAS instead of PAAS.

2

It sounds like you've set up a false dilemma between slow website responsiveness and fast email notification, but it doesn't have to be that way if you call the background service asynchronously instead of polling the database.

0

This is dependent on your product requirements and your service expectations.

Generally for blocking services that are not required for a page to be created, I would recommend running a background service.

This is in case the push notification or email service is not able to keep up with the load.

If the service were slow to send the messages then the page that initiated the messages will hang.

This is why (I believe) most applications use a queue to process actions like notifications and emails.

It is relatively simple to setup a queue and then use producers/consumers to manage the actions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.