Back to articles
MongoDB Internals: Inside the Storage Engine

MongoDB Internals: Inside the Storage Engine

via Dev.topriteshsurana

Post 3 explained the flow of INSERT and SELECT from PostgreSQL lense. Now its time for insertOne / insertMany and find . MongoDB How MongoDB is different before you start Three major differences from PostgreSQL that we will visit in this section. First, WiredTiger is a separate, pluggable storage engine underneath MongoDB. PostgreSQL's storage is tightly integrated with the query engine. WiredTiger is a standalone embeddable key-value store that MongoDB sits on top of. This matters because WiredTiger has its own caching, its own journal, its own compression, and its own concurrency model, somewhat independent of MongoDB's query layer. Second, documents are stored as BSON — a binary encoding where field names are stored as strings inside every document, on disk, for every document in the collection. PostgreSQL's heap rows contain only values; column names live once in the catalog. BSON's field name overhead matters at scale. Third, MongoDB provides document-level concurrency , implement

Continue reading on Dev.to

Opens in a new tab

Read Full Article
5 views

Related Articles