In my NodeJS application, i have one database update which increments visit_count on every request to my API. It was working good until now. Now, i have significantly more traffic and more DB updates. So to want to implement some kind of counter cache to prevent my app from sending update to MongoDB on every increment operation on visit_count. I Googled a lot but never found anything like "counter cache for NodeJS".
I talked to friend and he suggested me to use HashMap for managing counter cache ( in memory ). I don't know much about counter cache. How they will be flushed to MongoDB and on what basis ?
I also used LRU cache by Isaac for counters. But i lost some counters ( Now i know why ).
I am using Mongoose and MongoDB.
Current rate is 24,550 increments per second.