MongoDB作为MySQL频繁连接和查询的缓存 [英] MongoDB as a cache for frequent joins and queries from MySQL

查看:520
本文介绍了MongoDB作为MySQL频繁连接和查询的缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑执行以下操作,如果可以这样做,则需要一些建议.基本上,因为我能够在MongoDB中进行查询,并且由于数据的热点被缓存在内存中,所以MongoDb在这些方面的速度很快.我当时正在考虑存储数据,通常我会从mongoDB的mysql中进行联接.当我使用memcached存储简单查询结果(例如电影说明页面)时,对于需要更多实时/按需查询的较大内容,我正在考虑将其存储在MongoDB中.例如,电影的观看次数和观看者,以及对其进行分析.

Im thinking about doing the following and need suggestions if it makes sense to approach it this way. Basically since I am able to do queries in MongoDB and MongoDb is wicked fast at these since the hotspots of the data are cached in memory. I was thinking of storing data I would normally do a join from in mysql in mongoDB. While I am using memcached to store simple query results (for example a movie description page), for bigger stuff that requires more realtime/ondemand queries I was thinking about storing this in MongoDB. For example the view count for movies and who saw it, and doing analysis on it.

希望我能清楚地解释它.

Hopefully I explained it clearly.

更多信息:

我们不想继续对每个等级(例如等)写入mysql服务器,MongoDB似乎是一个不错的选择,可以存储等级,电影观看等,然后在以后可以对该数据进行处理.而使用Memcached的数据无法持久保存并且无法执行查询

We dont want to keep writing to our mysql server on every rating like etc, MongoDB seemed like a good option to store the ratings,views of movies etc and then later on be able to do processing on that data. Whereas with Memcached data is not persisted and were unable to do queries

谢谢, 费萨尔

推荐答案

单独使用内存缓存并不是使用MongoDB的好理由.任何配置正确的RDBMS都会在内存中缓存常用数据.

Memory caching alone is not a good reason to go with MongoDB. Any properly configured RDBMS will cache frequently used data in memory.

MySQL的哪个方面目前正在限制您的性能?您的服务器中是否有足够的RAM?您的磁盘足够快吗?您是否具有适当配置的低延迟缓存设备(如SSD)?

What aspect of MySQL is currently limiting your performance? Do you have enough RAM in your server? Are your disks fast enough? Do you have a low latency cache device like an SSD configured appropriately?

这篇关于MongoDB作为MySQL频繁连接和查询的缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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