3 ms·
For caching the query results you get from your database. Also it's easier to spin up Redis and replicate it closer to your user than doing that with your main
by cplli 4y ago
For caching the query results you get from your database. Also it's easier to spin up Redis and replicate it closer to your user than doing that with your main database. From my experience anyway.
- mike_hearn 4y agoI think the idea is that if your db can hold the working set in RAM and you're using a good db + prepared queries, you can just let it absorb the full workload because the act of fetching the data from the db is nearly as cheap as fetching it from redis.
- killerstorm 4y ago> For caching the query results you get from your database. This only makes sense if queries are computationally intensive. If you're fetching a single row by index you aren't winning much (or anything).
- dpkirchner 4y agoOf course? I'm not really sure what the original question actually is if you know that users benefit from caching the results of computationally intensive queries.
- killerstorm 4y agoOpenAI uses redis to store pieces of text. Fetching pieces of text is not computationally intensive.
- mannyv 4y agoMost likely they have them in an rdbms, so it's more like joining a forum thread together. Not expensive, but why not prebuild and store it instead?
- acuozzo 4y ago> This only makes sense if queries are computationally intensive. Or if the link to your DB is higher latency than you're comfortable with.