Can someone please shed some light on what exactly is DBI and DBD? When should either one be used and the benefits of using one over the other.
DBI is database access library, whereas DBDs are "drivers" which are used by DBI to access particular database (eg. there is one DBD for MySQL, another one for PostgreSQL etc). You should use DBI rather than DBDs directly.