开发者

Is Redis right for storing and retrieving messages against user a la twitter?

开发者 https://www.devze.com 2023-02-13 15:43 出处:网络
I\'m building a web app - primarily in php - but we need to pull down messages from twitter and various other services (email, sms).I\'m writing a small service in node.js to handle the twitter connec

I'm building a web app - primarily in php - but we need to pull down messages from twitter and various other services (email, sms). I'm writing a small service in node.js to handle the twitter connection etc. but am just trying to work out what is best to do with the content that is pulled down.

Right now I'm leaning towards a combination of MySQL for all our standard info with the main PHP app and Redis with the node.js service to st开发者_运维技巧ore each message against a key that will probably be the username and some sort of unique identifier.

I've used redis before but this data needs to persist rather than being something that can expire like sessions. Redis' in memory nature makes me a bit nervous about this as, over time, with this being our main message store the dataset will quickly become unruly in RAM, will it not?


This blog post gives a good and concise overview for NoSQL-type databases. Perhaps you can find confirmation for or an alternative to Redis there. Since you have not given any numbers on how many and how often you need to pull data from the sources, it's hard to answer from my side.

And, Redis supports two methods of persistence: timed snapshots and an append-only journal files where changes to the db are written to. The second one is the safer alternative.

0

精彩评论

暂无评论...
验证码 换一张
取 消