Question

Does managed database split read load between master and read-only node?

Posted December 26, 2019 322 views
DigitalOcean Managed MySQL Database

I would like to know if adding a read-only node to the managed mysql database help with the load by splitting the select queries between servers automatically?

Thank you

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hello,

I don’t think that this happens automatically, you need to either use a Load Balancer or a service like ProxySQL, or build the logic into your application.

For example if you use a framework like Laravel this is quite straight forward to implement, you could take a look at this tutorial here on how to do that:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-scalable-laravel-6-application-using-managed-databases-and-object-storage#step-6-%E2%80%94-scaling-up-a-digitalocean-managed-mysql-database-with-read-only-nodes-(optional)

Regards,
Bobby

by Bobby Iliev
by Erika Heidi
Data persistence and file storage represent two of the biggest challenges when horizontally scaling web applications. This is mainly due to the fact that it is hard to maintain consistency of variable data between multiple application nodes. A practical way of meeting these demands is by using managed databases and object storage. In this guide, we will update an existing Laravel 6 application to use a managed MySQL database and an S3-compatible object store.
Submit an Answer