5

We have a MySql database that has many writes & updates per second and the rate is growing rapidly.

To handle all those writes and updates we are thinking about adding a queuing instance like Rabbit mq between the application and the DB, so that each query will be sent to the queue and the users will not have to wait for the database to finish inserting and updating records.

We understand that using a queue will cause a delay in the DB data update and that not a problem for our application.

For inserts we currently use 'INSERT DELAYED' and a MyIsam table but we can't do it with updates. So after some digging I came up with the queuing option.

Is this a recommended method for lowering working with high volume writes to the DB? Or should we consider another solution?

If you have any recommendation other than RabbitMQ we are open for new ideas.

Also - any known plugins for PHP MySql PDO with RabbitMQ?

Thanks

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
SiteAppDev
  • 141
  • 2
  • 8
  • It's not constructive. There might be a lot of other ways to reduce database load, from refactor application level to simply add more resources to database machine or cluster. By the way, MyISAM uses table level locks, so why not just give a try to InnoDB? And keep in mind that as of MySQL 5.6.6 `INSERT DELAYED` INSERT DELAYED is deprecated. – pinepain Jun 19 '14 at 06:58
  • Thanks for the tips. Adding more resources to the machine is obviously an option we thought about and we will do it will still make the user wait for write data each time. We use Innodb for the tables that we do updates so there's not table locking and we use myisam with delayed option for inserts tables. – SiteAppDev Jun 19 '14 at 07:44
  • RabbitMQ will not help, it will only create more problems. Refactoring the application is always the way in such cases – Taggart Comet Apr 11 '20 at 06:05

1 Answers1

0

Perhaps this library may help you: https://github.com/videlalvaro/php-amqplib

Alberto Garrido
  • 485
  • 2
  • 6
  • 15