From e3173c47905f1a84e5c440f04058a4d63ef6fca3 Mon Sep 17 00:00:00 2001 From: Bob Grabar Date: Fri, 2 Nov 2012 17:30:09 -0400 Subject: [PATCH 1/2] DOCS-580 cache FAQ --- source/faq/fundamentals.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/faq/fundamentals.txt b/source/faq/fundamentals.txt index 41b92cecadf..da12787a698 100644 --- a/source/faq/fundamentals.txt +++ b/source/faq/fundamentals.txt @@ -135,6 +135,23 @@ in RAM, MongoDB serves all queries from memory. MongoDB does not implement a query cache: MongoDB serves all queries directly from the indexes and/or data files. +Does MongoDB require a separate object-caching layer? +----------------------------------------------------- + +No. MongoDB integrates databases with object caches such that an +object's representation in the database is very close to its +representation in memory. Retrieval from RAM is a far less expensive +operation for MongoDB than it is for a traditional RDMS. For an RDMS, a +high expense is incurred when data must be transformed into an object +representation when transferred to RAM. + +Additionally, MongoDB's integration of databases with memory means there +is no risk of retrieving stale data from the cache. + +Keep in mind, though, that in MongoDB retrieving from RAM is always +faster than from disk, and it is best to have enough memory to fit all +of your working data set. + What language is MongoDB written in? ------------------------------------ From b0b14677b846a5dc0d3ccc3a636aec7c7b3f68b3 Mon Sep 17 00:00:00 2001 From: Bob Grabar Date: Fri, 2 Nov 2012 19:41:04 -0400 Subject: [PATCH 2/2] DOCS-580 first draft of changes --- source/faq/fundamentals.txt | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/source/faq/fundamentals.txt b/source/faq/fundamentals.txt index da12787a698..1a9f8e9be00 100644 --- a/source/faq/fundamentals.txt +++ b/source/faq/fundamentals.txt @@ -135,22 +135,20 @@ in RAM, MongoDB serves all queries from memory. MongoDB does not implement a query cache: MongoDB serves all queries directly from the indexes and/or data files. -Does MongoDB require a separate object-caching layer? ------------------------------------------------------ - -No. MongoDB integrates databases with object caches such that an -object's representation in the database is very close to its -representation in memory. Retrieval from RAM is a far less expensive -operation for MongoDB than it is for a traditional RDMS. For an RDMS, a -high expense is incurred when data must be transformed into an object -representation when transferred to RAM. - -Additionally, MongoDB's integration of databases with memory means there -is no risk of retrieving stale data from the cache. - -Keep in mind, though, that in MongoDB retrieving from RAM is always -faster than from disk, and it is best to have enough memory to fit all -of your working data set. +Does MongoDB require a separate caching layer for application-level caching? +---------------------------------------------------------------------------- + +No. In MongoDB, a document's representation in the database is similar +to its representation in application memory. This means the database +already stores the usable form of data, making the data usable in both +the persistent store and in the application cache. This eliminates the +need for a separate caching layer in the application. + +This differs from relational databases, where caching data is more +expensive. Relational databases must transform data into object +representations that applications can read and must store the +transformed data in a separate cache. If joins are required that adds to +the overhead. What language is MongoDB written in? ------------------------------------