This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Say we have a "vote" service which handles upvotes and downvotes for a post or comment. We are producing a "total votes" datum that is consumed by the "page" and "comment" services. This datum does not need to be consistent - it can be updated periodically. If a post or comment is receiving a very high volume of votes, we would only want to produce the "total votes" datum periodically. However if it is a low volume, it is fine to send the "total votes" datum at the rate which it is created.
My question is - how would you implement this throttling mechanism? I think the ideal would be to implement it at the service level, before anything is even put on the messaging system. So would you just check the timestamp of the most recent vote for a particular page/comment? There is the edge case where the datum gets throttled during high volume, and then voting suddenly stops - how would the service know it needs to produce that value? I wouldn't want to do some kind of periodic database check either.
Maybe throttling at the message queue level is preferable.... I'm not super experienced with message queue performance and I think letting the message queue handle it would probably be the "least complex" situation. The message queue could just drop all messages that haven't been processed in the queue, besides the most recent one.
Thanks for your help :D
Subreddit
Post Details
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/microservic...