Plugin for caching Mongoose query results in Redis, thoughts?

297 views
Skip to first unread message

Grey Ang

unread,
Feb 24, 2013, 4:08:33 AM2/24/13
to mongoo...@googlegroups.com
Hi guys! 

I wrote a plugin for caching Mongoose query results in Redis. This helps speeding up lean queries to 300% and so. 

It's still pretty raw at the moment, and it's my first time writing a plugin... Would love to hear some feedback! What do you guys think? Any feedback for things I should or shouldn't do, or things I can improve on? 

Here's the github link:
https://github.com/conancat/mongoose-redis-cache

And here are the test results: 

=========================
Mongoose-Redis Cache Test
=========================
Total items in DB: 30000
Total number of queries per round: 20
Total number of rounds: 30

Generating 30000 mocks...

--------------------------------
Test query without Redis caching
--------------------------------
Begin executing queries without caching
․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․

Total time for 30 test rounds: 12620ms
Average time for each round: 420.67ms

--------------------------------
Test query with Redis caching
--------------------------------
Begin executing queries with Redis caching
․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․

Total time for 30 test rounds: 3618ms
Average time for each round: 120.60ms
------------
CONCLUSION
------------
Caching with Redis makes Mongoose lean queries faster by 9002 ms.
That's 348.81% faster!  

Feedback is very much appreciated! Thanks guys :D 



Grey

kamen....@cre8ivecells.com

unread,
Feb 28, 2013, 10:16:13 AM2/28/13
to mongoo...@googlegroups.com
This is such a cool idea, KUDOS! I was thinking to use some kind of caching, but this is just great! Will test it soon and notify you my results ;)
Reply all
Reply to author
Forward
0 new messages