Skip to content

14.7 Messaging, Priority Queues & SQS/Kafka ​

1. Queue Architecture & Semantics ​

2. Message Brokers Comparison ​

FeatureDatabase Queue (Current)Apache KafkaAWS SQS FIFORabbitMQ
OrderingStrict Priority + FIFOPartition-orderedStrict FIFOPriority Plugin
PersistenceRelational ACIDAppend-only commit logManaged AWSDisk / Memory
Throughput1,000 jobs/sec100,000+ jobs/sec3,000 jobs/sec20,000 jobs/sec
Ops OverheadZero (same as DB)High (ZooKeeper/KRaft)Zero (Serverless)Moderate

3. Say It Out Loud ​

"Our priority queue segregates incoming traffic into four weight tiers: URGENT, HIGH, NORMAL, and LOW. In queues/dispatcher.py, worker routines query the queue ordering by priority descending. This ensures two-factor authentication codes land at the front of the line even during marketing broadcasts. When scaling to 100,000 messages per second, we migrate this queue state to Apache Kafka partitioned by recipient hash."