flip-flop is a MongoDB Replica Set demonstration and experimentation service


MongoDB replica sets provide high availability through replication and automated failover. Here we have a cluster comprising three nodes: replicas “flip” and “flop”, plus an arbiter. Every 60 seconds, the PRIMARY will step down and the cluster will “failover” to the other node. This is a real, running replica set that you can connect to and experiment with. Have fun!

Visualize the replica set election process

 
 
 
Status: Loading...
Next Failover
-
SECONDS

Here's a view from the database server logs:

arbiter's logs   flip's logs   flop's logs
Logs will start streaming when there is replica set activity. Please wait...

Practice writing failover-tolerant client code using flip-flop

The purpose of flip-flop is not only to visually demonstrate the replica set election process, but it is also a means for you to become better at writing client driver connection code. Below is the connection URI for this replica set (note that this replica is running in authentication mode). Can your client/driver code survive failover without any manual intervention?

Example Python application to test and watch replica set connectivity:

Here's a sample application for you to see how a properly configured Python application can gracefully recover from a replica set failover.

Connection URI for the flip-flop replica set:

mongodb://testdbuser:testdbpass@flip.mongolab.com:53117,flop.mongolab.com:54117/testdb?replicaSet=rs-flip-flop
 
Email mLab with questions/comments. © 2017 ObjectLabs Corporation.