生产者/消费者系统使用数据库(MySql),这是可行的吗? [英] Producer/consumer system using database (MySql), is this feasible?

查看:1117
本文介绍了生产者/消费者系统使用数据库(MySql),这是可行的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用某事来协调我的系统与每个运行在不同操作系统的不同机器上的多个消费者/生产者。我一直在研究使用MySql这样做,但它似乎是可笑的困难。



我的要求很简单:我想要能够添加或删除消费者/任何时候,因此他们不应该依赖于彼此。自然是一个数据库将两个很好地分开。



我一直在寻找Q4M消息排队插件的MySql,但似乎复杂的使用。



我真的需要一些关于如何最好地构建系统的输入。

解决方案


我需要使用某些东西来协调
我的系统与几个
消费者/生产者每个运行在
不同的机器与不同的
操作系统


这是一个消息队列。不要追求其他选择。其他一切(例如,使用插入和删除的数据库)非常缓慢而繁琐。



用数据库构建一个大的,慢的消息队列经常在实践中表现不佳因为(1)数据库慢,(2)数据库庞大而复杂,(3)你有锁定和争用问题,使每个事务潜在的慢,(4)它比问题所需的开销要大得多。

有许多消息队列解决方案。



如果你不能使Q4M工作,你应该移到另一个。 / p>

http://en.wikipedia.org/wiki / Message_queue



http: //linux.die.net/man/7/mq_overview



http://qpid.apache.org/



http://code.google.com/p/httpsqs/


I need to use something to coordinate my system with several consumers/producers each running on different machines with different operating systems. I have been researching on using MySql to do this, but it seems ridiculously difficult.

My requirements are simple: I want to be able to add or remove consumers/producers at any time and thus they should not depend on each other at all. Naturally a database would separate the two nicely.

I have been looking at Q4M message queuing plugin for MySql but it seems complicated to use.

I really need some input on how to construct my system best possible.

解决方案

I need to use something to coordinate my system with several consumers/producers each running on different machines with different operating systems

That's a message queue. Do not pursue other alternatives. Everything else (i.e., using a database with insert and deletes) is dreadfully slow and cumbersome.

Building a large, slow message queue with a database often turns out badly in practice because (1) databases are slow, (2) databases are huge and complex, (3) you have locking and contention issues that make each transaction potentially slow, (4) it's a lot more overhead than the problem deserves.

There are numerous message queue solutions.

If you can't make Q4M work, you should move on to another.

http://en.wikipedia.org/wiki/Message_queue

http://linux.die.net/man/7/mq_overview

http://qpid.apache.org/

http://code.google.com/p/httpsqs/

这篇关于生产者/消费者系统使用数据库(MySql),这是可行的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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