Share
Linked In Facebook X (Twitter) Copy
Publication

Replace MongoDB Arbitration Code with TCx Sky Role Code

Share
Linked In
Facebook
Twitter
Copy
Share
banner image

Authors: 
Patricia Hogan, Kip Kirkpatrick

Abstract:
This disclosure proposes a method to enable the use of the MongoDB without needing the minimum of 3 systems that are normally required. If we use MongoDB with replicas for high availability, MongoDB normally requires replicas or arbiter code on at least 3 different machines.  More than 50% of the MongoDB machines need to be up and communicating to vote on which MongoDB replica should be the primary replica. This idea removes the need for a third machine and uses TCx Sky's built in ability to detect which controller has the Master Controller role.

 

Background:
When using MongoDB with replicas for high availability, MongoDB requires replicas or arbiter code on at least 3 different machines.  More than 50% of the MongoDB machines need to be up and communicating to vote on which MongoDB replica should be the primary replica. Needing three machines is a problem when we are using MongoDB in a grocery store where there are only two TCx Sky controllers (servers) and no suitable third machine.  It would be expensive to a grocery chain to add a third server machine or virtual machine (VM) to all its grocery stores.

 

Description:
MongoDB replicas have a master replica and slave replicas. If the master replica goes down, at least two slave replicas or a slave replica and an arbiter replica in a 3-node MongoDB configuration, are needed to vote which remaining replica should become the MongoDB master replica.  This works fine when MongoDB is deployed at a datacenter or in the cloud or on a Kubernetes cluster. This does not work when we are trying to deploy MongoDB as the datastore for a Point-of-sale in-store server in a grocery store  that only has two TCx Sky controllers (servers). There is no third machine where we could install the MongoDB arbiter code.  Even if there was, that machine is not managed by TCx Sky, so we have no way to remotely install the MongoDB arbiter code.  We have no way to remotely update this code if we want to update the MongoDB build/release/version to a newer version.  We have no way to manage this third machine.

MongoDB is open source.  It would be possible to replace the MongoDB arbitration code and parts of the MongoDB replica management code with a new module.  This new module would be TCx Sky specific. MongoDB replicas would only require that MongoDB be installed on TCx Sky controllers.  It would require at least two TCx Sky controllers, the master controller, and the alternate master controller.  If there are subordinate controllers, that is fine, the code could use those for extra replicas beyond the first and second replica.  The code would identify the Master MongoDB controller as the TCx Sky Master Controller, the alternate master MongoDB replica would go on the TCx Sky alternate master controller.  The code would use the TCx Sky APIs to identify a controller's role.  If the TCx Sky controller's role is switched, the MongoDB replica role would also be switched.  There would be no need for a third arbiter machine.

The idea is to use TCx Sky data distribute and roles to identify the primary MongoDB replica instead of using MongoDB’s voting system that requires add odd number of nodes and over 50% of the nodes to be up to vote.

 

TGCS Reference 3137

Contact Intellectual Property department for more information