Skip to content

How to model batch email sending #7678

Answered by JorgeCandeias
dodyg asked this question in Q&A
Discussion options

You must be logged in to vote

TLDR; Then your idea is a fair starting point. Using a singleton grain that manages the batch work makes it easier to also manage the sending rate and even parallelize it without overflowing the gateway allowance. Keep it simple, make it work, and evolve from there.

Note that sending emails is 99% serialization cost, 1% logic cost or less, so that's what we want to optimize in the Orleans cluster. If the number of emails your system needs to send is low enough to not care about this, then ignore the wall of text below.

Long story:

It will be beneficial if the email gateway you are using will return some known error code with a retry-after header on overflow without banning the sender afte…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by dodyg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants