何时在PHP应用程序中使用Redis代替MySQL? [英] When to use Redis instead of MySQL for PHP applications?

查看:98
本文介绍了何时在PHP应用程序中使用Redis代替MySQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在看Redis.看起来很有趣.但是从实际的角度来看,在哪种情况下,最好在MySQL上使用Redis?

I've been looking at Redis. It looks very interesting. But from a practical perspective, in what cases would it be better to use Redis over MySQL?

推荐答案

我忽略了整个NoSQL与SQL的争论,我认为最好的方法是将它们结合起来.换句话说,对于系统的某些部分(复杂的查找,事务)使用MySQL,而对其他部分(性能,计数器等)则使用redis.

Ignoring the whole NoSQL vs SQL debate, I think the best approach is to combine them. In other words, use MySQL for for some parts of the system (complex lookups, transactions) and redis for others (performance, counters etc).

根据我的经验,与可伸缩性(许多用户...)相关的性能问题最终迫使您添加某种缓存来减轻MySQL服务器的负载,redis/memcached正是这一点.

In my experience, performance issues related to scalability (lots of users...) eventually forces you to add some kind of cache to remove load from the MySQL server and redis/memcached is very good at that.

这篇关于何时在PHP应用程序中使用Redis代替MySQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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