Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fred/8780783 to your computer and use it in GitHub Desktop.
Save fred/8780783 to your computer and use it in GitHub Desktop.
  • Zero downtime during upgrades and scaling out system (such as zero seconds downtime, while app still runs)

  • Highly Scalable with Terabytes of data with high performance and low cost with shards

  • Automatic Replica Set member take-over in case of failing primary, with automatic recovery for returning hosts.

  • Automatic promotion to primary and de promotion for any member of a replica set based on performance and latency.

  • Journaling, allows safe recovery in case of hard-disk failure.

  • Strong consistency, "Afford to loose data" in mongoDB is myth. Data is not lost, it's only not persisted due to failures on the developers code.

  • When Sharding is not feasible, different Documents (rails models) can be on different Replica sets (different database or set) altogether, since there are no joins in Mongo.

  • Background indexes.

  • Zero configuration, MongoDB uses as much resources as needed to provide best performance.

=== Backups

  • MMS online backup provided by mongo

For developers

  • easy starting development, easy dump/restore.
  • very flexible data storage with dynamic schema
  • geolocation indexes, spatial queries

=== Example of High Performance server for mongoDB with 15GB of active data

Primary Server:

1x EC2 m3.xlarge, 15GB ram, 4 CPU cores. Cost (1 Year heavy usage) $229/month

Whole database can be fit on the Ram! super fast. But most of the time only 20-40% is required (2-4GB ram)

EBS Partitions:

  • 20GB for Log (delayed log writing)
  • 60GB for Data, + 100 IOPS (delayed writing after journal, fast write)
  • 20GB for Journal, + 200 IOPS (always writing, fastest write)

Secondary Servers:

2x EC2 m1.small, 1 cpu core, 1.7GB ram Cost (1 Year heavy usage) $35/month

  • 20GB for Log
  • 60GB for Data
  • 20GB for Journal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment