If you are forced to use a lock driver for your database (if for some reason the async driver for MySQL does not work), consider creating an Actor pool (using routing) using PinnedDispatcher.
PinnedDispatcher provides a thread for each actor and, setting up the router, will give you the opportunity to configure the number of threads that are strictly responsible for processing database calls. Simple scaling. In addition, with the help of Actors, you can structure messages between participants (for example, a message that has the results of a database call), a little easier.
Eric Reichert
source share