Magnus Ahltorp's MySQL driver introduces Emysql's flaws:
1. Isolation is not good enough,
2. Unable to stretch
The MYSQL-OTP uses 1 processes with 1 MySQL connections, which are well isolated. Recommended use.
Mysql-otp-poolboy uses Poolboy + ERLANG-OTP to form a thread pool, using Poolboy to avoid the lack or excessive number of threads.
Reference: Which Erlang ' s pool is suitable?
poolboy automatically reduces workers when there was not work for them. You get a workers to does some work with checkout from the pool, and you release the worker with checking, as an alternative , you enclose the work on transaction which automatically checkouts the workers and after it is done it checkins the WORKER.W hen you start the pool, Poolboy automatically creates a number of size workers, waiting to handle some work. When your call checkout, Poolboy tries to get one of the workers which was already started, if all of the workers was alread Y checkout because they is doing some work, it checks the IT max_overflow configuration and it starts to create workers to H Andle the load until it reaches Max_overflow. When a worker was released, if there is not more than jobs for the workers, they was killed. So if you create a pool Like{pool, [{size, +, {max_overflow, +]}
A size indicates the minimum number of process pools, and Max_overflow indicates the maximum number of new processes to open if the process pool does not have idle processes.
It is recommended to use Mysql-otp-poolboy.
Erlang driver uses MYSQL-OTP