Comparing DBI and Alternatives

Slide 23 of 29

Notes:

Native API’s will generally offer the most power, e.g., Oracle OCI.

But take a lot of effort to learn and use.

Knowledge is rarely portable to other APIs

Generic application language interfaces: ODBC and JDBC.

Still lots of effort to learn

Knowledge is portable to other APIs

Power is dependant on quality of ODBC driver

Pre-compilers for C (where SQL is embedded in C and ‘precompiled’)

Simpler than a raw C API but typically less power. Hard to debug.

Command line access - Just type it in!

Generate SQL from scripts etc.

Not robust - hard to check for and respond to errors

Script Languages

TCL (oratcl, sybtcl) generally much slower. Binary data hard.

Win32::ODBC - a bottom-up approach - thin layer over raw ODBC calls. DBI is higher level but DBD::ODBC doesn’t yet have the same breadth of ODBC specific functionality. Recommended for existing users and people who need that degree of control.

DBI+DBD::ODBC can run over twice as fast as Win32::ODBC.

Sybase - and other database specific perl extensions

Can gain some performance advantage if well written but loose out on the DBI extras: portable apps & knowledge, tools, subclasses etc.