MongoDB's Performance Over RDBMS - MongoDB
MongoDB's Performance Over RDBMS - MongoDB
6 min read • Published Feb 14, 2024 • Updated Feb 14, 2024
MongoDB
https://www.mongodb.com/developer/products/mongodb/mongodb-performance-over-rdbms/ 14/02/24, 7 02 PM
Page 1 of 15
:
Someone somewhere might be wondering why we get superior
performance with MongoDB over RDBMS databases. What is the
secret behind it? I too had this question until I learned about the
internal workings of MongoDB, especially data modeling, advanced
index methods, and Mnally, how the WiredTiger storage engine works.
https://www.mongodb.com/developer/products/mongodb/mongodb-performance-over-rdbms/ 14/02/24, 7 02 PM
Page 2 of 15
:
with these paVerns eWectively.
https://www.mongodb.com/developer/products/mongodb/mongodb-performance-over-rdbms/ 14/02/24, 7 02 PM
Page 3 of 15
:
model \at, tabular, and columnar structures, simple key-value pairs,
text, geospatial and time-series data, or the nodes and edges of
connected graph data structures. The ideal schema design for your
application will depend on its speciMc query paVerns.
https://www.mongodb.com/developer/products/mongodb/mongodb-performance-over-rdbms/ 14/02/24, 7 02 PM
Page 4 of 15
:
Embedding data in a single collection in MongoDB (or minimizing the
number of collections, at least) versus storing in multiple tables in
RDBMS oWers huge performance improvements due to the data
locality which will reduce the data seeks, as shown in the picture
below.
https://www.mongodb.com/developer/products/mongodb/mongodb-performance-over-rdbms/ 14/02/24, 7 02 PM
Page 5 of 15
:
Data locality is the major reason why MongoDB data seeks are faster.
Tabular MongoDB
https://www.mongodb.com/developer/products/mongodb/mongodb-performance-over-rdbms/ 14/02/24, 7 02 PM
Page 6 of 15
:
WiredTiger’s cache and compression
WiredTiger is an open-source, high-performance storage engine for
MongoDB. WiredTiger provides features such as document-level
concurrency control, compression, and support for both in-memory
and on-disk storage.
Cache:
Compression
Compression:
https://www.mongodb.com/developer/products/mongodb/mongodb-performance-over-rdbms/ 14/02/24, 7 02 PM
Page 7 of 15
:
Data compression: WiredTiger supports data compression to reduce
the amount of storage space required. Compressing data can lead to
signiMcant disk space savings and improved I/O performance.
https://www.mongodb.com/developer/products/mongodb/mongodb-performance-over-rdbms/ 14/02/24, 7 02 PM
Page 8 of 15
:
MongoDB, being a NoSQL database, oWers advanced indexing
capabilities to optimize query performance and support eScient data
retrieval. Here are some of MongoDB's advanced indexing features:
Compound indexes
Multikey indexes
Text indexes
Text indexes are suitable for scenarios where users need to perform
https://www.mongodb.com/developer/products/mongodb/mongodb-performance-over-rdbms/ 14/02/24, 7 02 PM
Page 9 of 15
:
text search operations on large amounts of textual data.
Geospatial indexes
Wildcard indexes
Partial indexes
Partial indexes allow you to index only the documents that satisfy a
speciMed Mlter expression. This can be beneMcial when you have a
large collection but want to create an index for a subset of documents
that meet speciMc criteria.
Hashed indexes
https://www.mongodb.com/developer/products/mongodb/mongodb-performance-over-rdbms/ 14/02/24, 7 02 PM
Page 10 of 15
:
TTL (time-to-live) indexes
https://www.mongodb.com/developer/products/mongodb/mongodb-performance-over-rdbms/ 14/02/24, 7 02 PM
Page 11 of 15
:
RDBMS databases stems from its adept handling of data modeling,
advanced indexing methods, and the eSciency of the WiredTiger
storage engine. By tailoring your data model to match application
query paVerns, leveraging MongoDB's optimized document structure,
and harnessing advanced indexing capabilities, you can achieve
enhanced throughput and more eWective workload distribution.
Related
TUTORIAL
https://www.mongodb.com/developer/products/mongodb/mongodb-performance-over-rdbms/ 14/02/24, 7 02 PM
Page 12 of 15
: