jeudis du libre - mysql comme document store
TRANSCRIPT
![Page 1: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/1.jpg)
1 / 90
![Page 2: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/2.jpg)
2 / 90
![Page 3: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/3.jpg)
Safe Harbor StatementThe following is intended to outline our general product direction. It is intended forinformation purpose only, and may not be incorporated into any contract. It is not acommitment to deliver any material, code, or functionality, and should not be relied up inmaking purchasing decisions. The development, release and timing of any features orfunctionality described for Oracle's product remains at the sole discretion of Oracle.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
3 / 90
![Page 4: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/4.jpg)
about.me/lefred
Qui suis-je ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
4 / 90
![Page 5: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/5.jpg)
Frédéric Descamps@lefredÉvangéliste MySQLBidouille MySQL depuis la version 3.23devops croyant et praticantMySQL Community Manager depuis mai2016
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
5 / 90
![Page 6: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/6.jpg)
SGDB & MySQL
Base de données Relationnelles
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
6 / 90
![Page 7: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/7.jpg)
Bases de données RelationnellesIntégrité des données
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
7 / 90
![Page 8: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/8.jpg)
Bases de données RelationnellesIntégrité des données
normalization
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
8 / 90
![Page 9: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/9.jpg)
Bases de données RelationnellesIntégrité des données
normalizationcontraintes (clés étrangères, ...)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
9 / 90
![Page 10: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/10.jpg)
Bases de données RelationnellesIntégrité des données
normalizationcontraintes (clés étrangères, ...)
Atomicité, Cohérence, Isolarion et Durabilité - ACID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
10 / 90
![Page 11: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/11.jpg)
Bases de données RelationnellesIntégrité des données
normalizationcontraintes (clés étrangères, ...)
Atomicité, Cohérence, Isolarion et Durabilité - ACIDtransactions
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
11 / 90
![Page 12: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/12.jpg)
Bases de données RelationnellesIntégrité des données
normalizationcontraintes (clés étrangères, ...)
Atomicité, Cohérence, Isolarion et Durabilité - ACIDtransactions
SQL
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
12 / 90
![Page 13: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/13.jpg)
Bases de données RelationnellesIntégrité des données
normalizationcontraintes (clés étrangères, ...)
Atomicité, Cohérence, Isolarion et Durabilité - ACIDtransactions
SQLpuissant language de requêtes
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
13 / 90
![Page 14: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/14.jpg)
SGDB & MySQL
Base de données NoSQL
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
14 / 90
![Page 15: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/15.jpg)
NoSQL ou Document StoreSans schéma
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
15 / 90
![Page 16: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/16.jpg)
NoSQL ou Document StoreSans schéma
pas de design de schémas, pas de normalization, de clés étrangères, decontraintes, de type de données (data types), etc...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
16 / 90
![Page 17: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/17.jpg)
NoSQL ou Document StoreSans schéma
pas de design de schémas, pas de normalization, de clés étrangères, decontraintes, de type de données (data types), etc...dévelopement initial très rapide
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
17 / 90
![Page 18: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/18.jpg)
NoSQL ou Document StoreSans schéma
pas de design de schémas, pas de normalization, de clés étrangères, decontraintes, de type de données (data types), etc...dévelopement initial très rapide
Structures flexibles des données
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
18 / 90
![Page 19: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/19.jpg)
NoSQL ou Document StoreSans schéma
pas de design de schémas, pas de normalization, de clés étrangères, decontraintes, de type de données (data types), etc...dévelopement initial très rapide
Structures flexibles des donnéesobjets et tableaux imbriqués
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
19 / 90
![Page 20: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/20.jpg)
NoSQL ou Document StoreSans schéma
pas de design de schémas, pas de normalization, de clés étrangères, decontraintes, de type de données (data types), etc...dévelopement initial très rapide
Structures flexibles des donnéesobjets et tableaux imbriquéscertaines données sont simplement naturellement non structurées et nepeuvent être modélisées de façon optimale dans un modèle relationel
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
20 / 90
![Page 21: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/21.jpg)
NoSQL ou Document StoreSans schéma
pas de design de schémas, pas de normalization, de clés étrangères, decontraintes, de type de données (data types), etc...dévelopement initial très rapide
Structures flexibles des donnéesobjets et tableaux imbriquéscertaines données sont simplement naturellement non structurées et nepeuvent être modélisées de façon optimale dans un modèle relationelpersistence des objets sans utilisation d'un ORM (mapping objet-relationnel)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
21 / 90
![Page 22: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/22.jpg)
NoSQL ou Document Store (2)JSON
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
22 / 90
![Page 23: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/23.jpg)
NoSQL ou Document Store (2)JSON
proche du frontend
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
23 / 90
![Page 24: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/24.jpg)
NoSQL ou Document Store (2)JSON
proche du frontend"natif " en Javascript
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
24 / 90
![Page 25: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/25.jpg)
NoSQL ou Document Store (2)JSON
proche du frontend"natif " en Javascriptutilisé en Node.js
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
25 / 90
![Page 26: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/26.jpg)
NoSQL ou Document Store (2)JSON
proche du frontend"natif " en Javascriptutilisé en Node.js
Aprentissage facile, et facile à utiliser
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
26 / 90
![Page 27: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/27.jpg)
Les challenges actuelsles développeurs veulent avancer plus rapidement
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
27 / 90
![Page 28: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/28.jpg)
Les challenges actuelsles développeurs veulent avancer plus rapidementle délai de mise en production est un coût supérieur
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
28 / 90
![Page 29: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/29.jpg)
Les challenges actuelsles développeurs veulent avancer plus rapidementle délai de mise en production est un coût supérieurrapidité de création de prototypes, itérations rapides, ...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
29 / 90
![Page 30: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/30.jpg)
Avantages de SQL et de NoSQL
NoSQL SQL
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
30 / 90
![Page 31: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/31.jpg)
Et donc, Bases de données Relationnelles ou Document Store ??
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
31 / 90
![Page 32: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/32.jpg)
Et donc, Bases de données Relationnelles ou Document Store ??
Pourquoi pas les deux ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
32 / 90
![Page 33: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/33.jpg)
Quelles sont les étapes ?
NoSQL avec MySQL
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
33 / 90
![Page 34: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/34.jpg)
Faire de MySQL un Document Store
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
34 / 90
![Page 35: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/35.jpg)
Faire de MySQL un Document Store1. support de JSON datatype
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
35 / 90
![Page 36: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/36.jpg)
Faire de MySQL un Document Store1. support de JSON datatype2. CRUD Operations
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
36 / 90
![Page 37: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/37.jpg)
Faire de MySQL un Document Store1. support de JSON datatype2. CRUD Operations3. X Plugin
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
37 / 90
![Page 38: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/38.jpg)
Faire de MySQL un Document Store1. support de JSON datatype2. CRUD Operations3. X Plugin4. X protocol & MySQL Shell
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
38 / 90
![Page 39: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/39.jpg)
MySQL 5.7
Support de JSON
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
39 / 90
![Page 40: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/40.jpg)
Support JSONType natif de données (native datatype)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
40 / 90
![Page 41: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/41.jpg)
Support JSONType natif de données (native datatype)Valeurs en JSON stockées dans des tables MySQL
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
41 / 90
![Page 42: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/42.jpg)
Support JSONType natif de données (native datatype)Valeurs en JSON stockées dans des tables MySQLFormat de stokage JSON en binaire (UTF8MB4)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
42 / 90
![Page 43: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/43.jpg)
Support JSONType natif de données (native datatype)Valeurs en JSON stockées dans des tables MySQLFormat de stokage JSON en binaire (UTF8MB4)Conversion à partir des types SQL "natifs" vers des valeurs JSON
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
43 / 90
![Page 44: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/44.jpg)
Support JSONType natif de données (native datatype)Valeurs en JSON stockées dans des tables MySQLFormat de stokage JSON en binaire (UTF8MB4)Conversion à partir des types SQL "natifs" vers des valeurs JSONFunctions de manipulation du JSON
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
44 / 90
![Page 45: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/45.jpg)
Support JSONType natif de données (native datatype)Valeurs en JSON stockées dans des tables MySQLFormat de stokage JSON en binaire (UTF8MB4)Conversion à partir des types SQL "natifs" vers des valeurs JSONFunctions de manipulation du JSON
extraire (JSON_EXTRACT, JSON_KEYS, ...)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
45 / 90
![Page 46: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/46.jpg)
Support JSONType natif de données (native datatype)Valeurs en JSON stockées dans des tables MySQLFormat de stokage JSON en binaire (UTF8MB4)Conversion à partir des types SQL "natifs" vers des valeurs JSONFunctions de manipulation du JSON
extraire (JSON_EXTRACT, JSON_KEYS, ...)inpecter (JSON_CONTAINS, ...)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
46 / 90
![Page 47: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/47.jpg)
Support JSONType natif de données (native datatype)Valeurs en JSON stockées dans des tables MySQLFormat de stokage JSON en binaire (UTF8MB4)Conversion à partir des types SQL "natifs" vers des valeurs JSONFunctions de manipulation du JSON
extraire (JSON_EXTRACT, JSON_KEYS, ...)inpecter (JSON_CONTAINS, ...)modifier (JSON_SET, JSON_INSERT, JSON_REMOVE, ...)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
47 / 90
![Page 48: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/48.jpg)
Support JSONType natif de données (native datatype)Valeurs en JSON stockées dans des tables MySQLFormat de stokage JSON en binaire (UTF8MB4)Conversion à partir des types SQL "natifs" vers des valeurs JSONFunctions de manipulation du JSON
extraire (JSON_EXTRACT, JSON_KEYS, ...)inpecter (JSON_CONTAINS, ...)modifier (JSON_SET, JSON_INSERT, JSON_REMOVE, ...)création de tableaux et d'objets (JSON_ARRAY, JSON_OBJECT)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
48 / 90
![Page 49: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/49.jpg)
Support JSONType natif de données (native datatype)Valeurs en JSON stockées dans des tables MySQLFormat de stokage JSON en binaire (UTF8MB4)Conversion à partir des types SQL "natifs" vers des valeurs JSONFunctions de manipulation du JSON
extraire (JSON_EXTRACT, JSON_KEYS, ...)inpecter (JSON_CONTAINS, ...)modifier (JSON_SET, JSON_INSERT, JSON_REMOVE, ...)création de tableaux et d'objets (JSON_ARRAY, JSON_OBJECT)recherche d'objets (JSON_SEARCH)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
49 / 90
![Page 50: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/50.jpg)
Support JSON (2)Inline SQL JSON path expressions
SELECT doc->'$.object.array[0].item' FROM some_table
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
50 / 90
![Page 51: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/51.jpg)
Support JSON (2)Inline SQL JSON path expressions
SELECT doc->'$.object.array[0].item' FROM some_table
Opérateurs booléens (comparaison de valeurs JSON, ...)
foo = doc->'$.�eld'
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
51 / 90
![Page 52: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/52.jpg)
Support JSON (3)
le meilleur pour la fin...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
52 / 90
![Page 53: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/53.jpg)
Support JSON (3)
le meilleur pour la fin...
Colonnes Générées/Virtuelles (generated/virtual columns)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
53 / 90
![Page 54: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/54.jpg)
Support JSON (3)
le meilleur pour la fin...
Colonnes Générées/Virtuelles (generated/virtual columns)Index de données JSON
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
54 / 90
![Page 55: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/55.jpg)
Support JSON (3)
le meilleur pour la fin...
Colonnes Générées/Virtuelles (generated/virtual columns)Index de données JSONClés étrangères vers données JSON
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
55 / 90
![Page 56: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/56.jpg)
Support JSON (3)
le meilleur pour la fin...
Colonnes Générées/Virtuelles (generated/virtual columns)Index de données JSONClés étrangères vers données JSONVues SQL pour des données JSON
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
56 / 90
![Page 57: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/57.jpg)
Support JSON (3)
le meilleur pour la fin...
Colonnes Générées/Virtuelles (generated/virtual columns)Index de données JSONClés étrangères vers données JSONVues SQL pour des données JSON
ALTER TABLE test_features ADD COLUMN street VARCHAR(30) GENERATED ALWAYS AS (json_unquote(json_extract(`feature`,'$.properties.STREET'))) VIRTUAL;
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
57 / 90
![Page 58: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/58.jpg)
Document Store
Opérations CRUD
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
58 / 90
![Page 59: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/59.jpg)
Opérations CRUDCreate, Read, Update et Delete (CRUD) sont les 4 opérations qui peuvent être exécutéessur une collection (Document Store Schema) ou une table.
CREATE - collection.add()
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
59 / 90
![Page 60: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/60.jpg)
Opérations CRUD (2)
READ - collection.find()
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
60 / 90
![Page 61: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/61.jpg)
Opérations CRUD (3)
UPDATE - collection.modify()
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
61 / 90
![Page 62: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/62.jpg)
Opérations CRUD (4)
DELETE - collection.remove()
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
62 / 90
![Page 63: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/63.jpg)
Document Store
X Plugin
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
63 / 90
![Page 64: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/64.jpg)
X PluginPlugin du serveur MySQL qui active la communication en utilisant le X Protocol.
Ce pluging:
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
64 / 90
![Page 65: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/65.jpg)
X PluginPlugin du serveur MySQL qui active la communication en utilisant le X Protocol.
Ce pluging:
supporte les clients ayant implémenté le X DevAPI
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
65 / 90
![Page 66: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/66.jpg)
X PluginPlugin du serveur MySQL qui active la communication en utilisant le X Protocol.
Ce pluging:
supporte les clients ayant implémenté le X DevAPItransforme MySQL en Document Store.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
66 / 90
![Page 67: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/67.jpg)
X PluginPlugin du serveur MySQL qui active la communication en utilisant le X Protocol.
Ce pluging:
supporte les clients ayant implémenté le X DevAPItransforme MySQL en Document Store.
mysql> INSTALL PLUGIN mysqlx SONAME "mysqlx.so"
ou
mysqlsh -u user --classic --dba enableXProtocol
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
67 / 90
![Page 68: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/68.jpg)
Document Store
X Protocol
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
68 / 90
![Page 69: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/69.jpg)
X ProtocolProtocole qui permet de communiquer avec un MySQL Server sur lequel X Plugin est activé.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
69 / 90
![Page 70: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/70.jpg)
X ProtocolProtocole qui permet de communiquer avec un MySQL Server sur lequel X Plugin est activé.
Et donc le X Protocol permet d´effectuer des opéarations CRUD et SQL, l´authentificationvia SASL, le "streaming" (pipelining) des commandes.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
70 / 90
![Page 71: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/71.jpg)
Document Store
The X DevAPI
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
71 / 90
![Page 72: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/72.jpg)
Opérations orientées Document via SQLTrès puissant
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
72 / 90
![Page 73: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/73.jpg)
Opérations orientées Document via SQLTrès puissantPermet la construction de requêtes complexes
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
73 / 90
![Page 74: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/74.jpg)
Opérations orientées Document via SQLTrès puissantPermet la construction de requêtes complexesMais... encore et toujours difficile à utiliser pour les non initiés
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
74 / 90
![Page 75: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/75.jpg)
Opérations orientées Document via SQLTrès puissantPermet la construction de requêtes complexesMais... encore et toujours difficile à utiliser pour les non initiés
CREATE TABLE product ( id VARCHAR(32) GENERATED ALWAYS AS (JSON_EXTRACT(doc, '$.id')) STORED, doc JSON);INSERT INTO product VALUYES (1, '{...}');SELECT * FROM product WHERE JSON_EXTRACT(doc, '$.�eld') = value;
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
75 / 90
![Page 76: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/76.jpg)
The X DevAPIAbstraction au-dessus de SQL
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
76 / 90
![Page 77: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/77.jpg)
The X DevAPIAbstraction au-dessus de SQLAxé sur 4 opérations CRUD de base (Create, Read, Update, Delete)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
77 / 90
![Page 78: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/78.jpg)
The X DevAPIAbstraction au-dessus de SQLAxé sur 4 opérations CRUD de base (Create, Read, Update, Delete)Native Language API
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
78 / 90
![Page 79: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/79.jpg)
The X DevAPIAbstraction au-dessus de SQLAxé sur 4 opérations CRUD de base (Create, Read, Update, Delete)Native Language APIPas nécessaire de connaître le SQL
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
79 / 90
![Page 80: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/80.jpg)
The X DevAPIAbstraction au-dessus de SQLAxé sur 4 opérations CRUD de base (Create, Read, Update, Delete)Native Language APIPas nécessaire de connaître le SQLX Protocol
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
80 / 90
![Page 81: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/81.jpg)
The X DevAPIAbstraction au-dessus de SQLAxé sur 4 opérations CRUD de base (Create, Read, Update, Delete)Native Language APIPas nécessaire de connaître le SQLX Protocol
les requêtes CRUD sont encodées au niveau du protocol
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
81 / 90
![Page 82: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/82.jpg)
Exemplemysql-py> mybooks.�nd("Title LIKE 'Und%'")[ { "Authors": [ "Alexander Sasha Pachev", "Sasha Pachev" ], "ISBN-13": "9780596009571", "Language": "en", "Publisher": ""O'Reilly Media, Inc."", "Title": "Understanding MySQL Internals", "Year": "2007", "_id": "ce9fd5b762ffe6117055685b359e77d5" }]
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
82 / 90
![Page 83: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/83.jpg)
Exemplemysql-py> mybooks.�nd("Title LIKE 'Und%'")[ { "Authors": [ "Alexander Sasha Pachev", "Sasha Pachev" ], "ISBN-13": "9780596009571", "Language": "en", "Publisher": ""O'Reilly Media, Inc."", "Title": "Understanding MySQL Internals", "Year": "2007", "_id": "ce9fd5b762ffe6117055685b359e77d5" }]
Et MySQL le transforme de manière transparente en:
SELECT doc FROM `books`.`mybooks` WHERE (JSON_UNQUOTE(JSON_EXTRACT(doc,'$.Title')) LIKE 'Und%');
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
83 / 90
![Page 84: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/84.jpg)
Document Store & X DevAPI & MySQL Shell
petite démo ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
84 / 90
![Page 85: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/85.jpg)
Démo (1)[fred@imac2 ~] $ mysqlsh --py Welcome to MySQL Shell 1.0.8-rc
Copyright (c) 2016, 2017, Oracle and/or its af�liates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or itsaf�liates. Other names may be trademarks of their respectiveowners.
Type '\help', '\h' or '\?' for help, type '\quit' or '\q' to exit.
Currently in Python mode. Use \sql to switch to SQL mode and execute queries.mysql-py> \c root@localhostCreating a Session to 'root@localhost'Enter password: Node Session successfully established. No default schema selected.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
85 / 90
![Page 86: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/86.jpg)
Démo (2)mysql-py> db=session.create_schema("books")mysql-py> mybooks=db.create_collection('mybooks')
mysql-py> from isbntools.app import *
mysql-py> isbn=9781449314286mysql-py> doc=meta(str(isbn))mysql-py> doc["Annee"]=doc.pop("Year")mysql-py> mybooks.add(doc)Query OK, 1 item affected (0.10 sec)
mysql-py> isbn=9780596009571mysql-py> doc=meta(str(isbn))mysql-py> doc["Annee"]=doc.pop("Year")mysql-py> mybooks.add(doc)
mysql-py> isbn=9781430230571mysql-py> doc=meta(str(isbn))mysql-py> doc["Annee"]=doc.pop("Year")mysql-py> mybooks.add(doc)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
86 / 90
![Page 87: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/87.jpg)
Démo (3)mysql-py> mybooks.�nd()[ { "Authors": [ "Baron Schwartz", "Peter Zaitsev", "Vadim Tkachenko" ], "ISBN-13": "9781449314286", "Language": "en", "Publisher": ""O'Reilly Media, Inc."", "Title": "High Performance MySQL", "Annee": "2012", "_id": "66f01d3762ffe6117055685b359e77d5" }, ...]3 documents in set (0.00 sec)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
87 / 90
![Page 88: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/88.jpg)
Démo (4)mysql-py> mybooks.�nd("Title LIKE '%MySQL%'").�elds(["Title","Annee"]).sort("Annee")[ { "Annee": "2007", "Title": "Understanding MySQL Internals" }, { "Annee": "2012", "Title": "High Performance MySQL" }]
mysql-py> mybooks.create_index("Annee_idx").�eld("Annee","TEXT(4)", False).execute();
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
88 / 90
![Page 89: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/89.jpg)
Démo (5)mysql> show create table books.mybooks\G *************************** 1. row *************************** Table: mybooksCreate Table: CREATE TABLE `mybooks` ( `doc` json DEFAULT NULL, `_id` varchar(32) GENERATED ALWAYS AS (json_unquote(json_extract(`doc`,'$._id'))) STORED NOT NULL, `$ix_t4_589943C550621CA4FF9A742745C76C955B6DDE8E` text GENERATED ALWAYS AS (json_unquote(json_extract(`doc`,'$.Annee'))) VIRTUAL, PRIMARY KEY (`_id`), KEY `Annee_idx` (`$ix_t4_589943C550621CA4FF9A742745C76C955B6DDE8E`(4))) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
89 / 90
![Page 90: Jeudis du Libre - MySQL comme Document Store](https://reader034.vdocuments.net/reader034/viewer/2022052405/58d1a3d51a28ab6f6b8b5a93/html5/thumbnails/90.jpg)
Merci
Des Questions ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
90 / 90