MongoDB Configuration - pcimino/nodejs-restify-mongodb GitHub Wiki

MongoDB

Default Configuration

This demo is using the plain vanilla MongoDB out of the box. The server requires a data directory, runs with no restricted access on port 27017.

Cluster

Setting up a MongoDB cluster can seem intimidating, but it can easily be done on a single machine for testing. The most basic cluster consists of three replica sets, odd numbers of voting replicas are required to ensure there is no deadlock deciding the primary machine. ALl clusters must have one primary, and there are ways to force this or exclude machines, etc. MongoDB Replica Sets.

Mongoose can support multiple Mongo replica sets and multiple connections, if necessary.

TODO

AWS Cloud Configuration

By no means a comprehensive list. But some food for thought. Virtual Private Cloud
TODO

HTTPS Certificates
TODO

Cluster
TODO

Zones and Regions
TODO

Live Backup
TODO

**Sample Architecture By no means the only way to do this. This diagram shows the DNS sitting in front of multiple Regions (probably also assuming some load balancing), each with multiple Availability Zones. Here there are two Nodejs instances, either session management can go through the database (slower but transparent failover) or the load balancer can use sticky sessions to always direct traffic from one IP to the same server.

The MongoDB setup is fairly standard with the primary and a secondary located in the same region, another secondary is in another geographic reagion along with a non-voting delayed backup instance: if data becomes corrupt, operators have an hour to shut things down and use the delayed backup to reseed the other instances.

On top of secure connections and certificates between the Nodejs and MongoDB cluster, everything can be inside a Virtuap Private Cloud. This helps futher isolate MongoDB and other internal network traffic from outside interference.

AWS

Next: User Object Model

Return Home