Skip to content

Commit 72a351e

Browse files
author
Bob Grabar
committed
DOCS-649 migrate metadata wiki page to manual
1 parent 014d90e commit 72a351e

File tree

3 files changed

+100
-4
lines changed

3 files changed

+100
-4
lines changed

draft/reference/metadata.txt

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
========
2+
Metadata
3+
========
4+
5+
.. default-domain:: mongodb
6+
7+
.. index:: metadata
8+
.. _metadata-storage:
9+
10+
Metadata Storage
11+
----------------
12+
13+
MongoDB stores metadata in :term:`collections <collection>` and in
14+
:term:`documents <document>`. MongoDB stores metadata as follows:
15+
16+
- System metadata for a given :term:`database` is stored in collections
17+
that use the ``system`` :term:`namespace`. For a list of ``system``
18+
collections and where they are found, see
19+
:ref:`metadata-system-collections`
20+
21+
- Replication metadata is stored in the ``local`` database, which exists
22+
only on members of :term:`replica sets <replica set>`. For
23+
descriptions of the collections that store replication metadata, see
24+
:ref:`replica-set-local-database`.
25+
26+
- Metadata on document structure is stored in the :term:`BSON` format
27+
within the document itself.
28+
29+
.. index:: collection; internal collections
30+
.. index:: internal collections
31+
.. _metadata-system-collections:
32+
33+
Internal Collections
34+
--------------------
35+
36+
MongoDB creates several internal collections to use for system,
37+
replication, and sharding metadata. They are described in the following
38+
sections in this manual:
39+
40+
- :ref:`metadata-system-collections`
41+
42+
- :ref:`replica-set-local-database`
43+
44+
- :ref:`sharding-internals-config-database`
45+
46+
.. index:: collection; system
47+
.. index:: system; collections
48+
.. index:: system; namespace
49+
.. index:: namespace; system
50+
.. _metadata-system-collections:
51+
52+
System Collections
53+
------------------
54+
55+
MongoDB stores system information in collections that use the
56+
``system.*`` :term:`namespace`. This namespace is reserved for system
57+
information and should not be used for other collections.
58+
59+
System collections include collections that are stored directly in the database as well as
60+
collections that are stored in the ``local`` database on a :term:`replica set` member.
61+
62+
System collections include these collections stored directly in the database:
63+
64+
.. data:: <database>.system.namespaces
65+
66+
The :data:`<database>.system.namespaces` collection contains
67+
information about all of the database’s collections. Additional
68+
namespace metadata exists in the ``database.ns`` files and is opaque.
69+
70+
.. data:: <database>.system.indexes
71+
72+
The :data:`<database>.system.indexes` collection lists all the
73+
indexes in the database. You add and remove data from this collection
74+
via the :method:`ensureIndex() <db.collection.ensureIndex()>` and
75+
:method:`dropIndex() <db.collection.dropIndex()>`
76+
77+
.. data:: <database>.system.profile
78+
79+
The :data:`<database>.system.profile` collection stores database
80+
profiling information. For information on profiling, see :ref:`database-profiling`.
81+
82+
.. data:: <database>.system.users
83+
84+
The :data:`<database>.system.users` collection stores credentials for
85+
users who have access to the database. For more information on this collection, see
86+
:ref:`security-authentication`.
87+
88+
System collections also include collections that are stored in the
89+
``local`` database on replica set members, when replication is enabled.
90+
For descriptions of system collections stored in the ``local`` database,
91+
see :ref:`replica-set-local-database`.

source/core/replication-internals.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ normal operation or application development but may be useful for
1010
troubleshooting and for further understanding MongoDB's behavior and approach.
1111

1212
.. index:: replica set; local database
13+
.. index:: local database
14+
.. index:: database; local
15+
.. index:: namespace; local
1316
.. _replica-set-local-database:
1417

15-
The ``local`` Database
16-
----------------------
18+
Local Database
19+
--------------
1720

1821
The ``local`` database exists on every :program:`mongod` instance and
1922
stores replication data specific to that instance. The ``local``

source/core/sharding-internals.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,6 @@ When the ``_secondaryThrottle`` is ``true`` for :dbcommand:`moveChunk`
513513
or the :term:`balancer`, MongoDB ensure that *one* :term:`secondary`
514514
member has replicated changes before allowing new chunk migrations.
515515

516-
.. _sharding-internals-config-database:
517-
518516
Detect Connections to :program:`mongos` Instances
519517
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
520518

@@ -536,6 +534,10 @@ a document with a ``msg`` field that holds the string
536534
If the application is instead connected to a :program:`mongod`, the
537535
returned document does not include the ``isdbgrid`` string.
538536

537+
.. index:: config database
538+
.. index:: database, config
539+
.. _sharding-internals-config-database:
540+
539541
Config Database
540542
---------------
541543

0 commit comments

Comments
 (0)