Subset Pattern - What RAM are the documents located in?

Is it the RAM on the MongoDB server side? Or the RAM on the application side?

Also, how is it determined that certain documents should be in RAM while others should be on disk?

Hi @Big_Cat_Public_Safety_Act

I’m not sure I fully understand the question. Are you talking about the MongoDB server or an application that’s connected to it?

I cannot say about any application, but for the MongoDB server itself, a document primarily resides on disk. If requested (e.g. by a query), the selected documents will be loaded from disk into the WiredTiger cache to be processed and returned to the client. The WiredTiger cache itself would contain the most recent requested documents, and the oldest content would be replaced by newer content according to the workload.

However please note that the explanation above is an extremely high level description of what’s going on in the server. Details may vary, and this is a subject of much technical details.

Please see FAQ: MongoDB Storage for more information.

Best regards