Clear my doubt on some question for mongoDB DBA

Hi,

i’m sony and i’m new to this mongodb stuff. i’m a DBA and mostly work with RDBMS/SQL. Need your help to clearly my mind for some of question i had in mind:

  1. i cant find mongodb architecture like i found for oracle architecture, architecture that tell about how mongodb work, the buffer, log wal etc Did mongodb have this arch?

  2. if this mongodb have a metadata collection like in rdbms hv metadata table that i can use to query ?

  3. how to count the collection in database ? mostly in google i only found how to count document in collection.

  4. did mongodb adopt read uncommited concept ? how to make it read committed ?

Many Thanks

Welcome to the MongoDB community @sony_vipassi!

i cant find mongodb architecture like i found for oracle architecture, architecture that tell about how mongodb work, the buffer, log wal etc Did mongodb have this arch?

It depends what level of detail you are looking for.

For some high level info on disk write behaviour, see FAQ: MongoDB Storage. For a more technical dive into architecture, see A Technical Introduction to WiredTiger (MongoDB 3.0) and the Engineering Chalk & Talks sessions on the path to transactions in later versions of MongoDB.

A general difference from RDBMS is that MongoDB tries to have reasonable defaults so you don’t have to do a lot of tuning of database configuration parameters.

After installation (and following the Security Checklist), initial tuning of an on-premise deployment is more focused on your O/S and filesystem settings per the Operations Checklist and Production Notes in the MongoDB documentation.

For a more comprehensive introduction I recommend taking the Free DBA training courses at MongoDB University as they will help with foundational knowledge and some hands-on learning.

if this mongodb have a metadata collection like in rdbms hv metadata table that i can use to query ?

MongoDB does not have the full equivalent of an RDBMS information schema. For example, the information required to interpret a document (field names and types) is embedded in the document format. There is no strict requirement for every document in a collection to have the same fields or field types.

There are commands to list databases, collections, and indexes. There is also some basic metadata stored with databases and collections, but that is typically for configuration and diagnostics. For example, see db.collection.stats() .

Document schema is intentionally flexible, but you can impose rules on data writes (inserts & updates) using Schema Validation.

For a great introduction to data modelling and design patterns (and comparison with RDBMS), please see Data Modeling with MongoDB.

how to count the collection in database ? mostly in google i only found how to count document in collection.

You can use the db.stats() helper in the mongo shell, or call the underlying dbStats command from any MongoDB driver.

did mongodb adopt read uncommited concept ? how to make it read committed ?

The concept of durability in a distributed database is more nuanced than “read committed”. For example, you may wish to confirm that a write has been accepted by a majority of the members of a replica set and will not be rolled back. For more information on read concern and isolation levels please review the documentation on Read Isolation, Consistency, and Recency and Read Concern Levels.

I know that’s a lot of info to digest, but hopefully this addresses your questions and gets you started on the right learning path.

Regards,
Stennie

Hi Stenie,

thanks for the explanation. its great.
*

The concept of durability in a distributed database is more nuanced than “read committed”. For example, you may wish to confirm that a write has been accepted by a [ majority ] of the members of a replica set and will not be rolled back. For more information on read concern and isolation levels please review the documentation on Read Isolation, Consistency, and Recency and Read Concern Levels.

about this i hv read that and because of that i conclude that mongodb is adopt read uncommited and for like guarantee we must use majority. am i right ?

Regards

Hi,

That is correct … and explained further in the two documentation links that you quoted on Read Isolation and Read Concern Levels.

As mentioned in the Read Concern documentation, in MongoDB 4.4+ it is possible to configure a global default read or write concern configuration for a replica set or sharded cluster using the setDefaultRWConcern administrative command.

Regards,
Stennie