The performance of MemoryStore, which is currently powered by mongomock, is relatively slow. This can particularly cause noticeable delays when connecting to a FileStore, which uses MemoryStore internally. It would be great to find an alternative to mongomock that is more performant.
I have begun working on this and will keep this issue updated with my findings.
Possible Alternatives
Notes so far
montydb
See davidlatwe/montydb#14
mongita
mongita does not support many query operations including $regex or $exists. It also doesn't support bulk_write or estimated_document_count although those can be worked around.
pymongo-inmemory
Not tested yet, but looks quite promising because it actually uses mongo (as opposed to mocking it)
See #846
The performance of
MemoryStore, which is currently powered bymongomock, is relatively slow. This can particularly cause noticeable delays when connecting to aFileStore, which usesMemoryStoreinternally. It would be great to find an alternative tomongomockthat is more performant.I have begun working on this and will keep this issue updated with my findings.
Possible Alternatives
mongomock(base case)mongitamontydb(already a dependency; could refactorMemoryStoreto inherit fromMontyStore)pymongo-inmemoryNotes so far
montydbSee davidlatwe/montydb#14
montydbdoes not supportbulk_writeorestimated_document_countalthough those can be worked around.montydbcould not create more than 1 DB instance in memory. See ConfigurationError: montydb has been config to use BSON and cannot be changed in current session. davidlatwe/montydb#79 (comment)mongitamongitadoes not support many query operations including$regexor$exists. It also doesn't supportbulk_writeorestimated_document_countalthough those can be worked around.pymongo-inmemoryNot tested yet, butlooks quite promising because it actually usesmongo(as opposed to mocking it)See #846