最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to implement caching mechanism in Sequelize ORM npm -- node.js - Stack Overflow

programmeradmin5浏览0评论

I am writing REST APIs in Node.js with Sequelize as ORM npm, to manage my data models.

I am concerned about my APIs performance because there are many clients, will be using same API, so I want to implement caching mechanism in Sequelize ORM.

Would it be possible with Sequelize ORM ? if yes How ?

I am writing REST APIs in Node.js with Sequelize as ORM npm, to manage my data models.

I am concerned about my APIs performance because there are many clients, will be using same API, so I want to implement caching mechanism in Sequelize ORM.

Would it be possible with Sequelize ORM ? if yes How ?

Share Improve this question edited Jan 6, 2016 at 9:42 Sunil Sharma asked Jan 6, 2016 at 7:52 Sunil SharmaSunil Sharma 1,3153 gold badges17 silver badges31 bronze badges 0
Add a ment  | 

2 Answers 2

Reset to default 6

You can use caching layers like Redis or Memcached to store your results, if you have big ammounts of data. Here is a parison between these two Memcached vs. Redis?. Also there is sequelize-redis-cache npm package you can use https://github./rfink/sequelize-redis-cache

If you are using Sequelize 4, check out that module:

https://github./idangozlan/sequelize-redis

It's a full solution for caching + invalidating cache easily, and as much as I know it's the only Sequelize 4 caching module (right now).

Disclaimer: I'm the author of that module and I'm using that on production for daily traffic of 1m unique users.

发布评论

评论列表(0)

  1. 暂无评论