Databases: Data abstraction layer questions

Databases: Data abstraction layer questions

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?

評比平均分數: -
In reply to Seth Chevalier

Re: Databases: Data abstraction layer questions

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 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.

評比平均分數:Useful (1)
In reply to Tim Hunt

Re: Databases: Data abstraction layer questions

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

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 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.

評比平均分數:Useful (1)
In reply to Tim Hunt

Re: Databases: Data abstraction layer questions

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

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 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.

評比平均分數:Useful (1)
In reply to Tim Hunt

Re: Databases: Data abstraction layer questions

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

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