I am using mongo for simple stats gathering for some business transactions using the $inc
operator
If there's a surge of incoming requests, the high qps would be stressful for mongo insertOne()
or updateOne
operations.
But since I had to handle each request separately, I can not use bulkWrite()
or updateMany()
.
Are there any general library/framework/design-patterns for these kind of tasks, increment counters in memory and periodically flush to db?
Aucun commentaire:
Enregistrer un commentaire