前几天写的laravel-blog被老外看到了,然后问我了一个问题:
Why do we need Redis for a blog system? If this is truly a fast blog it should be fast just using a database, no?
我简单回单了一句,为了缓存,提高速度,结果他不依不饶:
Depends on the use case. What are we caching? Indexed queries in a relational database are usually very fast. Adding Redis makes for a more complex stack so it must be motivated. Are we not just talking about saving lower single-digit milliseconds here? And to do that we add a hard dependence on Redis, making hosting more complex, error-prone and expensive. I love Redis and use it when it's appropriate. I also love relational databases because they solve complex use cases in a performant way. I asked why it is motivated to add Redis for a blog engine, and I just get a hand-wavy "for caching" as an answer. What do we need to cache and why can't that problem be solved without the need for a Redis cache?
回答了一长串,具体看这里:here
截图:
所以到底要不要缓存,我该怎么回答?强大的 V 友帮帮我
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.