14. Flexible Indexing
// index by name
db.blogposts.ensureIndex(
{name: true}
);
// index by tags array
db.blogposts.ensureIndex(
{tags: true}
);
// index by comments authors
db.blogposts.ensureIndex(
{"comments.author": true}
);
Monday, April 2, 2012
15. Replica Sets
• Asynchronous master/slave replication
• Automatic failover
• Automatic recovery
• Consists of two or more nodes
• Automatic primary node election
Monday, April 2, 2012
16. ...Replica Sets
Member 2 Member 1
Read
Member 3
Primary
Read/Write
Client
Monday, April 2, 2012