Quantcast
Channel: dustin – Dustin's Stuff
Viewing all articles
Browse latest Browse all 24

Stacks instead of Queues in Message Routing

$
0
0

What do you do when you’re building a message router that has to send clients both very up-to-date information, and very complete information?  If the outgoing per-client queue is too short, when network congestion happens, messages get dropped.  If it’s too long, clients will get stale data before they get fresh data.  One solution is to replace the outgoing per-client queue with an outgoing per-client stack.  That way, when the client is short on bandwidth, whatever message is currently sent to the client is the most recent one the client hasn’t gotten yet, but when the client has extra bandwidth, they will get backfilled with the data they missed.

A coworker recently told me about this solution, which he’d used in a message router he’d worked with.  It resulted in clients getting much fresher data.  The tradeoffs with this approach are that the client has to be able to handle out-of-order messages, and to differentiate between stale and fresh messages.  For this reason, it might not work for the architecture we were considering using it in, but the idea itself blew my mind.  In a new architecture where you can specify up front that the client has to be able to handle these things, it could improve both the freshness and completeness of the data clients receive.


Viewing all articles
Browse latest Browse all 24

Trending Articles