A Scalable Transaction Management Framework for Consistent Document-Oriented NoSQL Databases
Adam A. E. Alflahi, Mohammed A. Y. Mohammed, Abdallah Alsammani
TL;DR
The paper tackles the challenge of providing serializable transactions in document-oriented NoSQL databases without sacrificing scalability. It introduces a four-stage middleware framework—Transaction Management, Operation Classification, Readiness (pre-execution conflict detection), and Execution with Adaptive Locking—built atop MongoDB to achieve conflict serializability under BASE semantics, reinforced by timeout-based deadlock prevention. Formal analysis proves conflict serializability and deadlock freedom, with a $O(n \log m)$ cost for conflict detection, while extensive YCSB-based experiments show substantial reductions in abort rates (up to 43.4%), notable tail-latency improvements (P99 down ~34%), and meaningful throughput gains in both single-node and distributed deployments. The results demonstrate that carefully designed consistency mechanisms can significantly improve data integrity and performance in NoSQL systems, offering a practical approach to balancing strong transactional guarantees with scalable operation.
Abstract
NoSQL databases are widely used in modern applications due to their scalability and schema flexibility, yet they often rely on eventual consistency models that limit reliable transaction processing. This study proposes a four-stage transaction management framework for document-oriented NoSQL databases, with MongoDB as the reference platform. The framework combines transaction lifecycle management, operation classification, pre-execution conflict detection, and an adaptive locking strategy with timeout-based deadlock prevention. Formal correctness analysis shows that the proposed approach guarantees conflict serializability under defined conditions. An experimental evaluation using the Yahoo Cloud Serving Benchmark (YCSB) workloads A, B, and F, with concurrency levels ranging from 1 to 100 clients, demonstrates a reduction in transaction abort rates from 8.3% to 4.7%, the elimination of observed deadlocks, and a 34.2% decrease in latency variance. Throughput improvements ranging from 6.3% to 18.4% are observed under high concurrency, particularly for read-modify-write workloads. Distributed experiments on clusters of up to 9 nodes confirm scalability, achieving 15.2% higher throughput and 53% lower abort rates than baseline systems. Comparisons with MongoDB's native transactions, CockroachDB, and TiDB indicate that the proposed framework strikes a good balance between consistency guarantees and performance overhead. Sensitivity analysis identifies optimal parameter settings, including a lock timeout of 100 ms, an initial backoff of 10 ms, and a maximum backoff of 500 ms. These results show that carefully designed consistency mechanisms can significantly improve data integrity in NoSQL systems without undermining scalability.
