Global Positioning System Reference
In-Depth Information
MongoDB documents may contain fi eld and value pairs where the value
can be another document, an array of documents or basic types such as Double,
String, and Date.
Data in MongoDB has a schema-free model. Documents within a
collection can be heterogeneous. MongoDB defi nes indexes on a collection
level. Indexes can be created either on a single fi eld or on multiple fi elds.
All MongoDB indexes are implemented as a B-Tree data structure.
Database replication with MongoDB helps to ensure redundancy and
high availability (failover). Replication occurs through groups of servers
known as replica sets. Replica sets are groups of MongoDB nodes; one set
is designated as the primary and the others are designated the secondary
members. The primary node is responsible for writing operations, while the
secondary members replicate data from the primary one asynchronously.
If the primary node fails, one of the secondary members is elected
automatically as a new primary node (automatic failover).
As such, MongoDB is strongly consistent. If clients change the setting
to allow reading in secondary nodes, then MongoDB becomes eventually
consistent where it is possible to read outdated results.
MongoDB supports horizontal scaling via automatic sharding. Sharding
partitions a collection and stores the different parts on different machines.
Sharding automatically implements load balancing across machines in the
cluster.
Applications communicate with MongoDB through a client library or
driver. There are MongoDB drivers available for the following programming
languages: JavaScript, Python, Ruby, PHP, Perl, Java, Scala, C#, C, C++,
Haskell, and Erlang.
MongoDB Geospatial Indexes
MongoDB provides the following geospatial index types to support
geospatial queries: 2D and 2DSphere. Currently, MongoDB does not support
3D geospatial indexing.
The 2D indexes are used for data stored as points on a two-dimensional
plane (Euclidean plane). A 2D index should not be used for data stored
as GeoJSON objects. The 2D index supports calculations on a Euclidean
plane and also distance-only calculations on a sphere, but for geometric
calculations on a sphere, it is necessary to store data as GeoJSON objects
and to use the 2DSphere index type.
The 2DSphere index supports all MongoDB geospatial queries: queries
for inclusion (within), intersection, and proximity to a GeoJSON point. Thus,
MongoDB only supports the following topological functions: within and
intersects. There is no support for analysis functions (buffer, convexHull) or
set functions (union, difference, symDifference).
Search WWH ::




Custom Search