douyimin1083 2010-03-22 05:04
浏览 50
已采纳

什么是使用PHP / MySQL排队时间敏感消息的最佳方法?

I'm building an SMS call and response system in a new app that receives a message via an aggregator gateway, checks it for functional keywords (run, stop, ask, etc), then processes it appropriately (save to the database, return an answer, or execute a task based on the users authorization). It's running fine at the moment as there are only a few users, but I figure its going to have more issues as we scale it up. We're currently running it on a single DV machine (mediatemple base dv).

My question is this: does it make more sense to set something up like Memcached to run a queue, or a simple database with a daemon running to process each message one by one? I don't have much experience with either, so any advice would be helpful. Since the messaging is somewhat time-sensitive, what would be the fastest and most reliable way to handle this?

Also, since we're sending responses, I'll probably need to set up and outbound message queue as well. Would it make sense to use the same concept for both?

  • 写回答

1条回答 默认 最新

  • doudieheng5322 2010-03-22 05:23
    关注

    "Fastest" and "most reliable" don't necessarily go well together : it's often one or the other.

    ABout memcached and a database, you must be aware that memcached is a caching mecanism, and not a data-storage mecanism.


    It means it should not be used to store data that you cannot regenerate :

    • if there is a system failure (like a crash / reboot), you will lose what was in memcached -- while database are more able to recover
    • if there is not enough RAM to store the data, memcached will remove some old items from the cache, even if you didn't ask for it

    memcached is great when it comes to creating a distributed caching cluster ; but should not be used to store data that is important and that you cannot afford to lose.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度