Skip to content

DOCS-649 migrate metadata wiki page to manual #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions draft/reference/metadata.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
========
Metadata
========

.. default-domain:: mongodb

.. index:: metadata
.. _metadata-storage:

Metadata Storage
----------------

MongoDB stores metadata in :term:`collections <collection>` and in
:term:`documents <document>`. 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 <replica set>`. 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:: <database>.system.namespaces

The :data:`<database>.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:: <database>.system.indexes

The :data:`<database>.system.indexes` collection lists all the
indexes in the database. You add and remove data from this collection
via the :method:`ensureIndex() <db.collection.ensureIndex()>` and
:method:`dropIndex() <db.collection.dropIndex()>`

.. data:: <database>.system.profile

The :data:`<database>.system.profile` collection stores database
profiling information. For information on profiling, see :ref:`database-profiling`.

.. data:: <database>.system.users

The :data:`<database>.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`.
7 changes: 5 additions & 2 deletions source/core/replication-internals.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down
6 changes: 4 additions & 2 deletions source/core/sharding-internals.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -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
---------------

Expand Down