Yorker, Moodler and developer Marcus Green not only offers comprehensive training on the Java programming language. In his examulator.com portal, he shows us a visualization of the database that powers a Moodle 3.1 installation. Including yours!
Green reverse-engineered Moodle 3.1 data model, with the help of some MySQL Workbench trickery. Since parts of the database do not use the relational model that corresponds with SQL, but rather the XML structure, he made an SQL statement generator to translate as much of the XML portion of the database as possible. But as he admits, the conversion is not possible everywhere, as it is the case for fields that hold multiple values, something relational databases forbid.
Getting into the schema, it shows 38 databases, most of them with over ten tables each. Some have unique pages with further detail, which I have linked in their names. The most prominent ones are:
assignfor the assignment activity,
mnetfor network administration,
Not only these make the bulk of the model and account for the most tables. They also share the bulk of the connections between tables, and the others have at least one link to them. In fact, Green notes that the
user table from the
users database was excluded because its amount of relationships would not be legible and would “obscure much of the diagram“.
The bulk of a student activity takes place in the following tables. They are all connected to the
gradebook, and if the Moodle has enabled it,
competency tables. I am sure they sound familiar.
Additional databases that come in a default Moodle 3.1 installation, but whose use varies across installations and is not mandatory, are
tool (includes the recycle bin), and
Finally, we have a group of smaller yet fundamental tables, without which Moodle would not be, counting among them:
The massive amount of information included in Green’s schema means I cannot do it legible justice. Studying it is a must for developers at all stages, and a tool to go back to for everyone. To which I invite you to do from time to time, at least until Green gives us the Moodle 3.2 version.
Does this relational visualization of version 3.1 changes the way you see Moodle? Tell our community how, in the comments below!
This Moodle Technology related post is made possible by: Moonami a company that provides a full range of Moodle services that combine the flexibility, scalability, and power of Amazon’s world-leading cloud platform (AWS) with fanatical Moodle support. Click here to learn more.