redis能完全取代mysql吗?
简单的问题,我是否可以使用 redis 而不是 mysql 来处理各种 Web 应用程序:社交网络、地理位置服务等?
Simple question, could I conceivably use redis instead of mysql for all sorts of web applications: social networks, geo-location services etc?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
IT 领域没有什么是不可能的。但有些事情可能会变得极其复杂。
将键值存储用于全文搜索之类的事情可能会非常痛苦。
另外,据我所知,它缺乏对大型集群数据库的支持:因此,在 MySQL 上,如果数据库的大小超过 100 GB,则不会有任何问题,而在 Redis 上......好吧,这将需要更多的努力:-)
因此,将其用于其开发目的,存储只需要通过 id 检索的简单内容。
Nothing is impossible in IT. But some things might get extremely complicated.
Using key-value storage for things like full-text search might be extremely painfull.
Also, as far as I see, it lack support for large, clustered databases: so on MySQL you have no problems if you grow over 100s of Gb in Database, and on Redis... Well, it will require more effort :-)
So use it for what it was developed for, storing simple things which just need to be retreived by id.
如果数据完整性很重要,ACID 合规性是必须的。医疗记录和金融交易就是一个例子。大多数 NoSQL 解决方案(包括 Redis)速度很快,因为它们以 ACID 属性换取速度。
有时,使用关系数据库表示数据更方便,查询也更简单。
此外,由于关系数据库中的外部关系和约束,您的数据更有可能是正确的。在 NoSQL 解决方案中保持数据同步更加困难。
所以,不,我认为我们不能谈论全面更换。它们是针对不同工作的不同工具。我不会用锤子换螺丝刀。
ACID compliance is a must, if data integrity is important. Medical records and financial transactions would be an example. Most of the NoSQL solutions, including Redis, are fast because they trade ACID properties for speed.
Sometimes data is simply more convenient to represent using a relational database and the queries are simpler.
Also, thanks to foreign relationships and constraints in relational databases, your data is more likely to be correct. Keeping data in sync in NoSQL solutions is more difficult.
So, no I don't think we can talk about full replacement. They are different tools for different jobs. I wouldn't trade my hammer for a screwdriver.