8. #MDBlocal
What did I learn?
● People like dresses
● People LOVE sharing opinions
● The web servers and MySQL were not efficient
● MongoDB withstood the traffic
● MongoDB was perfect for voting app
14. #MDBlocal
OK, so what is MongoDB?
MongoDB is a cross-platform and open-source
document-oriented database, a kind of NoSQL
database. As a document database, MongoDB
shuns the relational database's table-based
structure to adapt JSON-like documents that
have dynamic schemas which it calls BSON.
15. #MDBlocal
OK, so what is MongoDB?
● Written in C++, C and JavaScript.
● Source and binary packages available for
download on mongodb.com/download
● Affero GPL License
● Ready for Cloud or Bare Metal Environments
16. #MDBlocal
OK, so what is MongoDB?
MongoDB was written to make it simple to store data.
{"Key": "Value"}
Create dynamic schemas for your data.
Model your data based on your app.
17. #MDBlocal
More than just key-value
var LocationSchema = new Schema({
name: String,
loc: {
type: [Number], // [<longitude>, <latitude>]
index: '2d' // create the geospatial index
}
});
Create dynamic schemas for your data.
Model your data based on your app.
27. #MDBlocal
Rich data similar to JSON
● Binary serialization JSON data representation!
● Easier to transfer than text files.
● Lightweight, transversable, efficient.
32. #MDBlocal
Indexes
Indexes support the efficient execution of queries in
MongoDB.
Without indexes, MongoDB must perform a collection scan
(Look at every doc for results)
34. #MDBlocal
Aggregation Pipeline
A framework for data aggregation modeled on the concept of
data processing pipelines.
Documents enter a multi-stage pipeline that transforms the
documents into aggregated results.
36. #MDBlocal
Aggregation Pipeline
Reduce the CPU cycles in processing your app, let MongoDB
handle aggregation.
Results produced from aggregation lower in total byte size
than your data, saving bandwidth.
37. #MDBlocal
Collection of Zip Code Data : Data Model
{
"_id": "10280",
"city": "NEW YORK",
"state": "NY",
"pop": 5574,
"loc": [
-74.016323,
40.710537
]
}
40. #MDBlocal
Replica Sets
A replica set in MongoDB is a group of mongod processes that
maintain the same data set
Replica sets provide redundancy and high availability, and are
the basis for all production deployments.
46. #MDBlocal
Sharding - Increase throughput through distribution
Sharding is a method for distributing data across multiple
machines.
MongoDB uses sharding to support deployments with very
large data sets and high throughput operations.
55. #MDBlocal
The smartest and easiest way to run MongoDB!
● Elastic MongoDB Service in Cloud
● Secure by default
● VPC peering for AWS
● Performance tools
● Point-in-time restores
● Monitoring and Alerting
● Real-time performance metrics
56. #MDBlocal
The smartest and easiest way to run MongoDB!
● Three node replica set, default!
● Self Healing
● Redundant (Multi-AZ)
59. #MDBlocal
Backups and Disaster Recovery
● Snapshots every 6 hours
● Point-in-time backup of replica
● Pay-as-you-go
● Set up at any time
● Queryable Backup without full restore
● Replicas are for redundancy, not data
recovery
65. #MDBlocal
Live migration tools
● Just provide details on where your data is
● Cutover window provided by tailing oplog live
● Reduced downtime over manual import
● Support directly from MongoDB team