Using MariaDB connector for master/slave connection selection

We have a MySQL (AWS Aurora) cluster with one master and multiple read only instances. We would like to distribute the load of read-only queries to the slaves.

See here:

This would mean we somehow need to define read-only database and a master database, and then switch between them based on whether we’re doing a read access or not.

Has anyone done this in Play? Do you have any pointers about how we could do this?

We are using Play 2.6, Java and ebean.

Many thanks,

1 Like

Hey @ogg,

This can be configured in Play for databases:

See at the examples that you have default, orders, and customers. You can then inject the database based on the name you gave it:

But I don’t think this is supported by our play-ebean plugin.