0

MongoDB supports both Persistence and Non-Persistence mode. Is it possible to use a hybrid persistence model in mongodb replica nodes?

That means, configure PRIMARY as In-memory storage (for speed) Configure secondary(s) as data persistence on disk(for availability)

Any data, details around this would be highly appreciated.

Ajay
  • 101
  • 6

1 Answers1

1

Yes, it is possible. You just configure inMemory for the --storageEngine option, or the storage.engine setting if using a configuration file at primary node. At secondaries, you use normal in disk engine configuration.

You configure that "inmemory" node's "priority" higher than others, so primary "stays" on that node. After reboot of this "inmemory" node, the databases are of course empty, so node goes to "RECOVERY" state and replicates all data from "new primary" (disk base storage). After replicating all data, node become again (inmemory) PRIMARY and other nodes chage to be secondaries.

JJussi
  • 1,540
  • 12
  • 12