何时使用键/值存储(例如 Redis)代替/与 SQL 数据库一起使用? [英] When to use a key/value store such as Redis instead/along side of a SQL database?

查看:28
本文介绍了何时使用键/值存储(例如 Redis)代替/与 SQL 数据库一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了有关 Redis 等键/值存储的精彩内容,但我似乎不知道什么时候该在应用程序中使用它.

I have read great things about key/value stores such as Redis but I can't seem to figure out when it's time to use it in an application.

假设我正在构建一个基于 Web 的应用程序;我知道我将用于前端、后端、数据库等的堆栈.在哪些场景中我会去哦,我们还需要 X、Y 或 Z 的 Redis".

Say I am architecting a web-based application; I know what stack I am going to use for the front-end, back-end, database(s), etc..what are some scenarios where I would go "oh we also need Redis for X,Y, or Z."

我会很欣赏 node.js 示例以及非 node.js 示例.

I would appreciate node.js examples as well as non-node.js examples.

推荐答案

我似乎不知道什么时候该在应用程序中使用它.

I can't seem to figure out when it's time to use it in an application.

我建议您阅读教程,其中还包含用例.由于 redis 是面向内存的,因此非常适合经常更新的实时数据,例如会话存储、状态数据库、统计信息、缓存及其 高级数据结构为许多其他场景提供了多功能性.

I would recommend you to read this tutorial which contains also use cases. Since redis is rather memory oriented it's really good for frequently updated real-time data, such as session store, state database, statistics, caching and its advanced data structures offers versatility to many other scenarios.

然而,Redis 不是经典关系数据库的 NoSQL 替代品,因为它不支持 RDBMS 世界的许多标准功能,例如查询可能会减慢速度的数据.替代的是 MongoDB 或 CouchDB 之类的文档数据库,而 redis 非常擅长补充特定功能,在这些功能中,速度和对高级数据结构的支持很方便.

Redis, however, isn't NoSQL replacement for classic relational databases since it doesn't support many standard features of RDBMS world such as querying of your data which might slow it down. Replacement are rather document databases like MongoDB or CouchDB and redis is great at supplementing specific functionality where speed and support for advanced data structures comes handy.

这篇关于何时使用键/值存储(例如 Redis)代替/与 SQL 数据库一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆