Bonjour,
je tende de développer un logiciel pour un lms,je prend comme exemple moodle, ce lms à plein de fonctionnalités mais je trouve que derrière il a plein de défaut
(notament ralentissement), le lms garde ses couches de code depuis sa conception (1999) et essayer de se rectifié en profondeur (il contient plus de 350 tables).
je vous montre sa table user:
qu'est ce que je pourrais améliorer pour gagner en performance de requête ? la couche logiciel est PHP + mysql (maintenant mariadb)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 CREATE TABLE IF NOT EXISTS `mdl_user` ( `id` bigint(10) NOT NULL, `auth` varchar(20) NOT NULL DEFAULT 'manual', `confirmed` tinyint(1) NOT NULL DEFAULT '0', `policyagreed` tinyint(1) NOT NULL DEFAULT '0', `deleted` tinyint(1) NOT NULL DEFAULT '0', `suspended` tinyint(1) NOT NULL DEFAULT '0', `mnethostid` bigint(10) NOT NULL DEFAULT '0', `username` varchar(100) NOT NULL DEFAULT '', `password` varchar(255) NOT NULL DEFAULT '', `idnumber` varchar(255) NOT NULL DEFAULT '', `firstname` varchar(100) NOT NULL DEFAULT '', `lastname` varchar(100) NOT NULL DEFAULT '', `email` varchar(100) NOT NULL DEFAULT '', `emailstop` tinyint(1) NOT NULL DEFAULT '0', `icq` varchar(15) NOT NULL DEFAULT '', `skype` varchar(50) NOT NULL DEFAULT '', `yahoo` varchar(50) NOT NULL DEFAULT '', `aim` varchar(50) NOT NULL DEFAULT '', `msn` varchar(50) NOT NULL DEFAULT '', `phone1` varchar(20) NOT NULL DEFAULT '', `phone2` varchar(20) NOT NULL DEFAULT '', `institution` varchar(255) NOT NULL DEFAULT '', `department` varchar(255) NOT NULL DEFAULT '', `address` varchar(255) NOT NULL DEFAULT '', `city` varchar(120) NOT NULL DEFAULT '', `country` varchar(2) NOT NULL DEFAULT '', `lang` varchar(30) NOT NULL DEFAULT 'en', `calendartype` varchar(30) NOT NULL DEFAULT 'gregorian', `theme` varchar(50) NOT NULL DEFAULT '', `timezone` varchar(100) NOT NULL DEFAULT '99', `firstaccess` bigint(10) NOT NULL DEFAULT '0', `lastaccess` bigint(10) NOT NULL DEFAULT '0', `lastlogin` bigint(10) NOT NULL DEFAULT '0', `currentlogin` bigint(10) NOT NULL DEFAULT '0', `lastip` varchar(45) NOT NULL DEFAULT '', `secret` varchar(15) NOT NULL DEFAULT '', `picture` bigint(10) NOT NULL DEFAULT '0', `url` varchar(255) NOT NULL DEFAULT '', `description` longtext, `descriptionformat` tinyint(2) NOT NULL DEFAULT '1', `mailformat` tinyint(1) NOT NULL DEFAULT '1', `maildigest` tinyint(1) NOT NULL DEFAULT '0', `maildisplay` tinyint(2) NOT NULL DEFAULT '2', `autosubscribe` tinyint(1) NOT NULL DEFAULT '1', `trackforums` tinyint(1) NOT NULL DEFAULT '0', `timecreated` bigint(10) NOT NULL DEFAULT '0', `timemodified` bigint(10) NOT NULL DEFAULT '0', `trustbitmask` bigint(10) NOT NULL DEFAULT '0', `imagealt` varchar(255) DEFAULT NULL, `lastnamephonetic` varchar(255) DEFAULT NULL, `firstnamephonetic` varchar(255) DEFAULT NULL, `middlename` varchar(255) DEFAULT NULL, `alternatename` varchar(255) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=157 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED COMMENT='One record for each person';
j'avais l'intention de réimplémenter (pas tout mais seulement l'essentiel des fonctionnalité sinon il faudrait tout une vie ....) nodej (j'aimerais angular2 même s'il n'est pas encore sortie) + mariadb.
et d'amélier les ponts faible,
Il y a trop de colonnes?
De plus j'ai trouvé qu'en base il y a du JSON voici un exemple
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 CREATE TABLE IF NOT EXISTS `mdl_course_modules` ( `id` bigint(10) NOT NULL, `course` bigint(10) NOT NULL DEFAULT '0', `module` bigint(10) NOT NULL DEFAULT '0', `instance` bigint(10) NOT NULL DEFAULT '0', `section` bigint(10) NOT NULL DEFAULT '0', `idnumber` varchar(100) DEFAULT NULL, `added` bigint(10) NOT NULL DEFAULT '0', `score` smallint(4) NOT NULL DEFAULT '0', `indent` mediumint(5) NOT NULL DEFAULT '0', `visible` tinyint(1) NOT NULL DEFAULT '1', `visibleold` tinyint(1) NOT NULL DEFAULT '1', `groupmode` smallint(4) NOT NULL DEFAULT '0', `groupingid` bigint(10) NOT NULL DEFAULT '0', `completion` tinyint(1) NOT NULL DEFAULT '0', `completiongradeitemnumber` bigint(10) DEFAULT NULL, `completionview` tinyint(1) NOT NULL DEFAULT '0', `completionexpected` bigint(10) NOT NULL DEFAULT '0', `showdescription` tinyint(1) NOT NULL DEFAULT '0', `availability` longtext ) ENGINE=InnoDB AUTO_INCREMENT=574 DEFAULT CHARSET=utf8 COMMENT='course_modules table retrofitted from MySQL'; (559, 110, 9, 91, 588, NULL, 1463046705, 0, 0, 1, 1, 0, 0, 0, NULL, 0, 0, 0, '{"op":"&","c":[{"type":"profile","sf":"lastname","op":"contains","v":"@xxx"}],"showc":[true]}'),
Ce json permet de donner des permissions .
Faut t'il scinder cette en plusieurs table ? je vois par exemple le username et le alternatename qui font peut être la même chose?
Ce type de donnée est t'il adapté à ce besoin ?
Pour les données en tables ce sont des timestamps, gagne t'on aussi en performance ou fonctionnalité (par exemple la couche de codage est plus simple ) à utiliser des vrais date j/m/a ?
voici ce que je pensais si je scindai les tables:
Merci de vos suggestion
Partager