-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
introduction.txt
145 lines (97 loc) · 3.71 KB
/
introduction.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
.. _intro-to-mongodb:
=======================
Introduction to MongoDB
=======================
.. default-domain:: mongodb
.. facet::
:name: genre
:values: reference
.. meta::
:description: Learn about the advantages of MongoDB document databases.
:keywords: atlas
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
You can create a MongoDB database in the following environments:
.. include:: /includes/fact-environments.rst
To learn more about creating a MongoDB database with the Atlas UI,
see :atlas:`Get Started with Atlas </getting-started>`.
Document Database
-----------------
A record in MongoDB is a document, which is a data structure composed
of field and value pairs. MongoDB documents are similar to JSON
objects. The values of fields may include other documents, arrays,
and arrays of documents.
.. include:: /images/crud-annotated-document.rst
The advantages of using documents are:
- Documents correspond to native data types in many programming
languages.
- Embedded documents and arrays reduce need for expensive joins.
- Dynamic schema supports fluent polymorphism.
Collections/Views/On-Demand Materialized Views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MongoDB stores documents in :ref:`collections <collections>`.
Collections are analogous to tables in relational databases.
In addition to collections, MongoDB supports:
- Read-only :doc:`/core/views`
- :doc:`/core/materialized-views`
Key Features
------------
High Performance
~~~~~~~~~~~~~~~~
MongoDB provides high performance data persistence. In particular,
- Support for embedded data models reduces I/O activity on database
system.
- Indexes support faster queries and can include keys from embedded
documents and arrays.
Query API
~~~~~~~~~
The MongoDB Query API supports :ref:`read and write
operations (CRUD) <crud>` as well as:
- :ref:`Data Aggregation <aggregation-pipeline>`
- :ref:`Text Search <text-search>` and :doc:`Geospatial Queries
</tutorial/geospatial-tutorial>`.
.. seealso::
- :doc:`/reference/sql-comparison`
- :doc:`/reference/sql-aggregation-comparison`
High Availability
~~~~~~~~~~~~~~~~~
MongoDB's replication facility, called :doc:`replica set
</replication>`, provides:
- *automatic* failover
- data redundancy.
A :doc:`replica set </replication>` is a group of
MongoDB servers that maintain the same data set, providing redundancy
and increasing data availability.
Horizontal Scalability
~~~~~~~~~~~~~~~~~~~~~~
MongoDB provides horizontal scalability as part of its *core*
functionality:
- :ref:`Sharding <sharding-introduction>` distributes data across a
cluster of machines.
- Starting in 3.4, MongoDB supports creating :ref:`zones
<zone-sharding>` of data based on the :term:`shard key`. In a
balanced cluster, MongoDB directs reads and writes covered by a zone
only to those shards inside the zone. See the :ref:`zone-sharding`
manual page for more information.
Support for Multiple Storage Engines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MongoDB supports :doc:`multiple storage engines
</core/storage-engines>`:
- :doc:`/core/wiredtiger` (including support for
:doc:`/core/security-encryption-at-rest`)
- :doc:`/core/inmemory`.
In addition, MongoDB provides pluggable storage engine API that allows
third parties to develop storage engines for MongoDB.
.. toctree::
:titlesonly:
:hidden:
Get Started </tutorial/getting-started>
Create an Atlas Free Tier Cluster <https://docs.atlas.mongodb.com/getting-started/>
MongoDB Shell (mongosh) <https://www.mongodb.com/docs/mongodb-shell/>
Databases & Collections </core/databases-and-collections>
Documents </core/document>
Query API </query-api>
BSON Types </reference/bson-types>