In the past, we used secondaryPreferred in the pymongo interface for all purposes, which was not reasonable. A better practice is to:
Use secondary only for normal read-only operations to avoid crushing the primary when the connection demand is high
When writing to the database, we should use xent_collection_admin, which only connects to the primary. Connection to secondaries is unnecessary here as there is no writing option for those.
In the past, we used
secondaryPreferred
in the pymongo interface for all purposes, which was not reasonable. A better practice is to:xent_collection_admin,
which only connects to the primary. Connection to secondaries is unnecessary here as there is no writing option for those.