SlideShare ist ein Scribd-Unternehmen logo
1 von 143
Downloaden Sie, um offline zu lesen
Frédéric Descamps
Community Manager
MySQL
October 2020
MySQL 8.0 Document Store
discovery of a new world
Who am I ?
about.me/lefred
Copyright @ 2020 Oracle and/or its affiliates.2
Frédéric Descamps
@lefred
MySQL Evangelist
Managing MySQL since 3.20 !
devops believer
living in Belgium
h ps://lefred.be
Copyright @ 2020 Oracle and/or its affiliates.3
MySQL
#MySQl8isGreat
Copyright @ 2020 Oracle and/or its affiliates.4
MySQL is the DBMS of the Year 2019 !
Copyright @ 2020 Oracle and/or its affiliates.5
Happy 25th Anniversary MySQL
Copyright @ 2020 Oracle and/or its affiliates.6
Evolution...
from LAMP stack to modern Web applications
Copyright @ 2020 Oracle and/or its affiliates.7
Web Applications 2000's
Who ?
Copyright @ 2020 Oracle and/or its affiliates.8
Web Applications 2000's
Who ?
Copyright @ 2020 Oracle and/or its affiliates.8
Web Applications 2000's
How ?
Copyright @ 2020 Oracle and/or its affiliates.9
Web Applications 2000's
How ?
Copyright @ 2020 Oracle and/or its affiliates.9
Relational Databases
Data Integrity
Copyright @ 2020 Oracle and/or its affiliates.10
Relational Databases
Data Integrity
normalization
Copyright @ 2020 Oracle and/or its affiliates.10
Relational Databases
Data Integrity
normalization
constraints (foreign keys, ...)
Copyright @ 2020 Oracle and/or its affiliates.10
Relational Databases
Data Integrity
normalization
constraints (foreign keys, ...)
Atomicity, Consistency, Isolation, Durability
Copyright @ 2020 Oracle and/or its affiliates.10
Relational Databases
Data Integrity
normalization
constraints (foreign keys, ...)
Atomicity, Consistency, Isolation, Durability
ACID compliant
Copyright @ 2020 Oracle and/or its affiliates.10
Relational Databases
Data Integrity
normalization
constraints (foreign keys, ...)
Atomicity, Consistency, Isolation, Durability
ACID compliant
transactions
Copyright @ 2020 Oracle and/or its affiliates.10
Relational Databases
Data Integrity
normalization
constraints (foreign keys, ...)
Atomicity, Consistency, Isolation, Durability
ACID compliant
transactions
SQL
Copyright @ 2020 Oracle and/or its affiliates.10
Relational Databases
Data Integrity
normalization
constraints (foreign keys, ...)
Atomicity, Consistency, Isolation, Durability
ACID compliant
transactions
SQL
powerfull query language
Copyright @ 2020 Oracle and/or its affiliates.10
Web Applications current days
Who ?
Copyright @ 2020 Oracle and/or its affiliates.11
Web Applications current days
Who ?
Copyright @ 2020 Oracle and/or its affiliates.11
Web Applications current days
How ?
Copyright @ 2020 Oracle and/or its affiliates.12
Web Applications current days
Why ?
Copyright @ 2020 Oracle and/or its affiliates.13
Web Applications current days
Why ?
Developers don't really like SQL anymore...
 
Copyright @ 2020 Oracle and/or its affiliates.13
SQL can be complicated and slows down the
initial development
Web Applications current days
Why ?
Copyright @ 2020 Oracle and/or its affiliates.14
Developers don't have time to learn SQL,
they need time to workout and have a nice
look ;-)
Web Applications current days
Why ?
Copyright @ 2020 Oracle and/or its affiliates.15
What do developers want ?
easy operations
Copyright @ 2020 Oracle and/or its affiliates.16
Use Objects / Documents
Developers want just to use objects
Copyright @ 2020 Oracle and/or its affiliates.17
Use Objects / Documents
Developers want just to use objects
that's why they usually love what DBAs hate the most ORMs !
Copyright @ 2020 Oracle and/or its affiliates.17
Use Objects / Documents
Developers want just to use objects
that's why they usually love what DBAs hate the most ORMs !
They want to deal with these objects easily (CRUD operations) and they don't want to think
about schema design (slows down the initial development process).
Copyright @ 2020 Oracle and/or its affiliates.17
Use Objects / Documents
Developers want just to use objects
that's why they usually love what DBAs hate the most ORMs !
They want to deal with these objects easily (CRUD operations) and they don't want to think
about schema design (slows down the initial development process).
But they also want to keep their data safe and use transactions.
Copyright @ 2020 Oracle and/or its affiliates.17
Web Applications current days
How ?
Copyright @ 2020 Oracle and/or its affiliates.18
Web Applications current days
How ?
Copyright @ 2020 Oracle and/or its affiliates.18
NoSQL Databases
JSON Document Store
Copyright @ 2020 Oracle and/or its affiliates.19
NoSQL Document Store
Schemaless
Copyright @ 2020 Oracle and/or its affiliates.20
NoSQL Document Store
Schemaless
no schema design, no normalization, no foreign keys, no data types, ...
Copyright @ 2020 Oracle and/or its affiliates.20
NoSQL Document Store
Schemaless
no schema design, no normalization, no foreign keys, no data types, ...
very quick initial development
Copyright @ 2020 Oracle and/or its affiliates.20
NoSQL Document Store
Schemaless
no schema design, no normalization, no foreign keys, no data types, ...
very quick initial development
Flexible data structure
Copyright @ 2020 Oracle and/or its affiliates.20
NoSQL Document Store
Schemaless
no schema design, no normalization, no foreign keys, no data types, ...
very quick initial development
Flexible data structure
embedded arrays or objects
Copyright @ 2020 Oracle and/or its affiliates.20
NoSQL Document Store
Schemaless
no schema design, no normalization, no foreign keys, no data types, ...
very quick initial development
Flexible data structure
embedded arrays or objects
valid solution when natural data can't be modelized optimaly into a relational model
Copyright @ 2020 Oracle and/or its affiliates.20
NoSQL Document Store
Schemaless
no schema design, no normalization, no foreign keys, no data types, ...
very quick initial development
Flexible data structure
embedded arrays or objects
valid solution when natural data can't be modelized optimaly into a relational model
objects persistance without the use of any ORM - mapping oobject-oriented
Copyright @ 2020 Oracle and/or its affiliates.20
NoSQL Document Store
Schemaless
no schema design, no normalization, no foreign keys, no data types, ...
very quick initial development
Flexible data structure
embedded arrays or objects
valid solution when natural data can't be modelized optimaly into a relational model
objects persistance without the use of any ORM - mapping oobject-oriented
JSON
Copyright @ 2020 Oracle and/or its affiliates.20
NoSQL Document Store
Schemaless
no schema design, no normalization, no foreign keys, no data types, ...
very quick initial development
Flexible data structure
embedded arrays or objects
valid solution when natural data can't be modelized optimaly into a relational model
objects persistance without the use of any ORM - mapping oobject-oriented
JSON
close to frontend
Copyright @ 2020 Oracle and/or its affiliates.20
NoSQL Document Store
Schemaless
no schema design, no normalization, no foreign keys, no data types, ...
very quick initial development
Flexible data structure
embedded arrays or objects
valid solution when natural data can't be modelized optimaly into a relational model
objects persistance without the use of any ORM - mapping oobject-oriented
JSON
close to frontend
easy to learn
Copyright @ 2020 Oracle and/or its affiliates.20
How DBAs see data
Copyright @ 2020 Oracle and/or its affiliates.21
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 @ 2020 Oracle and/or its affiliates.21
And they still need to do Analytics
SQL
SQL
SQL
Copyright @ 2020 Oracle and/or its affiliates.22
... mmm...how ?
?
SQL
SQL
SQL
Copyright @ 2020 Oracle and/or its affiliates.23
Help needed !
Who ?
Copyright @ 2020 Oracle and/or its affiliates.24
Help needed !
Who ?
Copyright @ 2020 Oracle and/or its affiliates.24
How ?
SQL
SQL
SQL
Copyright @ 2020 Oracle and/or its affiliates.25
What if there was a way to provide both SQL and NoSQL
on one stable platform that has proven stability on well
know technology with a large Community and a diverse
ecosystem ?
Copyright @ 2020 Oracle and/or its affiliates.26
DBMS or NoSQL ?
Copyright @ 2020 Oracle and/or its affiliates.27
DBMS or NoSQL ?
Why not both ?
Copyright @ 2020 Oracle and/or its affiliates.27
The MySQL Document Store !
SQL is now optional ?!
Copyright @ 2020 Oracle and/or its affiliates.28
SQL is now optional ?!
Copyright @ 2020 Oracle and/or its affiliates.29
Using MySQL Document Store !
SQL
SQL
SQL
Copyright @ 2020 Oracle and/or its affiliates.30
Developers:
[x] schemaless
[x] rapid prototying/simpler APIs
[x] document model
[x] transactions
Operations:
[x] performance
management/visibility
[x] robust replication, backup, restore
[x] comprehensive tooling ecosystem
[x] simpler application schema
upgrades
A solution for all
Business Owner:
[x] don't lose my data == ACID trx
[x] capture all my data =
extensible/schemaless
[x] product on schedule/time to
market = rapid developement
Copyright @ 2020 Oracle and/or its affiliates.31
the Solution
MySQL Document Store
Copyright @ 2020 Oracle and/or its affiliates.32
Built on
the MySQL
JSON Data
type and
Proven
MySQL
Server
Technology
Provides a schema exible JSON Document Store
No SQL required
No need to de ne all possible a ributes, tables, etc.
Uses new X DevAPI
Can leverage generated column to extract JSON values into
materialized columns that can be indexed for fast SQL searches.
Document can be ~1GB
It's a column in a row of a table
It cannot exceed max_allowed_packet
Allows use of modern programming styles
No more embedded strings of SQL in your code
Easy to read
Also works with relational Tables
Proven MySQL Technology
Copyright @ 2020 Oracle and/or its affiliates.33
X Protocol Connectors
Copyright @ 2020 Oracle and/or its affiliates.34
X DevAPI We provide connectors for
C++, Java, .Net, Node.js, Python, PHP
working with Communities to help them supporting it too
New MySQL Shell
Command Completion
Python, JavaScrips & SQL modes
Admin functions
New Util object
A new high-level session concept that can scale from single
MySQL server to a multiple server environment
Non-blocking, asynchronous calls follow common language pa erns
Supports CRUD operations
Copyright @ 2020 Oracle and/or its affiliates.35
Setup
MySQL Document Store
Copyright @ 2020 Oracle and/or its affiliates.36
Installing MySQL Document Store
install MySQL 8.0
Copyright @ 2020 Oracle and/or its affiliates.37
Installing MySQL Document Store
install MySQL 8.0
install MySQL Shell
Copyright @ 2020 Oracle and/or its affiliates.37
Installing MySQL Document Store
install MySQL 8.0
install MySQL Shell
install MySQL Connector for your programming language
Copyright @ 2020 Oracle and/or its affiliates.37
Installing MySQL Document Store
install MySQL 8.0
install MySQL Shell
install MySQL Connector for your programming language
php-pecl-mysql-xdevapi for PHP
mysql-connector-python for Python
...
Copyright @ 2020 Oracle and/or its affiliates.37
Installing MySQL Document Store
install MySQL 8.0
install MySQL Shell
install MySQL Connector for your programming language
php-pecl-mysql-xdevapi for PHP
mysql-connector-python for Python
...
And nothing else, no need to install anything else or load any plugin, just be sure your
rewall allows you to connect through port 33060 (X Protocol).
Copyright @ 2020 Oracle and/or its affiliates.37
MySQL Database Service
X Protocol is also available in MDS !!
Copyright @ 2020 Oracle and/or its affiliates.38
Migration from MongoDB to MySQL DS
For this example, I will use the well known restaurants collection:
Copyright @ 2020 Oracle and/or its affiliates.39
Migration from MongoDB to MySQL DS
For this example, I will use the well known restaurants collection:
Copyright @ 2020 Oracle and/or its affiliates.39
Copyright @ 2020 Oracle and/or its affiliates.40
Copyright @ 2020 Oracle and/or its affiliates.41
Let's make a query
Copyright @ 2020 Oracle and/or its affiliates.42
Let's make a query
That's too much records to show in here... let's limit it
Copyright @ 2020 Oracle and/or its affiliates.42
Copyright @ 2020 Oracle and/or its affiliates.43
Some more examples
Copyright @ 2020 Oracle and/or its affiliates.44
Let's add a selection criteria:
Copyright @ 2020 Oracle and/or its affiliates.45
Syntax slightly di erent than MongoDB
Copyright @ 2020 Oracle and/or its affiliates.46
Syntax slightly di erent than MongoDB
Copyright @ 2020 Oracle and/or its affiliates.46
And for developers ?
Copyright @ 2020 Oracle and/or its affiliates.47
And for developers ?
$session = mysql_xdevapigetSession("mysqlx://fred:MyP@ssw0rd%@localhost");
$schema = $session->getSchema("docstore");
$collection = $schema->getCollection("restaurants");
$results = $collection-> nd($search)->execute()->fetchAll();
...
foreach ($results as $doc) {
echo "<tr><td><a href='?id=${doc[_id]}'>${doc[name]}</a></td>";
echo "<td>${doc[borough]}</td><td>${doc[cuisine]}</td></tr>";
}
Copyright @ 2020 Oracle and/or its affiliates.48
And for developers ?
$session = mysql_xdevapigetSession("mysqlx://fred:MyP@ssw0rd%@localhost");
$schema = $session->getSchema("docstore");
$collection = $schema->getCollection("restaurants");
$results = $collection-> nd($search)->execute()->fetchAll();
...
foreach ($results as $doc) {
echo "<tr><td><a href='?id=${doc[_id]}'>${doc[name]}</a></td>";
echo "<td>${doc[borough]}</td><td>${doc[cuisine]}</td></tr>";
}
 
Easy, using only CRUD operations !
Copyright @ 2020 Oracle and/or its affiliates.48
And for developers ?
$session = mysql_xdevapigetSession("mysqlx://fred:MyP@ssw0rd%@localhost");
$schema = $session->getSchema("docstore");
$collection = $schema->getCollection("restaurants");
$results = $collection-> nd($search)->execute()->fetchAll();
...
foreach ($results as $doc) {
echo "<tr><td><a href='?id=${doc[_id]}'>${doc[name]}</a></td>";
echo "<td>${doc[borough]}</td><td>${doc[cuisine]}</td></tr>";
}
 
Easy, using only CRUD operations !
Not a single SQL statement !
Copyright @ 2020 Oracle and/or its affiliates.48
CRUD operations
Copyright @ 2020 Oracle and/or its affiliates.49
CRUD operations for collections
Add a document
collection.add({ name: 'fred', age: 42 })
.add({ name: 'dave', age: 23 })
.execute()
collection.add([
{ name: 'dimo', age: 50 },
{ name: 'kenny', age: 25 }
]).execute()
Copyright @ 2020 Oracle and/or its affiliates.50
CRUD operations for collections
Modify a document
collection.modify('name = :name')
.bind('name', 'fred')
.set('age', 43)
.sort('name ASC')
.limit(1)
.execute()
collection.modify('name = :name')
.bind('name', 'fred')
.patch({ age: 43, active: false })
.sort('name DESC')
.limit(1)
.execute()
Copyright @ 2020 Oracle and/or its affiliates.51
CRUD operations for collections
Remove a document
collection.remove('name = :name')
.bind('name', 'fred')
.sort('age ASC')
.limit(1)
.execute()
Copyright @ 2020 Oracle and/or its affiliates.52
MySQL Document Store Objects Summary
Copyright @ 2020 Oracle and/or its affiliates.53
All you need to know is here:
h ps://dev.mysql.com/doc/x-devapi-userguide/en/crud-operations-overview.html
Copyright @ 2020 Oracle and/or its affiliates.54
MySQL Document Store
is Full ACID Compliant
we do care about your data
Copyright @ 2020 Oracle and/or its affiliates.55
Document Store Full ACID !
It relies on the proven MySQL InnoDB's strength & robustness:
Copyright @ 2020 Oracle and/or its affiliates.56
Document Store Full ACID !
It relies on the proven MySQL InnoDB's strength & robustness:
innodb_ ush_log_at_trx_commit = 1
Copyright @ 2020 Oracle and/or its affiliates.56
Document Store Full ACID !
It relies on the proven MySQL InnoDB's strength & robustness:
innodb_ ush_log_at_trx_commit = 1
innodb_doublewrite = ON
Copyright @ 2020 Oracle and/or its affiliates.56
Document Store Full ACID !
It relies on the proven MySQL InnoDB's strength & robustness:
innodb_ ush_log_at_trx_commit = 1
innodb_doublewrite = ON
sync_binlog = 1
Copyright @ 2020 Oracle and/or its affiliates.56
Document Store Full ACID !
It relies on the proven MySQL InnoDB's strength & robustness:
innodb_ ush_log_at_trx_commit = 1
innodb_doublewrite = ON
sync_binlog = 1
transaction_isolation = REPEATABLE-READ|READ-COMMITTED|...
Copyright @ 2020 Oracle and/or its affiliates.56
Document Store Full ACID !
It relies on the proven MySQL InnoDB's strength & robustness:
innodb_ ush_log_at_trx_commit = 1
innodb_doublewrite = ON
sync_binlog = 1
transaction_isolation = REPEATABLE-READ|READ-COMMITTED|...
We do care about your data !
Copyright @ 2020 Oracle and/or its affiliates.56
Full ACID - Transactions support
Copyright @ 2020 Oracle and/or its affiliates.57
Full ACID - Transactions support
Copyright @ 2020 Oracle and/or its affiliates.58
OK we have Document Store, CRUD and
ACID
but what makes MySQL Document Store unique ?
Copyright @ 2020 Oracle and/or its affiliates.59
Challenge: list the best restaurant of each type of food
and show the top 10, with the best one rst !
 
don't forget that all these restaurants are just JSON documents
Copyright @ 2020 Oracle and/or its affiliates.60
NoSQL as SQL - aggregation
Copyright @ 2020 Oracle and/or its affiliates.61
NoSQL as SQL - aggregation
Copyright @ 2020 Oracle and/or its affiliates.62
NoSQL as SQL - aggregation
Copyright @ 2020 Oracle and/or its affiliates.63
NoSQL as SQL - aggregation
Copyright @ 2020 Oracle and/or its affiliates.64
NoSQL or SQL
You have the possibility to write clean and neat code:
Copyright @ 2020 Oracle and/or its affiliates.65
NoSQL or SQL
You have the possibility to write clean and neat code:
$results = $collection-> nd('cuisine like "italian"')->execute()->fetchAll();
Copyright @ 2020 Oracle and/or its affiliates.65
NoSQL or SQL
You have the possibility to write clean and neat code:
$results = $collection-> nd('cuisine like "italian"')->execute()->fetchAll();
Or use SQL only when it's really needed:
Copyright @ 2020 Oracle and/or its affiliates.65
NoSQL or SQL
You have the possibility to write clean and neat code:
$results = $collection-> nd('cuisine like "italian"')->execute()->fetchAll();
Or use SQL only when it's really needed:
$results = $session->sql('WITH cte1 AS (SELECT doc->>"$.name" AS name,
doc->>"$.cuisine" AS cuisine,
(SELECT AVG(score) FROM JSON_TABLE(doc, "$.grades[*]" COLUMNS (score INT
PATH "$.score")) AS r) AS avg_score FROM docstore.restaurants)
SELECT *, RANK()
OVER ( PARTITION BY cuisine ORDER BY avg_score) AS `rank`
FROM cte1 ORDER BY `rank`, avg_score DESC LIMIT 10;')->execute();
Copyright @ 2020 Oracle and/or its affiliates.65
NoSQL or SQL
You have the possibility to write clean and neat code:
$results = $collection-> nd('cuisine like "italian"')->execute()->fetchAll();
Or use SQL only when it's really needed:
$results = $session->sql('WITH cte1 AS (SELECT doc->>"$.name" AS name,
doc->>"$.cuisine" AS cuisine,
(SELECT AVG(score) FROM JSON_TABLE(doc, "$.grades[*]" COLUMNS (score INT
PATH "$.score")) AS r) AS avg_score FROM docstore.restaurants)
SELECT *, RANK()
OVER ( PARTITION BY cuisine ORDER BY avg_score) AS `rank`
FROM cte1 ORDER BY `rank`, avg_score DESC LIMIT 10;')->execute();
All in the same MySQL X Session !
Copyright @ 2020 Oracle and/or its affiliates.65
You can mix NoSQL & SQL as you want
Copyright @ 2020 Oracle and/or its affiliates.66
Best of Both Worlds: JSON_TABLE
What are the maximum 10 ratings ever given to a restaurant?
Copyright @ 2020 Oracle and/or its affiliates.67
Best of Both Worlds: JSON_TABLE
What are the maximum 10 ratings ever given to a restaurant?
Cool... but my app only processes JSON !
Copyright @ 2020 Oracle and/or its affiliates.67
Best of Both Worlds: JSON_TABLE (2)
With JSON output:
Copyright @ 2020 Oracle and/or its affiliates.68
And the DBA ?
MySQL Document Store
Copyright @ 2020 Oracle and/or its affiliates.69
Role of the MySQL Document Store DBA ?
Copyright @ 2020 Oracle and/or its affiliates.70
nd the non optimal lookups
create the necessary indexes based on
the results
 
Role of the MySQL Document Store DBA ?
Copyright @ 2020 Oracle and/or its affiliates.70
Role of the MySQL Document Store DBA
Looking for full table scans:
SELECT schema_name, sum_rows_examined, (sum_rows_examined/exec_count) avg_rows_call,
format_time(total_latency) tot_lat, exec_count,
format_time(total_latency/exec_count) AS latency_per_call, query_sample_text
FROM sys.x$statements_with_full_table_scans AS t1
JOIN performance_schema.events_statements_summary_by_digest AS t2
ON t2.digest=t1.digest
WHERE schema_name = "docstore" AND query_sample_text LIKE '%select%'
ORDER BY (total_latency/exec_count) descG
Copyright @ 2020 Oracle and/or its affiliates.71
Role of the MySQL Document Store DBA
Looking for full table scans:
SELECT schema_name, sum_rows_examined, (sum_rows_examined/exec_count) avg_rows_call,
format_time(total_latency) tot_lat, exec_count,
format_time(total_latency/exec_count) AS latency_per_call, query_sample_text
FROM sys.x$statements_with_full_table_scans AS t1
JOIN performance_schema.events_statements_summary_by_digest AS t2
ON t2.digest=t1.digest
WHERE schema_name = "docstore" AND query_sample_text LIKE '%select%'
ORDER BY (total_latency/exec_count) descG
More info at h ps://lefred.be/content/mysql-8-0-if-i-should-optimize-only-one-query-
on-my-application-which-one-should-it-be/
Copyright @ 2020 Oracle and/or its affiliates.71
Role of the MySQL Document Store DBA (2)
Copyright @ 2020 Oracle and/or its affiliates.72
Role of the MySQL Document Store DBA (3)
Ge ing the Query Execution Plan:
Copyright @ 2020 Oracle and/or its affiliates.73
Role of the MySQL Document Store DBA (3)
Ge ing the Query Execution Plan:
It's indeed a full table scan !
Copyright @ 2020 Oracle and/or its affiliates.73
Role of the MySQL Document Store DBA (4)
MySQL supports also EXPLAIN ANALYZE !!
Copyright @ 2020 Oracle and/or its affiliates.74
Role of the MySQL Document Store DBA (5)
Create Indexes:
Copyright @ 2020 Oracle and/or its affiliates.75
Role of the MySQL Document Store DBA (5)
Create Indexes:
For the "old" experienced MySQL DBAs, you can instead use:
Copyright @ 2020 Oracle and/or its affiliates.75
INFO: JSON Notation Shortcut
Copyright @ 2020 Oracle and/or its affiliates.76
Role of the MySQL Document Store DBA (6)
Result:
Copyright @ 2020 Oracle and/or its affiliates.77
For the curious: a collection in SQL:
Copyright @ 2020 Oracle and/or its affiliates.78
Since MySQL 8.0.17
JSON Array Indexes
JSON Schema
JSON_SCHEMA_VALID(<json schema>,<json doc>)
JSON_SCHEMA_VALIDATION_REPORT(<json schema>,<json doc>)
Copyright @ 2020 Oracle and/or its affiliates.79
Index of a JSON array
A functional index over a JSON
expression
The expression evaluates to an array
Several index entries per row
One index entry per array element
General mechanism, currently used for
JSON arrays
Used to speed up array lookups
JSON_CONTAINS(...)
JSON_OVERLAPS(...)
MEMBER OF (...)
JSON Array Indexes
Copyright @ 2020 Oracle and/or its affiliates.80
JSON Array Indexes
Copyright @ 2020 Oracle and/or its affiliates.81
JSON Array Indexes (2)
Copyright @ 2020 Oracle and/or its affiliates.82
JSON_VALUE        (since 8.0.21)
This function is described in SQL 2016, chapter 6.27.
Copyright @ 2020 Oracle and/or its affiliates.83
CHECK CONSTRAINTS
MySQL 8.0 supports Check Constraints:
Copyright @ 2020 Oracle and/or its affiliates.84
JSON Schema Validation
Copyright @ 2020 Oracle and/or its affiliates.85
JSON Schema Validation (2)
Copyright @ 2020 Oracle and/or its affiliates.86
JSON Schema Validation (3)
And the best of both worlds:
Copyright @ 2020 Oracle and/or its affiliates.87
JSON Schema Validation (3)
And the best of both worlds:
And the result in action:
Copyright @ 2020 Oracle and/or its affiliates.87
JSON Schema Validation (3)
And the best of both worlds:
And the result in action:
Copyright @ 2020 Oracle and/or its affiliates.87
Conclusion
what do I gain ?
Copyright @ 2020 Oracle and/or its affiliates.88
schemaless
exible data structure
easy to start (CRUD)
Conclusion
This is the best of the two worlds in one product !
Data integrity
ACID Compliant
Transactions
SQL
Copyright @ 2020 Oracle and/or its affiliates.89
8.0
h p://lefred.be/content/top-10-reasons-for-nosql-
with-mysql/
Copyright @ 2020 Oracle and/or its affiliates.90
Q & A
Copyright @ 2020 Oracle and/or its affiliates.91

Weitere ähnliche Inhalte

Was ist angesagt?

Understanding my database through SQL*Plus using the free tool eDB360
Understanding my database through SQL*Plus using the free tool eDB360Understanding my database through SQL*Plus using the free tool eDB360
Understanding my database through SQL*Plus using the free tool eDB360
Carlos Sierra
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Aaron Shilo
 
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Carlos Sierra
 

Was ist angesagt? (20)

ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIESORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
 
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...
 
Oracle Database SQL Tuning Concept
Oracle Database SQL Tuning ConceptOracle Database SQL Tuning Concept
Oracle Database SQL Tuning Concept
 
Understanding my database through SQL*Plus using the free tool eDB360
Understanding my database through SQL*Plus using the free tool eDB360Understanding my database through SQL*Plus using the free tool eDB360
Understanding my database through SQL*Plus using the free tool eDB360
 
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentalsDB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 
DOAG Oracle Unified Audit in Multitenant Environments
DOAG Oracle Unified Audit in Multitenant EnvironmentsDOAG Oracle Unified Audit in Multitenant Environments
DOAG Oracle Unified Audit in Multitenant Environments
 
JSON improvements in MySQL 8.0
JSON improvements in MySQL 8.0JSON improvements in MySQL 8.0
JSON improvements in MySQL 8.0
 
Open Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and HistogramsOpen Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and Histograms
 
Pi Day 2022 - from IoT to MySQL HeatWave Database Service
Pi Day 2022 -  from IoT to MySQL HeatWave Database ServicePi Day 2022 -  from IoT to MySQL HeatWave Database Service
Pi Day 2022 - from IoT to MySQL HeatWave Database Service
 
New Generation Oracle RAC Performance
New Generation Oracle RAC PerformanceNew Generation Oracle RAC Performance
New Generation Oracle RAC Performance
 
Get to know PostgreSQL!
Get to know PostgreSQL!Get to know PostgreSQL!
Get to know PostgreSQL!
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
 
Deep review of LMS process
Deep review of LMS processDeep review of LMS process
Deep review of LMS process
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
 
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
 
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RACThe Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
 
Achieving Continuous Availability for Your Applications with Oracle MAA
Achieving Continuous Availability for Your Applications with Oracle MAAAchieving Continuous Availability for Your Applications with Oracle MAA
Achieving Continuous Availability for Your Applications with Oracle MAA
 
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLTop 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
 
Mvcc in postgreSQL 권건우
Mvcc in postgreSQL 권건우Mvcc in postgreSQL 권건우
Mvcc in postgreSQL 권건우
 

Ähnlich wie MySQL 8.0 Document Store - Discovery of a New World

Ähnlich wie MySQL 8.0 Document Store - Discovery of a New World (20)

OpenExpo Virtual Experience 2020: MySQL 8.0 Document Store - Discovery of a n...
OpenExpo Virtual Experience 2020: MySQL 8.0 Document Store - Discovery of a n...OpenExpo Virtual Experience 2020: MySQL 8.0 Document Store - Discovery of a n...
OpenExpo Virtual Experience 2020: MySQL 8.0 Document Store - Discovery of a n...
 
Looking Inside the MySQL 8.0 Document Store
Looking Inside the MySQL 8.0 Document StoreLooking Inside the MySQL 8.0 Document Store
Looking Inside the MySQL 8.0 Document Store
 
MySQL User Group NL: MySQL 8.0 Document Store- NoSQL with all the benefits of...
MySQL User Group NL: MySQL 8.0 Document Store- NoSQL with all the benefits of...MySQL User Group NL: MySQL 8.0 Document Store- NoSQL with all the benefits of...
MySQL User Group NL: MySQL 8.0 Document Store- NoSQL with all the benefits of...
 
Oracle Open World 2018 / Code One : MySQL 8.0 Document Store
Oracle Open World 2018 /  Code One : MySQL 8.0 Document StoreOracle Open World 2018 /  Code One : MySQL 8.0 Document Store
Oracle Open World 2018 / Code One : MySQL 8.0 Document Store
 
DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...
DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...
DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...
 
Oracle Code Roma: NoSQL + SQL = MySQL
Oracle Code Roma:   NoSQL + SQL = MySQLOracle Code Roma:   NoSQL + SQL = MySQL
Oracle Code Roma: NoSQL + SQL = MySQL
 
pre-FOSDEM MySQL day, February 2018 - MySQL Document Store
pre-FOSDEM MySQL day, February 2018 - MySQL Document Storepre-FOSDEM MySQL day, February 2018 - MySQL Document Store
pre-FOSDEM MySQL day, February 2018 - MySQL Document Store
 
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
 
Introduction to MySQL Document Store
Introduction to MySQL Document StoreIntroduction to MySQL Document Store
Introduction to MySQL Document Store
 
Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0
 
MySQL 8.0, what's new ? - Forum PHP 2018
MySQL 8.0, what's new ? - Forum PHP 2018MySQL 8.0, what's new ? - Forum PHP 2018
MySQL 8.0, what's new ? - Forum PHP 2018
 
the State of the Dolphin - October 2020
the State of the Dolphin - October 2020the State of the Dolphin - October 2020
the State of the Dolphin - October 2020
 
MySQL Document Store - A Document Store with all the benefts of a Transactona...
MySQL Document Store - A Document Store with all the benefts of a Transactona...MySQL Document Store - A Document Store with all the benefts of a Transactona...
MySQL Document Store - A Document Store with all the benefts of a Transactona...
 
MySQL JSON Document Store - A Document Store with all the benefits of a Trans...
MySQL JSON Document Store - A Document Store with all the benefits of a Trans...MySQL JSON Document Store - A Document Store with all the benefits of a Trans...
MySQL JSON Document Store - A Document Store with all the benefits of a Trans...
 
MySQL 8.0 - What's New ?
MySQL 8.0 - What's New ?MySQL 8.0 - What's New ?
MySQL 8.0 - What's New ?
 
A Step by Step Introduction to the MySQL Document Store
A Step by Step Introduction to the MySQL Document StoreA Step by Step Introduction to the MySQL Document Store
A Step by Step Introduction to the MySQL Document Store
 
MySQL Day Paris 2018 - What’s New in MySQL 8.0 ?
MySQL Day Paris 2018 - What’s New in MySQL 8.0 ?MySQL Day Paris 2018 - What’s New in MySQL 8.0 ?
MySQL Day Paris 2018 - What’s New in MySQL 8.0 ?
 
OUG Scotland 2014 - NoSQL and MySQL - The best of both worlds
OUG Scotland 2014 - NoSQL and MySQL - The best of both worldsOUG Scotland 2014 - NoSQL and MySQL - The best of both worlds
OUG Scotland 2014 - NoSQL and MySQL - The best of both worlds
 
Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0
 
State of the Dolphin - May 2022
State of the Dolphin - May 2022State of the Dolphin - May 2022
State of the Dolphin - May 2022
 

Mehr von Frederic Descamps

Mehr von Frederic Descamps (20)

MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
 
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionMySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
 
RivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and HistogramsRivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and Histograms
 
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
RivieraJUG - MySQL 8.0 - What's new for developers.pdfRivieraJUG - MySQL 8.0 - What's new for developers.pdf
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
 
MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8
 
Percona Live 2022 - MySQL Shell for Visual Studio Code
Percona Live 2022 - MySQL Shell for Visual Studio CodePercona Live 2022 - MySQL Shell for Visual Studio Code
Percona Live 2022 - MySQL Shell for Visual Studio Code
 
Percona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database SystemPercona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database System
 
Percona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesPercona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL Architectures
 
LinuxFest Northwest 2022 - The Evolution of a MySQL Database System
LinuxFest Northwest 2022 - The Evolution of a MySQL Database SystemLinuxFest Northwest 2022 - The Evolution of a MySQL Database System
LinuxFest Northwest 2022 - The Evolution of a MySQL Database System
 
Confoo 2022 - le cycle d'une instance MySQL
Confoo 2022  - le cycle d'une instance MySQLConfoo 2022  - le cycle d'une instance MySQL
Confoo 2022 - le cycle d'une instance MySQL
 
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...
FOSDEM 2022 MySQL Devroom:  MySQL 8.0 - Logical Backups, Snapshots and Point-...FOSDEM 2022 MySQL Devroom:  MySQL 8.0 - Logical Backups, Snapshots and Point-...
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...
 
State of The Dolphin - May 2021
State of The Dolphin - May 2021State of The Dolphin - May 2021
State of The Dolphin - May 2021
 
MySQL Shell for DBAs
MySQL Shell for DBAsMySQL Shell for DBAs
MySQL Shell for DBAs
 
Deploying Magento on OCI with MDS
Deploying Magento on OCI with MDSDeploying Magento on OCI with MDS
Deploying Magento on OCI with MDS
 
MySQL Router REST API
MySQL Router REST APIMySQL Router REST API
MySQL Router REST API
 
From single MySQL instance to High Availability: the journey to MySQL InnoDB ...
From single MySQL instance to High Availability: the journey to MySQL InnoDB ...From single MySQL instance to High Availability: the journey to MySQL InnoDB ...
From single MySQL instance to High Availability: the journey to MySQL InnoDB ...
 
Cloud native - Why to use MySQL 8.0 and how to use it on oci with MDS
Cloud native -  Why to use MySQL 8.0 and how to use it on oci with MDSCloud native -  Why to use MySQL 8.0 and how to use it on oci with MDS
Cloud native - Why to use MySQL 8.0 and how to use it on oci with MDS
 
MySQL Database Service Webinar: Installing Drupal in oci with mds
MySQL Database Service Webinar: Installing Drupal in oci with mdsMySQL Database Service Webinar: Installing Drupal in oci with mds
MySQL Database Service Webinar: Installing Drupal in oci with mds
 
Oracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with Terraform
Oracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with TerraformOracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with Terraform
Oracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with Terraform
 
MySQL Database Service Webinar: Upgrading from on-premise MySQL to MDS
MySQL Database Service Webinar: Upgrading from on-premise MySQL to MDSMySQL Database Service Webinar: Upgrading from on-premise MySQL to MDS
MySQL Database Service Webinar: Upgrading from on-premise MySQL to MDS
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

MySQL 8.0 Document Store - Discovery of a New World

  • 1. Frédéric Descamps Community Manager MySQL October 2020 MySQL 8.0 Document Store discovery of a new world
  • 2. Who am I ? about.me/lefred Copyright @ 2020 Oracle and/or its affiliates.2
  • 3. Frédéric Descamps @lefred MySQL Evangelist Managing MySQL since 3.20 ! devops believer living in Belgium h ps://lefred.be Copyright @ 2020 Oracle and/or its affiliates.3
  • 4. MySQL #MySQl8isGreat Copyright @ 2020 Oracle and/or its affiliates.4
  • 5. MySQL is the DBMS of the Year 2019 ! Copyright @ 2020 Oracle and/or its affiliates.5
  • 6. Happy 25th Anniversary MySQL Copyright @ 2020 Oracle and/or its affiliates.6
  • 7. Evolution... from LAMP stack to modern Web applications Copyright @ 2020 Oracle and/or its affiliates.7
  • 8. Web Applications 2000's Who ? Copyright @ 2020 Oracle and/or its affiliates.8
  • 9. Web Applications 2000's Who ? Copyright @ 2020 Oracle and/or its affiliates.8
  • 10. Web Applications 2000's How ? Copyright @ 2020 Oracle and/or its affiliates.9
  • 11. Web Applications 2000's How ? Copyright @ 2020 Oracle and/or its affiliates.9
  • 12. Relational Databases Data Integrity Copyright @ 2020 Oracle and/or its affiliates.10
  • 13. Relational Databases Data Integrity normalization Copyright @ 2020 Oracle and/or its affiliates.10
  • 14. Relational Databases Data Integrity normalization constraints (foreign keys, ...) Copyright @ 2020 Oracle and/or its affiliates.10
  • 15. Relational Databases Data Integrity normalization constraints (foreign keys, ...) Atomicity, Consistency, Isolation, Durability Copyright @ 2020 Oracle and/or its affiliates.10
  • 16. Relational Databases Data Integrity normalization constraints (foreign keys, ...) Atomicity, Consistency, Isolation, Durability ACID compliant Copyright @ 2020 Oracle and/or its affiliates.10
  • 17. Relational Databases Data Integrity normalization constraints (foreign keys, ...) Atomicity, Consistency, Isolation, Durability ACID compliant transactions Copyright @ 2020 Oracle and/or its affiliates.10
  • 18. Relational Databases Data Integrity normalization constraints (foreign keys, ...) Atomicity, Consistency, Isolation, Durability ACID compliant transactions SQL Copyright @ 2020 Oracle and/or its affiliates.10
  • 19. Relational Databases Data Integrity normalization constraints (foreign keys, ...) Atomicity, Consistency, Isolation, Durability ACID compliant transactions SQL powerfull query language Copyright @ 2020 Oracle and/or its affiliates.10
  • 20. Web Applications current days Who ? Copyright @ 2020 Oracle and/or its affiliates.11
  • 21. Web Applications current days Who ? Copyright @ 2020 Oracle and/or its affiliates.11
  • 22. Web Applications current days How ? Copyright @ 2020 Oracle and/or its affiliates.12
  • 23. Web Applications current days Why ? Copyright @ 2020 Oracle and/or its affiliates.13
  • 24. Web Applications current days Why ? Developers don't really like SQL anymore...   Copyright @ 2020 Oracle and/or its affiliates.13
  • 25. SQL can be complicated and slows down the initial development Web Applications current days Why ? Copyright @ 2020 Oracle and/or its affiliates.14
  • 26. Developers don't have time to learn SQL, they need time to workout and have a nice look ;-) Web Applications current days Why ? Copyright @ 2020 Oracle and/or its affiliates.15
  • 27. What do developers want ? easy operations Copyright @ 2020 Oracle and/or its affiliates.16
  • 28. Use Objects / Documents Developers want just to use objects Copyright @ 2020 Oracle and/or its affiliates.17
  • 29. Use Objects / Documents Developers want just to use objects that's why they usually love what DBAs hate the most ORMs ! Copyright @ 2020 Oracle and/or its affiliates.17
  • 30. Use Objects / Documents Developers want just to use objects that's why they usually love what DBAs hate the most ORMs ! They want to deal with these objects easily (CRUD operations) and they don't want to think about schema design (slows down the initial development process). Copyright @ 2020 Oracle and/or its affiliates.17
  • 31. Use Objects / Documents Developers want just to use objects that's why they usually love what DBAs hate the most ORMs ! They want to deal with these objects easily (CRUD operations) and they don't want to think about schema design (slows down the initial development process). But they also want to keep their data safe and use transactions. Copyright @ 2020 Oracle and/or its affiliates.17
  • 32. Web Applications current days How ? Copyright @ 2020 Oracle and/or its affiliates.18
  • 33. Web Applications current days How ? Copyright @ 2020 Oracle and/or its affiliates.18
  • 34. NoSQL Databases JSON Document Store Copyright @ 2020 Oracle and/or its affiliates.19
  • 35. NoSQL Document Store Schemaless Copyright @ 2020 Oracle and/or its affiliates.20
  • 36. NoSQL Document Store Schemaless no schema design, no normalization, no foreign keys, no data types, ... Copyright @ 2020 Oracle and/or its affiliates.20
  • 37. NoSQL Document Store Schemaless no schema design, no normalization, no foreign keys, no data types, ... very quick initial development Copyright @ 2020 Oracle and/or its affiliates.20
  • 38. NoSQL Document Store Schemaless no schema design, no normalization, no foreign keys, no data types, ... very quick initial development Flexible data structure Copyright @ 2020 Oracle and/or its affiliates.20
  • 39. NoSQL Document Store Schemaless no schema design, no normalization, no foreign keys, no data types, ... very quick initial development Flexible data structure embedded arrays or objects Copyright @ 2020 Oracle and/or its affiliates.20
  • 40. NoSQL Document Store Schemaless no schema design, no normalization, no foreign keys, no data types, ... very quick initial development Flexible data structure embedded arrays or objects valid solution when natural data can't be modelized optimaly into a relational model Copyright @ 2020 Oracle and/or its affiliates.20
  • 41. NoSQL Document Store Schemaless no schema design, no normalization, no foreign keys, no data types, ... very quick initial development Flexible data structure embedded arrays or objects valid solution when natural data can't be modelized optimaly into a relational model objects persistance without the use of any ORM - mapping oobject-oriented Copyright @ 2020 Oracle and/or its affiliates.20
  • 42. NoSQL Document Store Schemaless no schema design, no normalization, no foreign keys, no data types, ... very quick initial development Flexible data structure embedded arrays or objects valid solution when natural data can't be modelized optimaly into a relational model objects persistance without the use of any ORM - mapping oobject-oriented JSON Copyright @ 2020 Oracle and/or its affiliates.20
  • 43. NoSQL Document Store Schemaless no schema design, no normalization, no foreign keys, no data types, ... very quick initial development Flexible data structure embedded arrays or objects valid solution when natural data can't be modelized optimaly into a relational model objects persistance without the use of any ORM - mapping oobject-oriented JSON close to frontend Copyright @ 2020 Oracle and/or its affiliates.20
  • 44. NoSQL Document Store Schemaless no schema design, no normalization, no foreign keys, no data types, ... very quick initial development Flexible data structure embedded arrays or objects valid solution when natural data can't be modelized optimaly into a relational model objects persistance without the use of any ORM - mapping oobject-oriented JSON close to frontend easy to learn Copyright @ 2020 Oracle and/or its affiliates.20
  • 45. How DBAs see data Copyright @ 2020 Oracle and/or its affiliates.21
  • 46. 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 @ 2020 Oracle and/or its affiliates.21
  • 47. And they still need to do Analytics SQL SQL SQL Copyright @ 2020 Oracle and/or its affiliates.22
  • 48. ... mmm...how ? ? SQL SQL SQL Copyright @ 2020 Oracle and/or its affiliates.23
  • 49. Help needed ! Who ? Copyright @ 2020 Oracle and/or its affiliates.24
  • 50. Help needed ! Who ? Copyright @ 2020 Oracle and/or its affiliates.24
  • 51. How ? SQL SQL SQL Copyright @ 2020 Oracle and/or its affiliates.25
  • 52. What if there was a way to provide both SQL and NoSQL on one stable platform that has proven stability on well know technology with a large Community and a diverse ecosystem ? Copyright @ 2020 Oracle and/or its affiliates.26
  • 53. DBMS or NoSQL ? Copyright @ 2020 Oracle and/or its affiliates.27
  • 54. DBMS or NoSQL ? Why not both ? Copyright @ 2020 Oracle and/or its affiliates.27
  • 55. The MySQL Document Store ! SQL is now optional ?! Copyright @ 2020 Oracle and/or its affiliates.28
  • 56. SQL is now optional ?! Copyright @ 2020 Oracle and/or its affiliates.29
  • 57. Using MySQL Document Store ! SQL SQL SQL Copyright @ 2020 Oracle and/or its affiliates.30
  • 58. Developers: [x] schemaless [x] rapid prototying/simpler APIs [x] document model [x] transactions Operations: [x] performance management/visibility [x] robust replication, backup, restore [x] comprehensive tooling ecosystem [x] simpler application schema upgrades A solution for all Business Owner: [x] don't lose my data == ACID trx [x] capture all my data = extensible/schemaless [x] product on schedule/time to market = rapid developement Copyright @ 2020 Oracle and/or its affiliates.31
  • 59. the Solution MySQL Document Store Copyright @ 2020 Oracle and/or its affiliates.32
  • 60. Built on the MySQL JSON Data type and Proven MySQL Server Technology Provides a schema exible JSON Document Store No SQL required No need to de ne all possible a ributes, tables, etc. Uses new X DevAPI Can leverage generated column to extract JSON values into materialized columns that can be indexed for fast SQL searches. Document can be ~1GB It's a column in a row of a table It cannot exceed max_allowed_packet Allows use of modern programming styles No more embedded strings of SQL in your code Easy to read Also works with relational Tables Proven MySQL Technology Copyright @ 2020 Oracle and/or its affiliates.33
  • 61. X Protocol Connectors Copyright @ 2020 Oracle and/or its affiliates.34
  • 62. X DevAPI We provide connectors for C++, Java, .Net, Node.js, Python, PHP working with Communities to help them supporting it too New MySQL Shell Command Completion Python, JavaScrips & SQL modes Admin functions New Util object A new high-level session concept that can scale from single MySQL server to a multiple server environment Non-blocking, asynchronous calls follow common language pa erns Supports CRUD operations Copyright @ 2020 Oracle and/or its affiliates.35
  • 63. Setup MySQL Document Store Copyright @ 2020 Oracle and/or its affiliates.36
  • 64. Installing MySQL Document Store install MySQL 8.0 Copyright @ 2020 Oracle and/or its affiliates.37
  • 65. Installing MySQL Document Store install MySQL 8.0 install MySQL Shell Copyright @ 2020 Oracle and/or its affiliates.37
  • 66. Installing MySQL Document Store install MySQL 8.0 install MySQL Shell install MySQL Connector for your programming language Copyright @ 2020 Oracle and/or its affiliates.37
  • 67. Installing MySQL Document Store install MySQL 8.0 install MySQL Shell install MySQL Connector for your programming language php-pecl-mysql-xdevapi for PHP mysql-connector-python for Python ... Copyright @ 2020 Oracle and/or its affiliates.37
  • 68. Installing MySQL Document Store install MySQL 8.0 install MySQL Shell install MySQL Connector for your programming language php-pecl-mysql-xdevapi for PHP mysql-connector-python for Python ... And nothing else, no need to install anything else or load any plugin, just be sure your rewall allows you to connect through port 33060 (X Protocol). Copyright @ 2020 Oracle and/or its affiliates.37
  • 69. MySQL Database Service X Protocol is also available in MDS !! Copyright @ 2020 Oracle and/or its affiliates.38
  • 70. Migration from MongoDB to MySQL DS For this example, I will use the well known restaurants collection: Copyright @ 2020 Oracle and/or its affiliates.39
  • 71. Migration from MongoDB to MySQL DS For this example, I will use the well known restaurants collection: Copyright @ 2020 Oracle and/or its affiliates.39
  • 72. Copyright @ 2020 Oracle and/or its affiliates.40
  • 73. Copyright @ 2020 Oracle and/or its affiliates.41
  • 74. Let's make a query Copyright @ 2020 Oracle and/or its affiliates.42
  • 75. Let's make a query That's too much records to show in here... let's limit it Copyright @ 2020 Oracle and/or its affiliates.42
  • 76. Copyright @ 2020 Oracle and/or its affiliates.43
  • 77. Some more examples Copyright @ 2020 Oracle and/or its affiliates.44
  • 78. Let's add a selection criteria: Copyright @ 2020 Oracle and/or its affiliates.45
  • 79. Syntax slightly di erent than MongoDB Copyright @ 2020 Oracle and/or its affiliates.46
  • 80. Syntax slightly di erent than MongoDB Copyright @ 2020 Oracle and/or its affiliates.46
  • 81. And for developers ? Copyright @ 2020 Oracle and/or its affiliates.47
  • 82. And for developers ? $session = mysql_xdevapigetSession("mysqlx://fred:MyP@ssw0rd%@localhost"); $schema = $session->getSchema("docstore"); $collection = $schema->getCollection("restaurants"); $results = $collection-> nd($search)->execute()->fetchAll(); ... foreach ($results as $doc) { echo "<tr><td><a href='?id=${doc[_id]}'>${doc[name]}</a></td>"; echo "<td>${doc[borough]}</td><td>${doc[cuisine]}</td></tr>"; } Copyright @ 2020 Oracle and/or its affiliates.48
  • 83. And for developers ? $session = mysql_xdevapigetSession("mysqlx://fred:MyP@ssw0rd%@localhost"); $schema = $session->getSchema("docstore"); $collection = $schema->getCollection("restaurants"); $results = $collection-> nd($search)->execute()->fetchAll(); ... foreach ($results as $doc) { echo "<tr><td><a href='?id=${doc[_id]}'>${doc[name]}</a></td>"; echo "<td>${doc[borough]}</td><td>${doc[cuisine]}</td></tr>"; }   Easy, using only CRUD operations ! Copyright @ 2020 Oracle and/or its affiliates.48
  • 84. And for developers ? $session = mysql_xdevapigetSession("mysqlx://fred:MyP@ssw0rd%@localhost"); $schema = $session->getSchema("docstore"); $collection = $schema->getCollection("restaurants"); $results = $collection-> nd($search)->execute()->fetchAll(); ... foreach ($results as $doc) { echo "<tr><td><a href='?id=${doc[_id]}'>${doc[name]}</a></td>"; echo "<td>${doc[borough]}</td><td>${doc[cuisine]}</td></tr>"; }   Easy, using only CRUD operations ! Not a single SQL statement ! Copyright @ 2020 Oracle and/or its affiliates.48
  • 85. CRUD operations Copyright @ 2020 Oracle and/or its affiliates.49
  • 86. CRUD operations for collections Add a document collection.add({ name: 'fred', age: 42 }) .add({ name: 'dave', age: 23 }) .execute() collection.add([ { name: 'dimo', age: 50 }, { name: 'kenny', age: 25 } ]).execute() Copyright @ 2020 Oracle and/or its affiliates.50
  • 87. CRUD operations for collections Modify a document collection.modify('name = :name') .bind('name', 'fred') .set('age', 43) .sort('name ASC') .limit(1) .execute() collection.modify('name = :name') .bind('name', 'fred') .patch({ age: 43, active: false }) .sort('name DESC') .limit(1) .execute() Copyright @ 2020 Oracle and/or its affiliates.51
  • 88. CRUD operations for collections Remove a document collection.remove('name = :name') .bind('name', 'fred') .sort('age ASC') .limit(1) .execute() Copyright @ 2020 Oracle and/or its affiliates.52
  • 89. MySQL Document Store Objects Summary Copyright @ 2020 Oracle and/or its affiliates.53
  • 90. All you need to know is here: h ps://dev.mysql.com/doc/x-devapi-userguide/en/crud-operations-overview.html Copyright @ 2020 Oracle and/or its affiliates.54
  • 91. MySQL Document Store is Full ACID Compliant we do care about your data Copyright @ 2020 Oracle and/or its affiliates.55
  • 92. Document Store Full ACID ! It relies on the proven MySQL InnoDB's strength & robustness: Copyright @ 2020 Oracle and/or its affiliates.56
  • 93. Document Store Full ACID ! It relies on the proven MySQL InnoDB's strength & robustness: innodb_ ush_log_at_trx_commit = 1 Copyright @ 2020 Oracle and/or its affiliates.56
  • 94. Document Store Full ACID ! It relies on the proven MySQL InnoDB's strength & robustness: innodb_ ush_log_at_trx_commit = 1 innodb_doublewrite = ON Copyright @ 2020 Oracle and/or its affiliates.56
  • 95. Document Store Full ACID ! It relies on the proven MySQL InnoDB's strength & robustness: innodb_ ush_log_at_trx_commit = 1 innodb_doublewrite = ON sync_binlog = 1 Copyright @ 2020 Oracle and/or its affiliates.56
  • 96. Document Store Full ACID ! It relies on the proven MySQL InnoDB's strength & robustness: innodb_ ush_log_at_trx_commit = 1 innodb_doublewrite = ON sync_binlog = 1 transaction_isolation = REPEATABLE-READ|READ-COMMITTED|... Copyright @ 2020 Oracle and/or its affiliates.56
  • 97. Document Store Full ACID ! It relies on the proven MySQL InnoDB's strength & robustness: innodb_ ush_log_at_trx_commit = 1 innodb_doublewrite = ON sync_binlog = 1 transaction_isolation = REPEATABLE-READ|READ-COMMITTED|... We do care about your data ! Copyright @ 2020 Oracle and/or its affiliates.56
  • 98. Full ACID - Transactions support Copyright @ 2020 Oracle and/or its affiliates.57
  • 99. Full ACID - Transactions support Copyright @ 2020 Oracle and/or its affiliates.58
  • 100. OK we have Document Store, CRUD and ACID but what makes MySQL Document Store unique ? Copyright @ 2020 Oracle and/or its affiliates.59
  • 101. Challenge: list the best restaurant of each type of food and show the top 10, with the best one rst !   don't forget that all these restaurants are just JSON documents Copyright @ 2020 Oracle and/or its affiliates.60
  • 102. NoSQL as SQL - aggregation Copyright @ 2020 Oracle and/or its affiliates.61
  • 103. NoSQL as SQL - aggregation Copyright @ 2020 Oracle and/or its affiliates.62
  • 104. NoSQL as SQL - aggregation Copyright @ 2020 Oracle and/or its affiliates.63
  • 105. NoSQL as SQL - aggregation Copyright @ 2020 Oracle and/or its affiliates.64
  • 106. NoSQL or SQL You have the possibility to write clean and neat code: Copyright @ 2020 Oracle and/or its affiliates.65
  • 107. NoSQL or SQL You have the possibility to write clean and neat code: $results = $collection-> nd('cuisine like "italian"')->execute()->fetchAll(); Copyright @ 2020 Oracle and/or its affiliates.65
  • 108. NoSQL or SQL You have the possibility to write clean and neat code: $results = $collection-> nd('cuisine like "italian"')->execute()->fetchAll(); Or use SQL only when it's really needed: Copyright @ 2020 Oracle and/or its affiliates.65
  • 109. NoSQL or SQL You have the possibility to write clean and neat code: $results = $collection-> nd('cuisine like "italian"')->execute()->fetchAll(); Or use SQL only when it's really needed: $results = $session->sql('WITH cte1 AS (SELECT doc->>"$.name" AS name, doc->>"$.cuisine" AS cuisine, (SELECT AVG(score) FROM JSON_TABLE(doc, "$.grades[*]" COLUMNS (score INT PATH "$.score")) AS r) AS avg_score FROM docstore.restaurants) SELECT *, RANK() OVER ( PARTITION BY cuisine ORDER BY avg_score) AS `rank` FROM cte1 ORDER BY `rank`, avg_score DESC LIMIT 10;')->execute(); Copyright @ 2020 Oracle and/or its affiliates.65
  • 110. NoSQL or SQL You have the possibility to write clean and neat code: $results = $collection-> nd('cuisine like "italian"')->execute()->fetchAll(); Or use SQL only when it's really needed: $results = $session->sql('WITH cte1 AS (SELECT doc->>"$.name" AS name, doc->>"$.cuisine" AS cuisine, (SELECT AVG(score) FROM JSON_TABLE(doc, "$.grades[*]" COLUMNS (score INT PATH "$.score")) AS r) AS avg_score FROM docstore.restaurants) SELECT *, RANK() OVER ( PARTITION BY cuisine ORDER BY avg_score) AS `rank` FROM cte1 ORDER BY `rank`, avg_score DESC LIMIT 10;')->execute(); All in the same MySQL X Session ! Copyright @ 2020 Oracle and/or its affiliates.65
  • 111. You can mix NoSQL & SQL as you want Copyright @ 2020 Oracle and/or its affiliates.66
  • 112. Best of Both Worlds: JSON_TABLE What are the maximum 10 ratings ever given to a restaurant? Copyright @ 2020 Oracle and/or its affiliates.67
  • 113. Best of Both Worlds: JSON_TABLE What are the maximum 10 ratings ever given to a restaurant? Cool... but my app only processes JSON ! Copyright @ 2020 Oracle and/or its affiliates.67
  • 114. Best of Both Worlds: JSON_TABLE (2) With JSON output: Copyright @ 2020 Oracle and/or its affiliates.68
  • 115. And the DBA ? MySQL Document Store Copyright @ 2020 Oracle and/or its affiliates.69
  • 116. Role of the MySQL Document Store DBA ? Copyright @ 2020 Oracle and/or its affiliates.70
  • 117. nd the non optimal lookups create the necessary indexes based on the results   Role of the MySQL Document Store DBA ? Copyright @ 2020 Oracle and/or its affiliates.70
  • 118. Role of the MySQL Document Store DBA Looking for full table scans: SELECT schema_name, sum_rows_examined, (sum_rows_examined/exec_count) avg_rows_call, format_time(total_latency) tot_lat, exec_count, format_time(total_latency/exec_count) AS latency_per_call, query_sample_text FROM sys.x$statements_with_full_table_scans AS t1 JOIN performance_schema.events_statements_summary_by_digest AS t2 ON t2.digest=t1.digest WHERE schema_name = "docstore" AND query_sample_text LIKE '%select%' ORDER BY (total_latency/exec_count) descG Copyright @ 2020 Oracle and/or its affiliates.71
  • 119. Role of the MySQL Document Store DBA Looking for full table scans: SELECT schema_name, sum_rows_examined, (sum_rows_examined/exec_count) avg_rows_call, format_time(total_latency) tot_lat, exec_count, format_time(total_latency/exec_count) AS latency_per_call, query_sample_text FROM sys.x$statements_with_full_table_scans AS t1 JOIN performance_schema.events_statements_summary_by_digest AS t2 ON t2.digest=t1.digest WHERE schema_name = "docstore" AND query_sample_text LIKE '%select%' ORDER BY (total_latency/exec_count) descG More info at h ps://lefred.be/content/mysql-8-0-if-i-should-optimize-only-one-query- on-my-application-which-one-should-it-be/ Copyright @ 2020 Oracle and/or its affiliates.71
  • 120. Role of the MySQL Document Store DBA (2) Copyright @ 2020 Oracle and/or its affiliates.72
  • 121. Role of the MySQL Document Store DBA (3) Ge ing the Query Execution Plan: Copyright @ 2020 Oracle and/or its affiliates.73
  • 122. Role of the MySQL Document Store DBA (3) Ge ing the Query Execution Plan: It's indeed a full table scan ! Copyright @ 2020 Oracle and/or its affiliates.73
  • 123. Role of the MySQL Document Store DBA (4) MySQL supports also EXPLAIN ANALYZE !! Copyright @ 2020 Oracle and/or its affiliates.74
  • 124. Role of the MySQL Document Store DBA (5) Create Indexes: Copyright @ 2020 Oracle and/or its affiliates.75
  • 125. Role of the MySQL Document Store DBA (5) Create Indexes: For the "old" experienced MySQL DBAs, you can instead use: Copyright @ 2020 Oracle and/or its affiliates.75
  • 126. INFO: JSON Notation Shortcut Copyright @ 2020 Oracle and/or its affiliates.76
  • 127. Role of the MySQL Document Store DBA (6) Result: Copyright @ 2020 Oracle and/or its affiliates.77
  • 128. For the curious: a collection in SQL: Copyright @ 2020 Oracle and/or its affiliates.78
  • 129. Since MySQL 8.0.17 JSON Array Indexes JSON Schema JSON_SCHEMA_VALID(<json schema>,<json doc>) JSON_SCHEMA_VALIDATION_REPORT(<json schema>,<json doc>) Copyright @ 2020 Oracle and/or its affiliates.79
  • 130. Index of a JSON array A functional index over a JSON expression The expression evaluates to an array Several index entries per row One index entry per array element General mechanism, currently used for JSON arrays Used to speed up array lookups JSON_CONTAINS(...) JSON_OVERLAPS(...) MEMBER OF (...) JSON Array Indexes Copyright @ 2020 Oracle and/or its affiliates.80
  • 131. JSON Array Indexes Copyright @ 2020 Oracle and/or its affiliates.81
  • 132. JSON Array Indexes (2) Copyright @ 2020 Oracle and/or its affiliates.82
  • 133. JSON_VALUE        (since 8.0.21) This function is described in SQL 2016, chapter 6.27. Copyright @ 2020 Oracle and/or its affiliates.83
  • 134. CHECK CONSTRAINTS MySQL 8.0 supports Check Constraints: Copyright @ 2020 Oracle and/or its affiliates.84
  • 135. JSON Schema Validation Copyright @ 2020 Oracle and/or its affiliates.85
  • 136. JSON Schema Validation (2) Copyright @ 2020 Oracle and/or its affiliates.86
  • 137. JSON Schema Validation (3) And the best of both worlds: Copyright @ 2020 Oracle and/or its affiliates.87
  • 138. JSON Schema Validation (3) And the best of both worlds: And the result in action: Copyright @ 2020 Oracle and/or its affiliates.87
  • 139. JSON Schema Validation (3) And the best of both worlds: And the result in action: Copyright @ 2020 Oracle and/or its affiliates.87
  • 140. Conclusion what do I gain ? Copyright @ 2020 Oracle and/or its affiliates.88
  • 141. schemaless exible data structure easy to start (CRUD) Conclusion This is the best of the two worlds in one product ! Data integrity ACID Compliant Transactions SQL Copyright @ 2020 Oracle and/or its affiliates.89
  • 143. Q & A Copyright @ 2020 Oracle and/or its affiliates.91