3 ms·
Ahh I knew I should have checked for grammar fails! It was late when I typed this. As for "I want to use Redis... what can I use it for" that's exactly what I'
by brandoncordell 15y ago
Ahh I knew I should have checked for grammar fails! It was late when I typed this.
As for "I want to use Redis... what can I use it for" that's exactly what I'm asking. I think this project can gain some traction in it's targeted demographic, but more than anything it's gaining experience with technologies that I've been dying to try, so whether it fails or not I got some useful experience from the project (Trying new technology, especially something like Redis, just run on a local dev machine won't do much for getting the real world experience).
I agree that it may be a bit of premature optimisation, so if you want we can speak in hypotheticals. In an application like (pinterest) what are some use cases for moving parts of the data from MongoDB to Redis? Would it be wise to use something like Redis for follow/following and facebook style updates (Bill, John, Mary, and 4 others loved this photo; Bobby, Rick, and Jane are now following you; etc)?
- latch 15y agoIf I knew anything about pinterest, I might be able to help you more.. One area where MongoDB (and almost everything else) suffers is with a large skip/offset value for paging. Getting the first page of results from MongoDB or from Redis will yield similar results. However, the greater the offset the worse the performance. In Redis, whether you get the 1st of the 1000000 page, the performance is constant. So, if you are doing paging with large offsets, at scale, a Redis sorted set is almost a must. It's a pretty specific use case, but I think that's what you asked for :). YMMV on the exact #...you should test it..but if, like 95% of all apps,only the first 5 pages are important, it's really a non-issue. Redis sets are great for follows..and you can do some nice set operations on them (which you can't in MongoDB)...so something like which of my friends, and which of your friends, are following the same people. However, if you want to go more than 1 level deep (a graph), Redis isn't great (nor is Mongo for that matter, but it's probably better). Low hanging fruit for Redis would be analytics...both can handle basic analytics, but Redis will handle it faster. For more complex analytics, the two differ substantially...MongoDB will invovled writing Map Reduce...Redis will require that you do the transformation for reports in code. Still, for simple counters...Redis. In fact, maybe this will inspire you: http://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps/ http://blog.getspool.com/2011/11/29/fast-easy-realtime-metri...
- mryan 15y ago> Would it be wise to use something like Redis for follow/following and facebook style updates (Bill, John, Mary, and 4 others loved this photo; Bobby, Rick, and Jane are now following you; etc)? These examples are some of the best use cases for Redis. You can really reduce load on your DB by storing 'temporary' data in Redis, then using the DB to aggregate it. So in this example, Redis would keep track on how many 'likes' each photo has, making increments/decrements very quick. Once per day you could aggregate this info to permanent storage - then you have the best of both worlds. IMO, one of the best uses for Redis is temporary storage of frequently changing, frequently accessed information. > it's gaining experience with technologies that I've been dying to try, so whether it fails or not I got some useful experience from the project One of my favourite philosophies, and why I love working in this industry... good luck on your journey!