10 ms·
As someone who is fairly tech literate but not familiar with this tech stack - in practical terms, what is Redis, and what is it used for?
by phowon 8y ago
As someone who is fairly tech literate but not familiar with this tech stack - in practical terms, what is Redis, and what is it used for?
- computerex 8y agoIt's a key value store.
- kijin 8y agoWhere the value is not just a string but can also be a set, list, ordered set, hash (dictionary), etc. You can store basically any common data structure in Redis and operate on individual elements as if they were local variables in your program.
- RhodesianHunter 8y agoIn memory fast key value store. Great for caching, or anything distributed systems need quick access to.
- markdown 8y agoSo, like memcache?
- cortesoft 8y agoIt also supports other data structures, like lists, sets, and hashes. Super fast, and probably the best documentation I have ever seen.
- stevoski 8y agoYes, exactly like memcache.
- BozeWolf 8y agoIt can do things memcache can do and way more. Like storing other data types. Persisting storage to disk. Geospatial queries. Pub/sub. Lua scripting. So, no, they are not interchangeable! Only if you just store keys and strings and do not care about persistence.
- zwkrt 8y agoRedis is a general purpose k/v data store that you run in memory. It has support for transactions and atomic operations, and it can be persisted and resumed. You can use it for caching, counting, event sourcing, lat/lng data, pub/sub, and more. My coworker once called redis "NoSQLite", which I think is a very apt description.
- bch 8y agoToo much to not mention: davidw, antirez, and Richard Hipp (SQLite) are all current or former heavy hitters in the Tcl world. David contributed to the second ed. of Tcl and the Tk Toolkit[0], co-authored Rivet[1] (an Apache httpd Tcl module), among other things. antirez wrote Tcl the Misunderstood[2] and Jim[3], a lighter weight Tcl implementation, and Richard (drh) is a former Tcl Core Team member[4] who describes SQLite as “a Tcl extension that escaped into the wild.”[5] [0] https://www.pearson.com/us/higher-education/program/Ousterhout-Tcl-and-the-Tk-Toolkit-2nd-Edition/PGM23076.html https://www.pearson.com/us/higher-education/program/Ousterho... [1] https://tcl.apache.org/rivet/ https://tcl.apache.org/rivet/ [2] http://antirez.com/articoli/tclmisunderstood.html http://antirez.com/articoli/tclmisunderstood.html [3] http://jim.tcl.tk/index.html/doc/www/www/index.html http://jim.tcl.tk/index.html/doc/www/www/index.html [4] https://en.m.wikipedia.org/wiki/D._Richard_Hipp https://en.m.wikipedia.org/wiki/D._Richard_Hipp [5] https://www.tcl.tk/community/tcl2017/assets/talk93/Paper.html https://www.tcl.tk/community/tcl2017/assets/talk93/Paper.htm...
- phamilton 8y agoA lot of people are saying "k/v store", but I think there's an alternate definition which I've stolen from aphyr: A shared heap. If you have a cluster of machines operating on a dataset, you can store that dataset in redis to get high performance reads and writes. In the simple case of a cache, it's a key value store. But other complex cases exist: A priority queue, an atomic transaction log, a lock server, and more. It supports lua so if the data structure and operations you need doesn't exist you can generally build it yourself.
- phowon 8y agoWhat is it generally used for though? To me, a "k.v" store sounds like a very generic but nice thing to have, but I still don't have a good sense of what it is and what people think of it. The one place I've run into it is in web development where it's used for caching? In some tutorials I've read.
- judge2020 8y agoIn a simplified manner: "I have this resource or a big piece of information I don't want to pull from my slow database or slow external service on each request/call/etc. I'm going to see if that resource is there by doing `GET external.foo.bar`. if there is nothing here, I perform the slow pull. After the slow pull is done, we store the result in redis under the same name `external.foo.bar` with a timeout for x seconds. Next time that resource is requested from our code, it will be there, so `GET external.foo.bar` will get us that resource without having to perform a slow call to external service. "
- deadcoder0904 8y agoThank you that was a great example. So from what I understand, Redis shouldn't be used unless there's a scaling issue? Also, where does Redis sit (my guess is between request & database)?
- icebraining 8y ago
- kortilla 8y agoA worse version of the modern hype etcd
- ignoramous 8y agoAn out of process, memory-first, strictly consistent, distributed, data structure store. --- Also see: https://www.dbms2.com/2008/02/18/mike-stonebraker-calls-for-the-complete-destruction-of-the-old-dbms-order/ https://www.dbms2.com/2008/02/18/mike-stonebraker-calls-for-...
- raverbashing 8y agoThe way I like to define is: Redis is a "build your own (in memory) DB kit" k/v store is just 10% of what it can do. Your value doesn't need to be a value, it can be: - an array or a set - an associative map - an ordered list by score - A bit array Also offers functionality like streams and pub/sub
- deleted 8y ago[deleted]
- taf2 8y agodata-structures as a service. need an atomic lock shared between multiple processes or servers (x) need a set of unique values sorted by insertion time (x) want to know the O(x) complexity of using any of the data-structures to design a system for scale (x) need to notify multiple consumers of a modification ala pub-sub (x) need to keep track of a stream of events for consumers (x) need to do geo-spatial lookups (x) oh and you want this thing to be durable to failure and easy to maintain (sentinel|cluster) (x) redis is single process and easy to configure and understand that's my opinion of why it's so amazeballs. [edit] unicode not supported so x instead
- manigandham 8y agoIt makes the collections you work with in your programming language (list, set, dictionary/map/hash) available as a dedicated server instead, so you can share data across multiple programs. It's single-threaded, stores everything in RAM with optional persistence, and has Lua and modules so you can do more than the standard commands.
- 2trill2spill 8y agoSo you can put state that might otherwise exist on the server into Redis. This keeps your app servers stateless which has some advantages.