3 ms·
What is the recommended configuration for in-memory stores like Redis? On a separate machine than its client application? If it's all going in memory, why not
by quadhome 15y ago
What is the recommended configuration for in-memory stores like Redis? On a separate machine than its client application?
If it's all going in memory, why not run the client on that machine and use native data structures?
- antirez 15y agoThere are obvious reasons for needing networking access, but even when you don't need it: 1) Redis is much more memory efficient than your average programming language. 2) Redis handles persistence and replication for you. Not a joke. 3) Accessing data with atomic operations on complex data types from your application using multiple threads can create more problems. 4) Your application is free of doing other stuff if you use a non blocking client, if you are asking Redis to do computationally intensive tasks. 5) There is no easy way to model Redis sorted sets, in many very high level languages, at the same speed, without writing a C extension.
- rarrrrrr 15y agoAnother benefit I run into is sidestepping the GIL in Python or Ruby. Instead of using multiple threads to manipulate data in-process, use multiple processes to manipulate the data in Redis.
- latch 15y agoI'd say it's like anything else. It depends how you are bound. If you can run them on the same machine, go ahead..but if you become resource bound, you split them up, then you shard...common scaling approach. As for why not use native structures? You need to build persistence, transaction support, pub/sub api, thread awarness. Also, if you happen to use a generic data structure, like Java's HashSet, you probably won't get even close to the same level of performance.