[erlang-questions] Difference btw Erlang ODBC and emysql driver for accessing MySQL

Seth Falcon seth@REDACTED
Mon Jun 18 05:18:03 CEST 2012

Hi Erisa,

On Sun, Jun 17, 2012 at 6:11 AM, Erisa Dervishi <erisa85d@REDACTED> wrote:
> Could somebody take the trouble and explain to me (just the big
> picture) why should I use emysql driver
> (https://github.com/Eonblast/Emysql) instead of using the Erlang ODBC
> application for accessing Mysql Database?

You might want to use emysql instead of ODBC because...

To use ODBC will require that you have the appropriate odbc driver
code installed on your platform. If you use emysql, that's all you
need. It implements the MySQL wire protocol, no additional non-erlang
software needed.

In theory, using a native driver (emysql) can be faster, though that
is worth testing if that is of particular importance.

A native driver is more likely to expose RDBMS specific features. This
is good if you want the features and can be bad if you use them
without realizing they are special and want to change backend DBs
later on.

Based on a quick scan of the ODBC docs, you will get a richer
experience using prepared queries in emysql. In particular, you will
be able to re-use a prepared query on a given connection, whereas with
ODBC it looks like such queries will require parsing by the db engine
on each call.

Maybe that helps some?

+ seth

Seth Falcon | @sfalcon | http://userprimary.net/

More information about the erlang-questions mailing list