SlideShare a Scribd company logo
1 of 26
Copyright 2020 Severalnines AB
Lukas Vileikis, Marketing Manager, Severalnines
Presenter
lukasvileikis.com
lukas@severalnines.com
Managing the Moodle Database: Getting
Started
January 27th, 2021
Copyright 2020 Severalnines AB
Copyright 2019 Severalnines AB
Agenda
2
Copyright 2020 Severalnines AB
Agenda
● What is the Moodle Database?
● Moodle Database Configuration
● What to Monitor in the Moodle Database?
● Moodle Database Schema
● Database Activity in Moodle
● Managing the Moodle Database with ClusterControl
3
Copyright 2020 Severalnines AB 4
● Moodle database stores
○ all of the information related to Moodle.
● Moodle supports MySQL, MariaDB, PostgreSQL, MS SQL and Oracle
databases.
● The most frequently used database for Moodle is MySQL.
What is the Moodle Database?
Copyright 2020 Severalnines AB 5
Copyright 2020 Severalnines AB 6
● Moodle has thousands of plugins available - the plugin list includes
1,769 plugins.
○ The plugin list includes gamification plugins, questionnaire
plugins, certificate plugins etc.
○ Each plugin comes with its own schema.
Moodle Plug-ins
Copyright 2020 Severalnines AB
Copyright 2019 Severalnines AB
Moodle Database Configuration and
Monitoring
7
Copyright 2020 Severalnines AB 8
● Moodle Database Configuration File @ /var/www/html/moodle/config.php:
$CFG->dbtype = 'mariadb'; // 'pgsql', 'mariadb', 'mysqli', 'sqlsrv' or 'oci'
$CFG->dblibrary = 'native'; // 'native' only at the moment
$CFG->dbhost = '10.10.10.134'; // eg 'localhost' or 'db.isp.com' or IP
$CFG->dbname = 'moodle'; // database name, eg moodle
$CFG->dbuser = 'moodleuser'; // your database username
$CFG->dbpass = 'moodlepass'; // your database password
$CFG->prefix = 'mdl_'; // prefix to use for all table names
$CFG->dboptions = array(
'dbpersist' => false, // ‘false’ - most stable setting, ‘true’ sometimes improves performance
'dbsocket' => false, // Should connection via UNIX socket be used?
'dbport' => '', // The TCP port. Leave empty for the default port
'dbhandlesoptions' => false, // pgbouncer doesn’t support advanced options on connection
'dbcollation' => 'utf8mb4_unicode_ci' // database collation, best to leave at default
);
Moodle Database Configuration
Copyright 2020 Severalnines AB 9
Copyright 2020 Severalnines AB 10
What to Monitor in Moodle?
What to Do? How to Do It?
Take two things into account Take into account the OS and the
database.
Monitor the metrics in the context of your
system
Look for alterations in the behavioral
patterns: excessive CPU usage might be a
problem, high RAM usage probably means
that you need to check your DB
configuration, high load average could be
generated by excessive CPU, RAM or disk
usage.
Monitor your database Monitor your queries, the amount of active
sessions, database locks etc.
Copyright 2020 Severalnines AB 11
What to Monitor in Moodle?
What to Monitor? How to Do It?
Queries Know what data they access, are they
using indexes or partitions, what are their
patterns. Use EXPLAIN.
Active sessions If the number is high, increment the
maximum value or check if something is
wrong.
Database locks If you have a query waiting for another
query, check if it should be running in the
first place.
Backups Make sure they are up to date and can be
restored.
Copyright 2020 Severalnines AB
Copyright 2019 Severalnines AB
Moodle Database Schema
12
Copyright 2020 Severalnines AB 13
Moodle Database Schema
What do You Need to Do to Begin
Working with Moodle?
How to Do It?
Create a database that stores the Moodle
tables in MySQL, change the default
character set and collation to UTF-8, also
grant privileges.
Run the following queries:
CREATE DATABASE moodle DEFAULT
CHARACTER SET UTF8;
GRANT ALL PRIVILEGES ON moodle.*
TO ‘moodleuser’@’localhost’
IDENTIFIED BY ‘password’;
FLUSH PRIVILEGES;
Keep in mind the effects of the privileges. Keep in mind that GRANT ALL
PRIVILEGES allows a MySQL user full
access to a designated database.
Copyright 2020 Severalnines AB 14
Moodle Database Schema
Category of Database Schemas About
Configuration tables Consists of the following tables:
config, config_log, config_plugins
Users and their profile tables Consists of the following tables:
user, user_enrolments,
user_info_category,
user_info_data, user_info_field,
user_lastaccess,
user_preferences,
user_private_key
Copyright 2020 Severalnines AB 15
● Moodle’s database activity allows you to build, display and search
entries (files, images, links to websites, text...) on a topic of your
choice.
● Activities can be:
○ Moderated
○ Commented
○ Rated
○ Displayed as a list or individually
Database Activity in Moodle
Copyright 2020 Severalnines AB 16
● To add a database activity, turn on the editing, then select database
from the activity chooser. Database activities can also have names
and descriptions:
Database Activity in Moodle
Log in as a teacher,
then turn on editing.
Copyright 2020 Severalnines AB 17
● Database activities work through views
○ student views and teacher views
● In a student view, students can click
on the Database icon in the course
to access it and add entries.
● In a teacher view,
teachers can see the set up tabs and can edit, delete, approve and
unapprove entries as required.
Database Activity in Moodle – How Does it
Work?
Copyright 2020 Severalnines AB
Copyright 2019 Severalnines AB
Moodle Database and ClusterControl
18
Copyright 2020 Severalnines AB 19
● ClusterControl can help you with load balancing, adding or removing
slave nodes, automatic failover and recovery, backups and more:
○ Monitor your database servers in real-time
○ Create alerts which inform of events in your database
○ Scale-out your database
■ multi-master
■ primary with multiple secondaries
Monitoring the Moodle Database with
ClusterControl
Copyright 2020 Severalnines AB 20
● Provides a unified view of all DB instances (even across multiple
datacenters) letting you see the big picture or individual nodes.
● Backup management
○ Centralizes backups to protect, secure and recover your data
○ Backup verification feature to ensure backups are restorable
○ Support for different native backup methods
■ XtraBackup, MariaBackup, pg_basebackup, pgbackrest,
among others...
Monitoring the Moodle Database with
ClusterControl
Copyright 2020 Severalnines AB 21
Monitoring the Moodle Database with
ClusterControl
What can ClusterControl help with? How?
Security Manage database users and roles
(ClusterControl -> Your Cluster -> Manage
-> Schema and Users (or User
Management for PostgreSQL).
Logs See the ClusterControl log section.
Integration with your custom automation
scripts
s9s CLI available
Copyright 2020 Severalnines AB 22
Hardware specs
(CPU clock, cores, disk subsystem, RAM, swap, NIC, etc)
Hardware specs
(CPU clock, cores, disk subsystem, RAM, swap, NIC, etc)
Monitoring the Moodle Database with
ClusterControl - Backups
mysqldump, Percona
XtraBackup, MariaDB
Backup, NDB Backup
Backups can be
uploaded to the cloud
and restored
Copyright 2020 Severalnines AB 23
Monitoring the Moodle Database with
ClusterControl - Overview
Copyright 2020 Severalnines AB 24
Monitoring the Moodle Database with
ClusterControl - Query Monitoring
Copyright 2020 Severalnines AB 25
Adding a New Integration
Copyright 2020 Severalnines AB
Lukas Vileikis, Severalnines
Severalnines.com
lukasvileikis.com
Thank You! ☺
26

More Related Content

What's hot

MMUG18 - MySQL Failover and Orchestrator
MMUG18 - MySQL Failover and OrchestratorMMUG18 - MySQL Failover and Orchestrator
MMUG18 - MySQL Failover and OrchestratorSimon J Mudd
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19cMaria Colgan
 
What is active directory
What is active directoryWhat is active directory
What is active directoryAdeel Khurram
 
All of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperAll of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperJeff Smith
 
MySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & OperationsMySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & OperationsFrederic Descamps
 
Oracle Security Presentation
Oracle Security PresentationOracle Security Presentation
Oracle Security PresentationFrancisco Alvarez
 
RMAN in 12c: The Next Generation (PPT)
RMAN in 12c: The Next Generation (PPT)RMAN in 12c: The Next Generation (PPT)
RMAN in 12c: The Next Generation (PPT)Gustavo Rene Antunez
 
Database Consolidation using the Oracle Multitenant Architecture
Database Consolidation using the Oracle Multitenant ArchitectureDatabase Consolidation using the Oracle Multitenant Architecture
Database Consolidation using the Oracle Multitenant ArchitecturePini Dibask
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017Gianluca Hotz
 
Oracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret InternalsOracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret InternalsAnil Nair
 
Windows Server 2019.pptx
Windows Server 2019.pptxWindows Server 2019.pptx
Windows Server 2019.pptxmasbulosoke
 
[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기NHN FORWARD
 
An overview of reference architectures for Postgres
An overview of reference architectures for PostgresAn overview of reference architectures for Postgres
An overview of reference architectures for PostgresEDB
 
ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQLMydbops
 
Architecture as Linked Data
Architecture as Linked DataArchitecture as Linked Data
Architecture as Linked DataDanny Greefhorst
 

What's hot (20)

MMUG18 - MySQL Failover and Orchestrator
MMUG18 - MySQL Failover and OrchestratorMMUG18 - MySQL Failover and Orchestrator
MMUG18 - MySQL Failover and Orchestrator
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19c
 
One PDB to go, please!
One PDB to go, please!One PDB to go, please!
One PDB to go, please!
 
What is active directory
What is active directoryWhat is active directory
What is active directory
 
All of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperAll of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL Developer
 
MySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & OperationsMySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & Operations
 
Azure purview
Azure purviewAzure purview
Azure purview
 
Oracle Security Presentation
Oracle Security PresentationOracle Security Presentation
Oracle Security Presentation
 
RMAN in 12c: The Next Generation (PPT)
RMAN in 12c: The Next Generation (PPT)RMAN in 12c: The Next Generation (PPT)
RMAN in 12c: The Next Generation (PPT)
 
Database Consolidation using the Oracle Multitenant Architecture
Database Consolidation using the Oracle Multitenant ArchitectureDatabase Consolidation using the Oracle Multitenant Architecture
Database Consolidation using the Oracle Multitenant Architecture
 
Autonomous Data Warehouse
Autonomous Data WarehouseAutonomous Data Warehouse
Autonomous Data Warehouse
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017
 
Backup And Recovery
Backup And RecoveryBackup And Recovery
Backup And Recovery
 
Oracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret InternalsOracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret Internals
 
Windows Server 2019.pptx
Windows Server 2019.pptxWindows Server 2019.pptx
Windows Server 2019.pptx
 
[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기
 
An overview of reference architectures for Postgres
An overview of reference architectures for PostgresAn overview of reference architectures for Postgres
An overview of reference architectures for Postgres
 
ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQL
 
Architecture as Linked Data
Architecture as Linked DataArchitecture as Linked Data
Architecture as Linked Data
 
Data Guard Architecture & Setup
Data Guard Architecture & SetupData Guard Architecture & Setup
Data Guard Architecture & Setup
 

Similar to Working with the Moodle Database: The Basics

Sql interview question part 10
Sql interview question part 10Sql interview question part 10
Sql interview question part 10kaashiv1
 
Sql interview question part 9
Sql interview question part 9Sql interview question part 9
Sql interview question part 9kaashiv1
 
Sql interview-question-part-9
Sql interview-question-part-9Sql interview-question-part-9
Sql interview-question-part-9kaashiv1
 
Accelerating Cloud Training With Alluxio
Accelerating Cloud Training With AlluxioAccelerating Cloud Training With Alluxio
Accelerating Cloud Training With AlluxioAlluxio, Inc.
 
BITS: Introduction to MySQL - Introduction and Installation
BITS: Introduction to MySQL - Introduction and InstallationBITS: Introduction to MySQL - Introduction and Installation
BITS: Introduction to MySQL - Introduction and InstallationBITS
 
Dataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStoreDataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStoreVikalp Bhalia
 
MySQL Cluster 8.0 tutorial
MySQL Cluster 8.0 tutorialMySQL Cluster 8.0 tutorial
MySQL Cluster 8.0 tutorialFrazer Clement
 
Sql Server tips from the field
Sql Server tips from the fieldSql Server tips from the field
Sql Server tips from the fieldInnoTech
 
Big Data: Big SQL web tooling (Data Server Manager) self-study lab
Big Data:  Big SQL web tooling (Data Server Manager) self-study labBig Data:  Big SQL web tooling (Data Server Manager) self-study lab
Big Data: Big SQL web tooling (Data Server Manager) self-study labCynthia Saracco
 
Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0Olivier DASINI
 
MS SQL Backups explained by a DBA
MS SQL Backups explained by a DBAMS SQL Backups explained by a DBA
MS SQL Backups explained by a DBAWally Pons
 
MySQL Performance Best Practices
MySQL Performance Best PracticesMySQL Performance Best Practices
MySQL Performance Best PracticesOlivier DASINI
 
DevTalks.ro 2019 What's New in MySQL 8.0 Security
DevTalks.ro 2019 What's New in MySQL 8.0 SecurityDevTalks.ro 2019 What's New in MySQL 8.0 Security
DevTalks.ro 2019 What's New in MySQL 8.0 SecurityGeorgi Kodinov
 
The Proper Care and Feeding of MySQL Databases
The Proper Care and Feeding of MySQL DatabasesThe Proper Care and Feeding of MySQL Databases
The Proper Care and Feeding of MySQL DatabasesDave Stokes
 
New Capabilities with Cognos Data Modules
New Capabilities with Cognos Data ModulesNew Capabilities with Cognos Data Modules
New Capabilities with Cognos Data ModulesSenturus
 

Similar to Working with the Moodle Database: The Basics (20)

Sql interview question part 10
Sql interview question part 10Sql interview question part 10
Sql interview question part 10
 
Ebook10
Ebook10Ebook10
Ebook10
 
Ebook9
Ebook9Ebook9
Ebook9
 
Sql interview question part 9
Sql interview question part 9Sql interview question part 9
Sql interview question part 9
 
Sql interview-question-part-9
Sql interview-question-part-9Sql interview-question-part-9
Sql interview-question-part-9
 
Ebook9
Ebook9Ebook9
Ebook9
 
Alejandro_Laverdet - EN
Alejandro_Laverdet - ENAlejandro_Laverdet - EN
Alejandro_Laverdet - EN
 
Accelerating Cloud Training With Alluxio
Accelerating Cloud Training With AlluxioAccelerating Cloud Training With Alluxio
Accelerating Cloud Training With Alluxio
 
BITS: Introduction to MySQL - Introduction and Installation
BITS: Introduction to MySQL - Introduction and InstallationBITS: Introduction to MySQL - Introduction and Installation
BITS: Introduction to MySQL - Introduction and Installation
 
Dataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStoreDataweave Libraries and ObjectStore
Dataweave Libraries and ObjectStore
 
MySQL Cluster 8.0 tutorial
MySQL Cluster 8.0 tutorialMySQL Cluster 8.0 tutorial
MySQL Cluster 8.0 tutorial
 
Sql Server tips from the field
Sql Server tips from the fieldSql Server tips from the field
Sql Server tips from the field
 
Big Data: Big SQL web tooling (Data Server Manager) self-study lab
Big Data:  Big SQL web tooling (Data Server Manager) self-study labBig Data:  Big SQL web tooling (Data Server Manager) self-study lab
Big Data: Big SQL web tooling (Data Server Manager) self-study lab
 
Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0
 
58750024 datastage-student-guide
58750024 datastage-student-guide58750024 datastage-student-guide
58750024 datastage-student-guide
 
MS SQL Backups explained by a DBA
MS SQL Backups explained by a DBAMS SQL Backups explained by a DBA
MS SQL Backups explained by a DBA
 
MySQL Performance Best Practices
MySQL Performance Best PracticesMySQL Performance Best Practices
MySQL Performance Best Practices
 
DevTalks.ro 2019 What's New in MySQL 8.0 Security
DevTalks.ro 2019 What's New in MySQL 8.0 SecurityDevTalks.ro 2019 What's New in MySQL 8.0 Security
DevTalks.ro 2019 What's New in MySQL 8.0 Security
 
The Proper Care and Feeding of MySQL Databases
The Proper Care and Feeding of MySQL DatabasesThe Proper Care and Feeding of MySQL Databases
The Proper Care and Feeding of MySQL Databases
 
New Capabilities with Cognos Data Modules
New Capabilities with Cognos Data ModulesNew Capabilities with Cognos Data Modules
New Capabilities with Cognos Data Modules
 

More from Severalnines

Cloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSCloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSSeveralnines
 
Tips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudTips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudSeveralnines
 
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSeveralnines
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...Severalnines
 
Webinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBWebinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBSeveralnines
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlSeveralnines
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Severalnines
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Severalnines
 
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBSeveralnines
 
MariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseMariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseSeveralnines
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBSeveralnines
 
Advanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerAdvanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerSeveralnines
 
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifePolyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifeSeveralnines
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Severalnines
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLSeveralnines
 
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningWebinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningSeveralnines
 
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBWebinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBSeveralnines
 
Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Severalnines
 
Webinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High AvailabilityWebinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High AvailabilitySeveralnines
 
Webinar slides: How to Get Started with Open Source Database Management
Webinar slides: How to Get Started with Open Source Database ManagementWebinar slides: How to Get Started with Open Source Database Management
Webinar slides: How to Get Started with Open Source Database ManagementSeveralnines
 

More from Severalnines (20)

Cloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSCloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaS
 
Tips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudTips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloud
 
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
 
Webinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBWebinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDB
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
 
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDB
 
MariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseMariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash Course
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDB
 
Advanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerAdvanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona Server
 
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifePolyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
 
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningWebinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
 
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBWebinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
 
Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?
 
Webinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High AvailabilityWebinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High Availability
 
Webinar slides: How to Get Started with Open Source Database Management
Webinar slides: How to Get Started with Open Source Database ManagementWebinar slides: How to Get Started with Open Source Database Management
Webinar slides: How to Get Started with Open Source Database Management
 

Recently uploaded

WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseWSO2
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceIES VE
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 

Recently uploaded (20)

WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

Working with the Moodle Database: The Basics

  • 1. Copyright 2020 Severalnines AB Lukas Vileikis, Marketing Manager, Severalnines Presenter lukasvileikis.com lukas@severalnines.com Managing the Moodle Database: Getting Started January 27th, 2021
  • 2. Copyright 2020 Severalnines AB Copyright 2019 Severalnines AB Agenda 2
  • 3. Copyright 2020 Severalnines AB Agenda ● What is the Moodle Database? ● Moodle Database Configuration ● What to Monitor in the Moodle Database? ● Moodle Database Schema ● Database Activity in Moodle ● Managing the Moodle Database with ClusterControl 3
  • 4. Copyright 2020 Severalnines AB 4 ● Moodle database stores ○ all of the information related to Moodle. ● Moodle supports MySQL, MariaDB, PostgreSQL, MS SQL and Oracle databases. ● The most frequently used database for Moodle is MySQL. What is the Moodle Database?
  • 6. Copyright 2020 Severalnines AB 6 ● Moodle has thousands of plugins available - the plugin list includes 1,769 plugins. ○ The plugin list includes gamification plugins, questionnaire plugins, certificate plugins etc. ○ Each plugin comes with its own schema. Moodle Plug-ins
  • 7. Copyright 2020 Severalnines AB Copyright 2019 Severalnines AB Moodle Database Configuration and Monitoring 7
  • 8. Copyright 2020 Severalnines AB 8 ● Moodle Database Configuration File @ /var/www/html/moodle/config.php: $CFG->dbtype = 'mariadb'; // 'pgsql', 'mariadb', 'mysqli', 'sqlsrv' or 'oci' $CFG->dblibrary = 'native'; // 'native' only at the moment $CFG->dbhost = '10.10.10.134'; // eg 'localhost' or 'db.isp.com' or IP $CFG->dbname = 'moodle'; // database name, eg moodle $CFG->dbuser = 'moodleuser'; // your database username $CFG->dbpass = 'moodlepass'; // your database password $CFG->prefix = 'mdl_'; // prefix to use for all table names $CFG->dboptions = array( 'dbpersist' => false, // ‘false’ - most stable setting, ‘true’ sometimes improves performance 'dbsocket' => false, // Should connection via UNIX socket be used? 'dbport' => '', // The TCP port. Leave empty for the default port 'dbhandlesoptions' => false, // pgbouncer doesn’t support advanced options on connection 'dbcollation' => 'utf8mb4_unicode_ci' // database collation, best to leave at default ); Moodle Database Configuration
  • 10. Copyright 2020 Severalnines AB 10 What to Monitor in Moodle? What to Do? How to Do It? Take two things into account Take into account the OS and the database. Monitor the metrics in the context of your system Look for alterations in the behavioral patterns: excessive CPU usage might be a problem, high RAM usage probably means that you need to check your DB configuration, high load average could be generated by excessive CPU, RAM or disk usage. Monitor your database Monitor your queries, the amount of active sessions, database locks etc.
  • 11. Copyright 2020 Severalnines AB 11 What to Monitor in Moodle? What to Monitor? How to Do It? Queries Know what data they access, are they using indexes or partitions, what are their patterns. Use EXPLAIN. Active sessions If the number is high, increment the maximum value or check if something is wrong. Database locks If you have a query waiting for another query, check if it should be running in the first place. Backups Make sure they are up to date and can be restored.
  • 12. Copyright 2020 Severalnines AB Copyright 2019 Severalnines AB Moodle Database Schema 12
  • 13. Copyright 2020 Severalnines AB 13 Moodle Database Schema What do You Need to Do to Begin Working with Moodle? How to Do It? Create a database that stores the Moodle tables in MySQL, change the default character set and collation to UTF-8, also grant privileges. Run the following queries: CREATE DATABASE moodle DEFAULT CHARACTER SET UTF8; GRANT ALL PRIVILEGES ON moodle.* TO ‘moodleuser’@’localhost’ IDENTIFIED BY ‘password’; FLUSH PRIVILEGES; Keep in mind the effects of the privileges. Keep in mind that GRANT ALL PRIVILEGES allows a MySQL user full access to a designated database.
  • 14. Copyright 2020 Severalnines AB 14 Moodle Database Schema Category of Database Schemas About Configuration tables Consists of the following tables: config, config_log, config_plugins Users and their profile tables Consists of the following tables: user, user_enrolments, user_info_category, user_info_data, user_info_field, user_lastaccess, user_preferences, user_private_key
  • 15. Copyright 2020 Severalnines AB 15 ● Moodle’s database activity allows you to build, display and search entries (files, images, links to websites, text...) on a topic of your choice. ● Activities can be: ○ Moderated ○ Commented ○ Rated ○ Displayed as a list or individually Database Activity in Moodle
  • 16. Copyright 2020 Severalnines AB 16 ● To add a database activity, turn on the editing, then select database from the activity chooser. Database activities can also have names and descriptions: Database Activity in Moodle Log in as a teacher, then turn on editing.
  • 17. Copyright 2020 Severalnines AB 17 ● Database activities work through views ○ student views and teacher views ● In a student view, students can click on the Database icon in the course to access it and add entries. ● In a teacher view, teachers can see the set up tabs and can edit, delete, approve and unapprove entries as required. Database Activity in Moodle – How Does it Work?
  • 18. Copyright 2020 Severalnines AB Copyright 2019 Severalnines AB Moodle Database and ClusterControl 18
  • 19. Copyright 2020 Severalnines AB 19 ● ClusterControl can help you with load balancing, adding or removing slave nodes, automatic failover and recovery, backups and more: ○ Monitor your database servers in real-time ○ Create alerts which inform of events in your database ○ Scale-out your database ■ multi-master ■ primary with multiple secondaries Monitoring the Moodle Database with ClusterControl
  • 20. Copyright 2020 Severalnines AB 20 ● Provides a unified view of all DB instances (even across multiple datacenters) letting you see the big picture or individual nodes. ● Backup management ○ Centralizes backups to protect, secure and recover your data ○ Backup verification feature to ensure backups are restorable ○ Support for different native backup methods ■ XtraBackup, MariaBackup, pg_basebackup, pgbackrest, among others... Monitoring the Moodle Database with ClusterControl
  • 21. Copyright 2020 Severalnines AB 21 Monitoring the Moodle Database with ClusterControl What can ClusterControl help with? How? Security Manage database users and roles (ClusterControl -> Your Cluster -> Manage -> Schema and Users (or User Management for PostgreSQL). Logs See the ClusterControl log section. Integration with your custom automation scripts s9s CLI available
  • 22. Copyright 2020 Severalnines AB 22 Hardware specs (CPU clock, cores, disk subsystem, RAM, swap, NIC, etc) Hardware specs (CPU clock, cores, disk subsystem, RAM, swap, NIC, etc) Monitoring the Moodle Database with ClusterControl - Backups mysqldump, Percona XtraBackup, MariaDB Backup, NDB Backup Backups can be uploaded to the cloud and restored
  • 23. Copyright 2020 Severalnines AB 23 Monitoring the Moodle Database with ClusterControl - Overview
  • 24. Copyright 2020 Severalnines AB 24 Monitoring the Moodle Database with ClusterControl - Query Monitoring
  • 25. Copyright 2020 Severalnines AB 25 Adding a New Integration
  • 26. Copyright 2020 Severalnines AB Lukas Vileikis, Severalnines Severalnines.com lukasvileikis.com Thank You! ☺ 26