Research Article

MongoDB and Data Consistency: Bridging the Gap between Performance and Reliability

Authors

  • Mukesh Reddy Dhanagari Manager, Software Development & Engineering, Charles Schwab

Abstract

MongoDB is a popular NoSQL database with high scalability, flexible schema management, and fast data performance. While this is similar to relational databases that require compliance with ACID principles, MongoDB takes an eventual consistency model instead, wherein even the partition tolerance is preferred over the consistency. This paper discusses MongoDB’s placement concerning the CAP theorem; that is, it is a CP (Consistency and Stability) database, and it guarantees data reliability while at the same time, performance bottlenecks could be an issue for MongoDB because it happens on a single node by default when performing reads and writes. Tuning MongoDB for better performance allows one to distribute read operations over secondary nodes and, in turn, reduce the workload on the primary node. This, however, brings eventual consistency as depending on where you request the data from, it might not be completely up to date. The paper presents MongoDB’s replication methods, read/write concerns, sharding strategies, indexing, caching, and concurrency control techniques. MongoDB is a genius in large-scale apps but lacks strict consistency in supporting financial transactions and managing healthcare data. The paper addresses that distributed database environments require adaptive consistency models and AI-driven optimization to bridge the performance and reliability gap.

Article information

Journal

Journal of Computer Science and Technology Studies

Volume (Issue)

6 (2)

Pages

183-198

Published

2024-06-25

How to Cite

Mukesh Reddy Dhanagari. (2024). MongoDB and Data Consistency: Bridging the Gap between Performance and Reliability. Journal of Computer Science and Technology Studies, 6(2), 183-198. https://doi.org/10.32996/jcsts.2024.6.2.21

Downloads

Views

11

Downloads

7

Keywords:

MongoDB, NoSQL Databases, Data Consistency, Eventual Consistency, Performance Optimization