diff --git a/draft/reference/metadata.txt b/draft/reference/metadata.txt new file mode 100644 index 00000000000..6ba20cfbc76 --- /dev/null +++ b/draft/reference/metadata.txt @@ -0,0 +1,91 @@ +======== +Metadata +======== + +.. default-domain:: mongodb + +.. index:: metadata +.. _metadata-storage: + +Metadata Storage +---------------- + +MongoDB stores metadata in :term:`collections ` and in +:term:`documents `. MongoDB stores metadata as follows: + +- System metadata for a given :term:`database` is stored in collections + that use the ``system`` :term:`namespace`. For a list of ``system`` + collections and where they are found, see + :ref:`metadata-system-collections` + +- Replication metadata is stored in the ``local`` database, which exists + only on members of :term:`replica sets `. For + descriptions of the collections that store replication metadata, see + :ref:`replica-set-local-database`. + +- Metadata on document structure is stored in the :term:`BSON` format + within the document itself. + +.. index:: collection; internal collections +.. index:: internal collections +.. _metadata-system-collections: + +Internal Collections +-------------------- + +MongoDB creates several internal collections to use for system, +replication, and sharding metadata. They are described in the following +sections in this manual: + +- :ref:`metadata-system-collections` + +- :ref:`replica-set-local-database` + +- :ref:`sharding-internals-config-database` + +.. index:: collection; system +.. index:: system; collections +.. index:: system; namespace +.. index:: namespace; system +.. _metadata-system-collections: + +System Collections +------------------ + +MongoDB stores system information in collections that use the +``system.*`` :term:`namespace`. This namespace is reserved for system +information and should not be used for other collections. + +System collections include collections that are stored directly in the database as well as +collections that are stored in the ``local`` database on a :term:`replica set` member. + +System collections include these collections stored directly in the database: + +.. data:: .system.namespaces + + The :data:`.system.namespaces` collection contains + information about all of the database’s collections. Additional + namespace metadata exists in the ``database.ns`` files and is opaque. + +.. data:: .system.indexes + + The :data:`.system.indexes` collection lists all the + indexes in the database. You add and remove data from this collection + via the :method:`ensureIndex() ` and + :method:`dropIndex() ` + +.. data:: .system.profile + + The :data:`.system.profile` collection stores database + profiling information. For information on profiling, see :ref:`database-profiling`. + +.. data:: .system.users + + The :data:`.system.users` collection stores credentials for + users who have access to the database. For more information on this collection, see + :ref:`security-authentication`. + +System collections also include collections that are stored in the +``local`` database on replica set members, when replication is enabled. +For descriptions of system collections stored in the ``local`` database, +see :ref:`replica-set-local-database`. diff --git a/source/core/replication-internals.txt b/source/core/replication-internals.txt index 80914cb959a..4554c21064f 100644 --- a/source/core/replication-internals.txt +++ b/source/core/replication-internals.txt @@ -10,10 +10,13 @@ normal operation or application development but may be useful for troubleshooting and for further understanding MongoDB's behavior and approach. .. index:: replica set; local database +.. index:: local database +.. index:: database; local +.. index:: namespace; local .. _replica-set-local-database: -The ``local`` Database ----------------------- +Local Database +-------------- The ``local`` database exists on every :program:`mongod` instance and stores replication data specific to that instance. The ``local`` diff --git a/source/core/sharding-internals.txt b/source/core/sharding-internals.txt index 942304b83de..c2b5ce4af5d 100644 --- a/source/core/sharding-internals.txt +++ b/source/core/sharding-internals.txt @@ -513,8 +513,6 @@ When the ``_secondaryThrottle`` is ``true`` for :dbcommand:`moveChunk` or the :term:`balancer`, MongoDB ensure that *one* :term:`secondary` member has replicated changes before allowing new chunk migrations. -.. _sharding-internals-config-database: - Detect Connections to :program:`mongos` Instances ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -536,6 +534,10 @@ a document with a ``msg`` field that holds the string If the application is instead connected to a :program:`mongod`, the returned document does not include the ``isdbgrid`` string. +.. index:: config database +.. index:: database, config +.. _sharding-internals-config-database: + Config Database ---------------