替代轮询数据库? [英] alternative to polling database?

查看:273
本文介绍了替代轮询数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个工作如下的应用程序:Linux机器向客户生成28种不同类型的信函.信件必须以.docx(Microsoft Word格式)发送.秘书维护MS Word模板,这些模板会根据需要自动使用.不能选择使用MS Word.

I have an application that works as follows: Linux machines generate 28 different types of letter to customers. The letters must be sent in .docx (Microsoft Word format). A secretary maintains MS Word templates, which are automatically used as necessary. Changing from using MS Word is not an option.

为协调所有这些,将文档作业放置在数据库表中,并且在每台Windows计算机上运行的python程序会频繁轮询数据库,锁定作业并根据需要运行它们.

To coordinate all this, document jobs are placed into a database table and a python program running on each of the windows machines polls the database frequently, locking out jobs and running them as necessary.

我们使用中央数据库表获取工作信息,以协调不同状态(新",处理",完成",打印")...并提供准确的状态信息.

We use a central database table for the job information to coordinate different states ("new", "processing", "finished", "printed")... as well to give accurate status information.

无论如何,我不希望客户端经常轮询数据库,因为它们大部分时间都不工作.客户每5秒钟会进行一次轮询.

Anyway, I don't like the clients polling the database frequently, seeing as they aren't working most of the time. Clients hpoll every 5 seconds.

为避免轮询,我有点想向所有客户端计算机发送广播有一些工作要做"或检查数据库中有一些工作要做"的消息.

To avoid polling, I kind of want a broadcast "there's some work to do" or "check your database for some work to do" message sent to all the client machines.

我认为某种发布/订阅消息队列可以胜任工作,但是我不希望任何额外的复杂性.

I think some kind of publish/subscribe message queue would be up to the job, but I don't want any massive extra complexity.

是否有零或接近零的配置/维护软件可以实现此目的?有哪些选择?

Is there a zero or near zero config/maintenance piece of software that would achieve this? What are the options?

X

推荐答案

是否有客观证据表明服务器上有任何重大负载?如果可行,我将确保这里确实有问题要解决.

Is there any objective evidence that any significant load is being put on the server? If it works, I'd make sure there's really a problem to solve here.

让一切运行得如此平稳,以至于您正在寻找可能只有改进的事情,这一定是件好事!

It must be nice to have everything running so smoothly that you're looking at things that might only possibly be improved!

这篇关于替代轮询数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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