Python Celery 将结果异步保存在数据库中
我使用 Python 与 Celery 和 RabbitMQ 来制作一个网络蜘蛛来计算页面上的链接数量。
MySQL等数据库可以异步写入吗?是否可以在添加每一行后提交更改,或者是否需要对它们进行批处理(多次添加),然后在一定数量的行/持续时间后提交?
我更喜欢使用 SQLAlchemy 和 MySQL,除非有更推荐的 Celery/RabbitMQ 组合。我还看到推荐的NoSQL(CouchDB?)。
I'm using Python with Celery and RabbitMQ to make a web spider to count the number of links on a page.
Can a database, such as MySQL, be written into asynchronously? Is it OK to commit the changes after every row added, or is it required to batch them (multi-add) and then commit after a certain number of rows/duration?
I'd prefer to use SQLAlchemy and MySQL, unless there is a more recommended combination for Celery/RabbitMQ. I also see NoSQL (CouchDB?) recommended.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于像计数器和日志这样的写入密集型操作,NoSQL 解决方案始终是最佳选择。我个人使用 mongoDB 来完成此类任务。
For write intensive operation like Counters and Logs NoSQL solution are always the best choice. Personally I use a mongoDB for this kind of tasks.