by node-bayarea on 7/30/21, 1:15 PM with 47 comments
by bennyelv on 7/31/21, 6:39 AM
A query engine is a very powerful and useful layer of abstraction that you end up having to recreate in your application code for every scenario where you need some data. It’s complicated, it’s hard to get right and it really slows you down.
My recommendation would be: don’t do it.
by cbushko on 7/31/21, 1:34 PM
If you are in the cloud and have any hint of using kubernetes then DO NOT USE redis as a persistent store. The problem is that redis' master/slave and replication pattern goes against the load balancing and Service objects of kubernetes. Redis was created in a time when it expected physical nodes to be available 24/7 and is not designed for nodes to go away. It can handle it but it isn't designed for it. Two different things.
Redis as a single pod and a cache works great. I would never use redis as a DB. We have DBs specifically designed to be DBs.
by reidjs on 7/30/21, 11:01 PM
by maxmcd on 7/31/21, 12:00 AM
This is why I thought you wouldn't want to run Redis as a primary database.
by gunapologist99 on 7/30/21, 11:32 PM
The impedance match between redis and most programming language data structures is just really perfect; Redis supports all of the structures (arrays, maps, etc) that you'd expect, and a few you wouldn't (bloom filters, for example).
Also, it has some really odd security choices and just generally a lack of focus on security at all. It didn't even have any password at all for the first few years -- anyone could connect to it and just do whatever they wanted (and, in fact, you could even gain access to the OS!) It's also pretty hard to start up securely in the cloud (by default, it binds to every interface instead of just localhost, or at least the last time I checked, although you can override this in the config.. just be careful about that, because this lack of emphasis on security seems to run through it.)
Again, as a very fast and flexible cache that supports a million different datatypes and has real big-O performance guarantees, it is superb.
But these days, if you want a primary production database, you should just default to postgresql, unless you already have a solid reason to choose something else. If you don't know SQL, you should learn, but until you're really ready to, just use an object relational mapper (ORM) for your programming language and that will turn postgresql basically into MongoDB or similar, but with all the power of SQL behind it.
by ihucos on 7/30/21, 11:51 PM
by jbverschoor on 7/31/21, 11:24 AM
by arthurcolle on 7/30/21, 11:14 PM
I remember when I thought it was a great idea to use Elasticsearch as a primary database. The decision was a mistake
by Zealotux on 7/30/21, 11:47 PM
by junon on 7/31/21, 11:54 AM
We still used redis extensively but not as a persistence layer.
by ransom1538 on 7/31/21, 2:44 AM
IMHO, no. Unless! you can ensure your data is less than the size of memory. Redis must fit all the data into memory. If you run out of memory Redis doesn't have great options (besides buy more memory). In my mind a primary database handles the complexities/speed of pulling data from a disk, manipulating data in memory and scales with more disk. Redis manipulates data in memory only.
Redis is rad for specific group of problems.
by halifaxbeard on 7/30/21, 11:29 PM
It depends, like everything.