4 ms·
Redis is a KV store. With this you can run a full SQL query. I did something similiar for my small baseball statistics website switchfielder.com/baseball. On
by SJC_Hacker 3y ago
Redis is a KV store.
With this you can run a full SQL query.
I did something similiar for my small baseball statistics website switchfielder.com/baseball. On server startup, I copy the relevant tables into memory.
- whoitwas 3y agoI thought the point of Redis was to avoid hitting DB. Why not just use SQL?
- SJC_Hacker 3y agoBecause you are guaranteeing everything is in memory, so its very fast and you aren't relying on the DB memory caching. Also it is in-process, which (supposedly) has some benefits as well. Theoretically DBs such as Postgres can be set up similarly, although they will be out of process, and in the case of Postgres, behind at least a UNIX domain socket. This may be a difference of maybe ~ms, I"d love to see some benchmarks ... maybe I'll try that when I have time. Could make a decent Medium article ... For an OLAP (i.e., no writes), small databases with complicated queries(joins, grouping, partitioning, ordering, etc.) this works very well. Yes this is somewhat of an edge case, but I'd bet small shops could fit their entire DB into one of the bigger (several hundred GB) instances.