-
Notifications
You must be signed in to change notification settings - Fork 301
Closed
Description
persistent-mysql uses mysql (via mysql-simple) as the database driver. mysql is a haskell FFI wrapper for mysqlclient written in C.
Reasons to use a pure haskell driver:
mysqlhas concurrency issues as noted by @feuerbach.- mysql-haskell, a pure haskell driver by @winterland1989, outperforms
mysql-simplein benchmarks (see hackage or project repo). - better portability and possible static compilation of an entire project that uses
persistent-mysql.
Personal experience on replacing mysql-simple with mysql-haskell in a project:
- Performance gains consistent with benchmark.
- Smoother deployment to Amazon EC2, since
mysqlappears to have a hard dependency on the oracle version oflibmysqlclientthat does not work with the open source variant that is available by default on EC2 (and possibly on other cloud providers).
Potential issues:
ConnectInfoanddefaultConnectInfoare not the same between the packages, therefore the port will not be 100% backward compatible; i.e., even with a best effort wrapper type,mysqlSSLInfo cannot be 1:1 mapped tomysql-haskellTLS ClientParams.mysql-haskelldoes not allow provide an API for client options.
P.S. I've already got a couple of implementations in my fork:
- Initial attempt exposing
mysql-haskellConnectInfodirectly: master...naushadh:port-to-mysql-haskell - Second attempt with a best effort backward compatible API (that requires 0 changes to
persistent-tests): master...naushadh:port-to-mysql-haskell-compat
Metadata
Metadata
Assignees
Labels
No labels