Can we set in-memory Mongodb set as primary and WiredTiger as a non-voting replica?

Viewed 31

I need to do fast querying over collections with frequent changes. Fortunately, the size of these collections won't get too big. Also, I can afford to lose some data, and the architecture does not need to be fault tolerant. The biggest requirement is to increase transaction throughput to the maximum. I have 2 servers, one with a goodProcessor server and the other one smallProcessor server.

I am exploring setting:

  • the master db as in-memory storage on goodProcessor server
  • the replica of the master db as WiredTiger storage on smallProcessor server

Is this replication setting possible?

1 Answers

WiredTiger is the engine used in MongoDB for managing documents in RAM and you will have WiredTiger in every node in your Replica Set.

More information here: Replication

You can try with Write concern 0 ({w:0}) and that will speed things up at a cost (consistency).Write concerns

You need at least 3 nodes in your Replica Set, if you're not interested in having replication, then you can have a single node.

If you want to improve performance, use indexes, those are loaded into memory.

Related