Background: Large-scale online examination systems require fast, reliable, and consistent answer storage. Directly writing all answers to the primary database may provide low latency under simple workloads but can create bottlenecks as concurrent transactions increase. Objective: This study analyzes the trade-off between consistency and latency in synchronizing online examination answers using RabbitMQ and PostgreSQL clusters and evaluates artificial intelligence for classifying system conditions. Methods: An experimental quantitative approach was employed by comparing direct-write and asynchronous synchronization scenarios, variations in consumer numbers, consumer failures, and duplicate and out-of-order messages. The evaluated metrics included storage latency, synchronization delay, queue backlog, final answer correctness, and Random Forest classification performance. Results: Direct writing produced lower latency in the VM/laboratory environment, whereas asynchronous synchronization offered better buffering and recovery capabilities. Five consumers maintained low synchronization delays in the 10,000-request scenario. During consumer failure, RabbitMQ retained 5,000 messages and successfully reprocessed them after recovery. The idempotent upsert mechanism maintained final answer correctness when handling duplicate and out-of-order messages. The Random Forest model achieved 77.63% accuracy and a 77.78% F1-score in classifying system conditions. Conclusion: Integrating RabbitMQ, PostgreSQL, idempotency mechanisms, and artificial intelligence can improve the reliability and resilience of large-scale online examination infrastructure while balancing synchronization consistency and latency.
Copyrights © 2026