Step into MongoDB - Overview I

Humongous, MongoDB = JSON +Index

Features

document/Object/collection oriented, JSON/BSON, Key/Value, fully indexed(object)
Replication & High Availability, Rich Document based Query and Update
auto-sharding(sharding key) & GridFS, Map/Reduce

ReplicaSet

Basically master/slave replication
automatic fail-over to recovery member nodes
consists of two or more nodes that are copies of each other
automatically elects a primary(master) if there is no primary currently available
Distribute read load
arbiter

Monitoring & Diagnostics

  • query profiler
  • Http console
  • mongostat
  • Memory-mapping, keep indexes in memory
  • oplog {ts:{},h{}, op:{},ns:{},o:{},o2:{}}, local, db.oplog.

backup

  • mongoexport, monogoimport
  • mongodump mongorestore
  • data consistency use —oplog
  • use increamental backup
  • read oplog and replay(wordnik tools)

Rollback MongoDB

  • Use snapshot + oplog
  • Use delayed secondary + oplog

Ops

  • Scala up : Vertical
  • Scale out: horizontal / auto sharding
  • build new index in a huge collections

Scenario

  • real time CRUD, web 2.0
  • buffer, persistent buffer
  • big data, web log
  • db cluster

others

no transaction support