Databases: Data abstraction layer questions

Databases: Data abstraction layer questions

by Seth Chevalier -
Number of replies: 6

From the Moodle docs, the data abstraction layer (XMLDB) was implemented in version 1.7. Is there a new data abstraction layer beginning 2.X that further improves performance?

Average of ratings: -
In reply to Seth Chevalier

Re: Databases: Data abstraction layer questions

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

There were changes to the database abstraction layer in Moodle 2.0 (really an evolution of XMLDB to take advantage of the fact we can now rely on the PHP 5 object-orientation features). They probably do improve performance slighly.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Databases: Data abstraction layer questions

by Seth Chevalier -

Thanks, Tim.

Is it fair to assume then that the stack represented in the XMLDB docs on this page http://docs.moodle.org/dev/XMLDB_introduction is still accurate?

In reply to Seth Chevalier

Re: Databases: Data abstraction layer questions

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Somewhat accurate. In Moodle 2.0 we got rid of AdoDB, and make our own driver classes instead. Those now live in lib/dml, which replaces the old dmllib.php.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Databases: Data abstraction layer questions

by Seth Chevalier -

Ah, that is why I was getting confused. So AdoDB has been removed and so has dmllib.php? Does that mean ddllib.php is still active?

In the /lib/dml folder I am seeing all the drivers. We use Oracle, does that mean that:

oci_native_moodle_database.php , oci_native_moodle_package.sql, oci_native_moodle_recordset.php, oci_native_moodle_temptables.php

are all created by the Moodle team?

I imagine that going from 1.9 to 2.0 would bring a nice peformance increase since ADOdb is finally gone.

Is this correct?

In reply to Seth Chevalier

Re: Databases: Data abstraction layer questions

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

That is all basically correct.

Those drivers were written by the Moodle team. More specifically, most of the work was done by Eloy Lafuente.

It should be a nice performance increase. Sadly Oracle's version of SQL is quite a long way from ANSI's, so the driver has do to quite a lot of working-around problems, which does damage perforamnce a bit.

If you look, ddllib.php, dmllib.php etc. still exist bug are very small. They mainly just include all the other files that are needed, and provide an entry-point.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Databases: Data abstraction layer questions

by Seth Chevalier -

If you were to remake that stack graphic from the doc page would you do it this way...

------------Moodle 2.X------------

         Moodle XMLDB || Moodle SQL

---------------------------------

            Moodle Database Drivers

---------------------------------

MySQL | PostgreSQL | Oracle | SQL*Server

---------------------------------