From 1b47c5f72a28aed984fde887eef8c52683b0fb66 Mon Sep 17 00:00:00 2001 From: Shezad Khan Date: Mon, 8 Jul 2024 17:02:24 +0100 Subject: [PATCH] chore: add adr --- docs/decisions/2024-07-08-multiserver | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/decisions/2024-07-08-multiserver diff --git a/docs/decisions/2024-07-08-multiserver b/docs/decisions/2024-07-08-multiserver new file mode 100644 index 0000000..996c2ac --- /dev/null +++ b/docs/decisions/2024-07-08-multiserver @@ -0,0 +1,19 @@ +--- +Date: 2024/07/09 +Authors: @Xopherus, @shezadkhan137 +Status: Accepted +--- + +# Multi-Server Fair Weighted Queues + +## Context + +ZeroFox needs to prioritize messages within SQS queues, especially when services receive data from multiple sources with varying latency requirements. Prioritization is key to meeting SLAs for high-priority messages while ensuring lower-priority messages are not starved. Additionally, we need to dynamically allocate throughput based on message priority to ensure fairness and efficiency. + +## Decisions + +1. Implement an experimental Weighted Fair Queue algorithm as a decorator for the go-msg library (receiver). +This decorator, called `WeightedFairReceiver`, will enable message prioritization based on assigned weights. + +2. Implement a `MultiServer` wrapper around `WeightedFairReceiver`. +This server will consume messages from multiple underlying servers into a single receiver, guaranteeing consumption in proportion to assigned weights.