Anyway to understand the internal functioning of the MongoDB Server

Just wanted to know if there was some way how I could understand how mongoDB internally handles queries. I’m not talking about the logs of the queries, but actually how the server handles them.
For ex. if i fire a “find” query, what actual process is taking place (like what functions from files (the source code C++ files) are being called in what order), something like that.
I tried running the source code, but couldn’t figure out how to extract this information. Just wanna understand and learn how it actually works.

Welcome to the MongoDB Community @Sahil_Chawla1 !

There are some READMEs in the relevant MongoDB server source code directories that provide more details on the technical implementation and internals. The ultimate reference would be looking at the source code, but for a starting point on queries see src/mongo/db/query/README.md (Query System Internals).

There will also be some version-specific differences, so you should make sure you are looking at the branch in GitHub (eg v5.0 or v6.0) corresponding to the version of the MongoDB server you are trying to get more insight into.

Regards,
Stennie

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.