Database Reference
In-Depth Information
A second consequence of using virtual memory mapping is that memory for the
data will be allocated automatically, as needed. This makes it trickier to run the data-
base in a shared environment. As with database servers in general, MongoDB is best
run on a dedicated server.
Finally, it's important to run MongoDB with replication, especially if you're not run-
ning with journaling enabled. Because MongoDB uses memory-mapped files, any
unclean shutdown of a mongod not running with journaling may result in corruption.
Therefore, it's necessary in this case to have a replicated backup available for failover.
This is good advice for any database—it'd be imprudent not to do likewise with any seri-
ous MySQL deployment—but it's especially important with nonjournaled MongoDB.
1.6
Summary
We've covered a lot. To summarize, MongoDB is an open source, document-based
database management system. Designed for the data and scalability requirements of
modern internet applications, MongoDB features dynamic queries and secondary
indexes; fast atomic updates and complex aggregations; and support for replication
with automatic failover and sharding for scaling horizontally.
That's a mouthful; but if you've read this far, you should have a good feel for all
these capabilities. You're probably itching to code. After all, it's one thing to talk
about a database's features, but another to use the database in practice. Fortunately,
that's what you'll be doing in the next two chapters. First, you'll get acquainted with
the MongoDB JavaScript shell, which is incredibly useful for interacting with the data-
base. Then, in chapter 3, you'll start experimenting with the driver, and you'll build a
simple MongoDB-based application in Ruby.
Search WWH ::




Custom Search