SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Database Security Management
Database Security Management Database Security Management
Database Security Management
 
Understanding DB2 Optimizer
Understanding DB2 OptimizerUnderstanding DB2 Optimizer
Understanding DB2 Optimizer
 
Database security
Database securityDatabase security
Database security
 
Stored procedure
Stored procedureStored procedure
Stored procedure
 
Chapter 5 database security
Chapter 5   database securityChapter 5   database security
Chapter 5 database security
 
Transparent Data Encryption
Transparent Data EncryptionTransparent Data Encryption
Transparent Data Encryption
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands
 
Clean architecture with asp.net core
Clean architecture with asp.net coreClean architecture with asp.net core
Clean architecture with asp.net core
 
Polymorphic Table Functions in SQL
Polymorphic Table Functions in SQLPolymorphic Table Functions in SQL
Polymorphic Table Functions in SQL
 
DB2UDB_the_Basics
DB2UDB_the_BasicsDB2UDB_the_Basics
DB2UDB_the_Basics
 
Trigger
TriggerTrigger
Trigger
 
IBM Security Identity and Access Management - Portfolio
IBM Security Identity and Access Management - PortfolioIBM Security Identity and Access Management - Portfolio
IBM Security Identity and Access Management - Portfolio
 
Stored procedure in sql server
Stored procedure in sql serverStored procedure in sql server
Stored procedure in sql server
 
Network and cyber security module(15ec835, 17ec835)
Network and cyber security module(15ec835, 17ec835)Network and cyber security module(15ec835, 17ec835)
Network and cyber security module(15ec835, 17ec835)
 
SQL
SQLSQL
SQL
 
MySql:Introduction
MySql:IntroductionMySql:Introduction
MySql:Introduction
 
Dbms 3: 3 Schema Architecture
Dbms 3: 3 Schema ArchitectureDbms 3: 3 Schema Architecture
Dbms 3: 3 Schema Architecture
 
Database Security, Threats & Countermeasures.pptx
Database Security, Threats & Countermeasures.pptxDatabase Security, Threats & Countermeasures.pptx
Database Security, Threats & Countermeasures.pptx
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
 

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Mais de 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
 

Último

Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfUK Journal
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 

Último (20)

Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 

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