一种在内存中保存经常变化的值的方法
我正在尝试构建一个实时 Web 服务,用于处理每 15 秒不断变化的动态 10k 空间条目。 想象移动的车辆我只需要处理最新的值。所以我不想在数据库中保留旧值。
我想使用 Sphinx 或 Lucene 作为值的全文搜索服务器,但我不知道如何“保留”这些不断变化的值 15 秒。
问题: 我应该将值存储在 MongoDB 、 MySQL、XML、平面文件中,还是有办法将它们直接作为对象存储在内存中,并且仍然能够操作它们并更新它们的值?
谢谢。
I am trying to build a real-time web service that deals with dynamic 10k spatial entries that keep changing every 15 seconds. imagine moving vehicles I only need to deal with the latest values. So I do not want to keep the old values in the database.
I want to use Sphinx or Lucene as a full-text search server over the values but I do not know how to "Hold" these changing values for 15 seconds.
The Question:
Should I store the values in MongoDB , MySQL, XML, flat files, or is there a way to store them directly as objects in Memory and still able to manipulate them and update their values?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议你看看Redis:
http://redis.io/topics/introduction
I suggest you look at Redis:
http://redis.io/topics/introduction
您可以将 Solr 近乎实时的功能与空间查询结合使用,如果您不需要保留信息,则可以使用内存索引。根据预期的每秒查询数和最大响应时间,您应该相应地调整硬件规格。
无论如何,如果您需要与空间数据一起进行全文查询,solr 可能会有所帮助,如果不需要,mongodb 支持开箱即用的空间查询,并且可以是一个更简单的系统。
You can use Solr near realtime capabilities combined with the spatial queries, if you don't need to persist the info you could use a in memory index. Depending on the expected number of queries per second and maximum response time you should dimension your hardware accordingly.
anyway, solr may be helpful if you need to make full text queries along with the spatial data, if not, mongodb support spatial queries out of the box and can be a more straightforward system.