SlideShare a Scribd company logo
1 / 33
2 / 33
Percona Live Europe - Dublin 2017
MySQL Document Store - demo
when SQL & NoSQL live together... in peace !
 
 
 
Frédéric Descamps - MySQL Community Manager - Oracle
3 / 33
 
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purpose only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied up in
making purchasing decisions. The development, release and timing of any features or
functionality described for Oracle´s product remains at the sole discretion of Oracle.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
4 / 33
http://about.me/lefred
Who am I ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
5 / 33
Frédéric Descamps
@lefred
MySQL Evangelist
Hacking MySQL since 3.23
devops believer
MySQL Community Manager since May
2016
living in Belgium 🇧🇪
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
6 / 33
7 / 33
How DBAs see data
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
8 / 33
How DBAs see data How Developers see data
{
"GNP" : 249704,
"Name" : "Belgium",
"government" : {
"GovernmentForm" :
"Constitutional Monarchy, Federation",
"HeadOfState" : "Philippe I"
},
"_id" : "BEL",
"IndepYear" : 1830,
"demographics" : {
"Population" : 10239000,
"LifeExpectancy" : 77.8000030517578
},
"geography" : {
"Region" : "Western Europe",
"SurfaceArea" : 30518,
"Continent" : "Europe"
}
}
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
9 / 33
DMBS or NoSQL ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
10 / 33
DMBS or NoSQL ?
Why not both ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
11 / 33
Install X Plugin
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
12 / 33
Connect and create your first schema
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
13 / 33
We need data !
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
14 / 33
Migration from MongoDB to MySQL DS
For this example, I will use the well known restaurants collection:
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
15 / 33
Migration from MongoDB to MySQL DS
For this example, I will use the well known restaurants collection:
We need to dump the data to a file and we will use MySQL Shell with the Python
interpreter to load the data.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
16 / 33
Dump and load using MySQL Shell & Python
this example is inspired by @datacharmer's work:
https://www.slideshare.net/datacharmer/mysql-documentstore
$ mongo --quiet --eval 'DBQuery.shellBatchSize=30000;
db.restaurants. nd().shellPrint()' 
| perl -pe 's/(?:ObjectId|ISODate)(("[^"]+"))/ $1/g' > all_recs.json
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
17 / 33
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
18 / 33
Let´s play and query some data !
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
19 / 33
Syntax slightly different than MongoDB
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
20 / 33
Syntax slightly different than MongoDB
> db.restaurants. nd({"cuisine": "French",
"borough": { $not: /^Manhattan/} },
{"_id":0, "name": 1,"cuisine": 1, "borough": 1}).limit(2)
{ "borough" : "Queens", "cuisine" : "French",
"name" : "La Baraka Restaurant" }
{ "borough" : "Queens", "cuisine" : "French",
"name" : "Air France Lounge" }
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
21 / 33
Let´s try other CRUD operations
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
22 / 33
And what about my old friend SQL ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
23 / 33
Queries using JSON...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
24 / 33
Add virtual columns
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
25 / 33
Add indexes
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
26 / 33
what do I gain ?
Conclusion
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
27 / 33
schemaless
flexible data structure
easy to start (CRUD)
Conclusion
This is the best of the two worlds in one product !
Data integrity
ACID Compliant
SQL
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
28 / 33
Do we have still time for something cool ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
29 / 33
Let´s do it !
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
30 / 33
The Challenge
Create a collection of books and add some books with all their data in +/- 5 minutes !
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
31 / 33
The Challenge
Create a collection of books and add some books with all their data in +/- 5 minutes !
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
32 / 33
Thank you !
Any Questions ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
33 / 33

More Related Content

PDF
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
PDF
Introduction to MySQL InnoDB Cluster
PDF
MySQL InnoDB Cluster in a Nutshell - Hands-on Lab
PDF
Introduction to MySQL InnoDB Cluster
PDF
MySQL InnoDB Cluster and Group Replication in a Nutshell
PDF
Introduction to MySQL InnoDB Cluster
PDF
FOSDEM MySQL & Friends Devroom, February 2018 MySQL Point-in-Time Recovery l...
PDF
MySQL Community Meetup in China : Innovation driven by the Community
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
Introduction to MySQL InnoDB Cluster
MySQL InnoDB Cluster in a Nutshell - Hands-on Lab
Introduction to MySQL InnoDB Cluster
MySQL InnoDB Cluster and Group Replication in a Nutshell
Introduction to MySQL InnoDB Cluster
FOSDEM MySQL & Friends Devroom, February 2018 MySQL Point-in-Time Recovery l...
MySQL Community Meetup in China : Innovation driven by the Community

What's hot (20)

PDF
pre-FOSDEM MySQL day, February 2018 - MySQL Document Store
PDF
MySQL Innovation: from 5.7 to 8.0
PDF
DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...
PDF
Introduction to MySQL InnoDB Cluster
PDF
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
PDF
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
PDF
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
PDF
Swedish MySQL User Group - MySQL InnoDB Cluster
PDF
Introduction to MySQL Document Store
PDF
Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
PDF
MySQL User Group NL: MySQL 8.0 Document Store- NoSQL with all the benefits of...
PDF
High Availability in MySQL 8 using InnoDB Cluster
PDF
MySQL Innovation Day Chicago - MySQL HA So Easy : That's insane !!
PDF
Boston meetup : MySQL Innodb Cluster - May 1st 2017
PDF
Oracle Open World 2018 / Code One : MySQL 8.0 High Availability with MySQL I...
PDF
Oracle Open World 2018 / Code One : MySQL 8.0 Document Store
PDF
Percona Live Europe 2018 MySQL Group Replication... the magic explained
PDF
Helsinki MySQL User Group - MySQL InnoDB Cluster
PDF
MySQL InnoDB Cluster and Group Replication in a Nutshell: hands-on tutorial
PDF
Group Replication: A Journey to the Group Communication Core
pre-FOSDEM MySQL day, February 2018 - MySQL Document Store
MySQL Innovation: from 5.7 to 8.0
DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...
Introduction to MySQL InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
Swedish MySQL User Group - MySQL InnoDB Cluster
Introduction to MySQL Document Store
Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
MySQL User Group NL: MySQL 8.0 Document Store- NoSQL with all the benefits of...
High Availability in MySQL 8 using InnoDB Cluster
MySQL Innovation Day Chicago - MySQL HA So Easy : That's insane !!
Boston meetup : MySQL Innodb Cluster - May 1st 2017
Oracle Open World 2018 / Code One : MySQL 8.0 High Availability with MySQL I...
Oracle Open World 2018 / Code One : MySQL 8.0 Document Store
Percona Live Europe 2018 MySQL Group Replication... the magic explained
Helsinki MySQL User Group - MySQL InnoDB Cluster
MySQL InnoDB Cluster and Group Replication in a Nutshell: hands-on tutorial
Group Replication: A Journey to the Group Communication Core
Ad

Similar to MySQL Document Store - when SQL & NoSQL live together... in peace! (20)

PDF
MySQL without the SQL -- Cascadia PHP
PDF
Oracle Code Event - MySQL JSON Document Store
PDF
Oracle Code Roma: NoSQL + SQL = MySQL
PDF
MySQL Without The SQL -- Oh My! PHP Detroit July 2018
PPTX
A Step by Step Introduction to the MySQL Document Store
PDF
Looking Inside the MySQL 8.0 Document Store
PDF
MySQL Document Store (Oracle Code Warsaw 2018)
PDF
MySQL Day Paris 2018 - MySQL JSON Document Store
PDF
Python and MySQL 8.0 Document Store
PDF
MySQL JSON Document Store - A Document Store with all the benefits of a Trans...
PDF
MySQL Document Store -- SCaLE 17x Presentation
PDF
PDF
MySQL 8.0 Document Store - Discovery of a New World
PDF
MySQL Day Paris 2016 - MySQL as a Document Store
PPTX
MySQL Without the SQL -- Oh My! Longhorn PHP Conference
PDF
MySQL Without the SQL - Oh My! August 2nd presentation at Mid Atlantic Develo...
PDF
MySQL Document Store
PDF
Open Source World June '21 -- JSON Within a Relational Database
PDF
Json within a relational database
PDF
MySQL 8.0 Introduction to NoSQL + SQL
MySQL without the SQL -- Cascadia PHP
Oracle Code Event - MySQL JSON Document Store
Oracle Code Roma: NoSQL + SQL = MySQL
MySQL Without The SQL -- Oh My! PHP Detroit July 2018
A Step by Step Introduction to the MySQL Document Store
Looking Inside the MySQL 8.0 Document Store
MySQL Document Store (Oracle Code Warsaw 2018)
MySQL Day Paris 2018 - MySQL JSON Document Store
Python and MySQL 8.0 Document Store
MySQL JSON Document Store - A Document Store with all the benefits of a Trans...
MySQL Document Store -- SCaLE 17x Presentation
MySQL 8.0 Document Store - Discovery of a New World
MySQL Day Paris 2016 - MySQL as a Document Store
MySQL Without the SQL -- Oh My! Longhorn PHP Conference
MySQL Without the SQL - Oh My! August 2nd presentation at Mid Atlantic Develo...
MySQL Document Store
Open Source World June '21 -- JSON Within a Relational Database
Json within a relational database
MySQL 8.0 Introduction to NoSQL + SQL
Ad

More from Frederic Descamps (20)

PDF
MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
PDF
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
PDF
RivieraJUG - MySQL Indexes and Histograms
PDF
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
PDF
MySQL User Group NL - MySQL 8
PDF
State of the Dolphin - May 2022
PDF
Percona Live 2022 - MySQL Shell for Visual Studio Code
PDF
Percona Live 2022 - The Evolution of a MySQL Database System
PDF
Percona Live 2022 - MySQL Architectures
PDF
LinuxFest Northwest 2022 - The Evolution of a MySQL Database System
PDF
Open Source 101 2022 - MySQL Indexes and Histograms
PDF
Pi Day 2022 - from IoT to MySQL HeatWave Database Service
PDF
Confoo 2022 - le cycle d'une instance MySQL
PDF
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...
PDF
Les nouveautés de MySQL 8.0
PDF
Les nouveautés de MySQL 8.0
PDF
State of The Dolphin - May 2021
PDF
MySQL Shell for DBAs
PDF
Deploying Magento on OCI with MDS
PDF
MySQL Router REST API
MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
RivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
MySQL User Group NL - MySQL 8
State of the Dolphin - May 2022
Percona Live 2022 - MySQL Shell for Visual Studio Code
Percona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - MySQL Architectures
LinuxFest Northwest 2022 - The Evolution of a MySQL Database System
Open Source 101 2022 - MySQL Indexes and Histograms
Pi Day 2022 - from IoT to MySQL HeatWave Database Service
Confoo 2022 - le cycle d'une instance MySQL
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...
Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0
State of The Dolphin - May 2021
MySQL Shell for DBAs
Deploying Magento on OCI with MDS
MySQL Router REST API

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Network Security Unit 5.pdf for BCA BBA.
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
Teaching material agriculture food technology
PPTX
A Presentation on Artificial Intelligence
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
sap open course for s4hana steps from ECC to s4
Encapsulation theory and applications.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
MIND Revenue Release Quarter 2 2025 Press Release
Building Integrated photovoltaic BIPV_UPV.pdf
Spectral efficient network and resource selection model in 5G networks
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Unlocking AI with Model Context Protocol (MCP)
Encapsulation_ Review paper, used for researhc scholars
Mobile App Security Testing_ A Comprehensive Guide.pdf
Machine learning based COVID-19 study performance prediction
Digital-Transformation-Roadmap-for-Companies.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Network Security Unit 5.pdf for BCA BBA.
The AUB Centre for AI in Media Proposal.docx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Teaching material agriculture food technology
A Presentation on Artificial Intelligence
Reach Out and Touch Someone: Haptics and Empathic Computing
sap open course for s4hana steps from ECC to s4

MySQL Document Store - when SQL & NoSQL live together... in peace!

  • 3. Percona Live Europe - Dublin 2017 MySQL Document Store - demo when SQL & NoSQL live together... in peace !       Frédéric Descamps - MySQL Community Manager - Oracle 3 / 33
  • 4.   Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purpose only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied up in making purchasing decisions. The development, release and timing of any features or functionality described for Oracle´s product remains at the sole discretion of Oracle. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 4 / 33
  • 5. http://about.me/lefred Who am I ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 5 / 33
  • 6. Frédéric Descamps @lefred MySQL Evangelist Hacking MySQL since 3.23 devops believer MySQL Community Manager since May 2016 living in Belgium 🇧🇪 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 6 / 33
  • 8. How DBAs see data Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 8 / 33
  • 9. How DBAs see data How Developers see data { "GNP" : 249704, "Name" : "Belgium", "government" : { "GovernmentForm" : "Constitutional Monarchy, Federation", "HeadOfState" : "Philippe I" }, "_id" : "BEL", "IndepYear" : 1830, "demographics" : { "Population" : 10239000, "LifeExpectancy" : 77.8000030517578 }, "geography" : { "Region" : "Western Europe", "SurfaceArea" : 30518, "Continent" : "Europe" } } Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 9 / 33
  • 10. DMBS or NoSQL ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 10 / 33
  • 11. DMBS or NoSQL ? Why not both ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 11 / 33
  • 12. Install X Plugin Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 12 / 33
  • 13. Connect and create your first schema Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 13 / 33
  • 14. We need data ! Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 14 / 33
  • 15. Migration from MongoDB to MySQL DS For this example, I will use the well known restaurants collection: Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 15 / 33
  • 16. Migration from MongoDB to MySQL DS For this example, I will use the well known restaurants collection: We need to dump the data to a file and we will use MySQL Shell with the Python interpreter to load the data. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 16 / 33
  • 17. Dump and load using MySQL Shell & Python this example is inspired by @datacharmer's work: https://www.slideshare.net/datacharmer/mysql-documentstore $ mongo --quiet --eval 'DBQuery.shellBatchSize=30000; db.restaurants. nd().shellPrint()' | perl -pe 's/(?:ObjectId|ISODate)(("[^"]+"))/ $1/g' > all_recs.json Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 17 / 33
  • 18. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 18 / 33
  • 19. Let´s play and query some data ! Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 19 / 33
  • 20. Syntax slightly different than MongoDB Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 20 / 33
  • 21. Syntax slightly different than MongoDB > db.restaurants. nd({"cuisine": "French", "borough": { $not: /^Manhattan/} }, {"_id":0, "name": 1,"cuisine": 1, "borough": 1}).limit(2) { "borough" : "Queens", "cuisine" : "French", "name" : "La Baraka Restaurant" } { "borough" : "Queens", "cuisine" : "French", "name" : "Air France Lounge" } Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 21 / 33
  • 22. Let´s try other CRUD operations Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 22 / 33
  • 23. And what about my old friend SQL ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 23 / 33
  • 24. Queries using JSON... Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 24 / 33
  • 25. Add virtual columns Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 25 / 33
  • 26. Add indexes Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 26 / 33
  • 27. what do I gain ? Conclusion Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 27 / 33
  • 28. schemaless flexible data structure easy to start (CRUD) Conclusion This is the best of the two worlds in one product ! Data integrity ACID Compliant SQL Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 28 / 33
  • 29. Do we have still time for something cool ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 29 / 33
  • 30. Let´s do it ! Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 30 / 33
  • 31. The Challenge Create a collection of books and add some books with all their data in +/- 5 minutes ! Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 31 / 33
  • 32. The Challenge Create a collection of books and add some books with all their data in +/- 5 minutes ! Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 32 / 33
  • 33. Thank you ! Any Questions ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 33 / 33