SlideShare a Scribd company logo
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
MySQL como
Document Store
Airton Lastori
Consultor MySQL
airton.lastori@oracle.com
Dez-2017
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
Você usa MySQL?
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL é o banco de dados
de código aberto mais
popular do mundo.
3
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
Popularidade dos Bancos de Dados
http://db-engines.com/en/ranking_trend (339 systems in ranking, December 2017)
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
“The demand for
database
administrators and
developers is much
higher than the
current supply, as
well, leading to lots of
open positions.”
https://stackoverflow.blog/2017/03/09
/developer-hiring-trends-2017/
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Algumas novidades
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Read Scale-Out
Async Replication + Auto Failover
Write Scale-Out
Sharding
S1
S2
S3
S4
MySQL Vision – 4 Steps
Timeline
MySQL Document Store
Relational & Document Model
MySQL HA
Out-Of-Box HA
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Standalone MySQL Replication
8
MySQL InnoDB Cluster MySQL Cluster (NDB)
Arquiteturas para Alta Disponibilidade
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL InnoDB Cluster
Group Replication
Router Router
App App
• Banco de dados replicado altamente
disponível e tolerante a falhas
• Permite topologias Multi-Primary
(ativo-ativo) ou Single-Primary
• Arquitetura cloud-friendly, shared-
nothing, sem storage compartilhado
• Automatiza failover e failback,
reconfiguração e reconexão após
falhas
• GA, pronto para produção desde a
versão 5.7.17 (dez/16)
MySQL Shell
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
• 2 anos em Desenvolvimento
• 400+ Worklogs
• 5000+ Bugs corrigidos
• 500 novos testes
• Suporte melhorado para JSON
• API Document Store mais completa
• CTEs e Window Functions
• Melhor manipulação de Hot Rows
• Unicode 9.0, utf8 charset padrão
• Performance mais consistente via
estatísticas
• GIS
• Mais facilidades para administração em
Cloud
• Novo Data Dictionary nativo
• Invisible Indexes
• Atualizações das configurações padrão
• Refactoring, C++11, etc…
10
MySQL 8.0 Release Candidate 1
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 11
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Por que Document Store?
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Read Scale-Out
Async Replication + Auto Failover
Write Scale-Out
Sharding
S1
S2
S3
S4
MySQL Vision – 4 Steps
Timeline
MySQL Document Store
Relational & Document Model
MySQL HA
Out-Of-Box HA
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 14
Relacional vs Não-relacional
id name email city_id
3412 John Smith john@oracle.com 45
id city country_id
45 San Francisco US
customer
city
id id_customer date total
381 3412 2017-08-24 312.20
412 3412 2017-10-02 24.95
shop_order
Schemaless, NoSQL,
Não-estruturado
{
"name": "John Smith",
"email": "john@oracle.com",
"city": "San Francisco",
"country": "US",
"orders": [
{"date": "2017-08-24", "total": 312.20},
{"date": "2017-10-02", "total": 24.95}
]
}
Schema, SQL, Estruturado
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Modelo Relacional
• Maior esforço antecipado durante a
fase de design
– modelagem de dados e normalização
– definição do esquema físico
• O banco de dados assegura a
integridade (dados inválidos são
rejeitados)
– Tipos de dados
– Restrições (chaves estrangeiras etc.)
Modelo baseado em Documentos
• Menor esforço antecipado
– estrutura de dados definida no código
do aplicativo
• Aplicação é responsável pela
integridade dos dados
– possibilidade de dados de má
qualidade serem inseridos no sistema
(por causa de bugs, alterações na
aplicação, etc.)
Oracle Confidential – Internal/Restricted/Highly Restricted 15
Qual o melhor?
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Modelo Relacional
• Pequena curva de aprendizagem
– Requer conhecimento de SQL
• SQL permite que o otimizador
execute consultas complexas de
forma eficiente - especialmente
quando há JOINS de várias tabelas
• Alterações no modelo (schema) ao
longo da evolução da aplicação
podem ser problemáticas -
especialmente para atualizações
Modelo baseado em Documentos
• Mais fácil de começar
• JOINS limitados ou inexistentes,
otimizador simples - complexidade
de consultas passadas para a
aplicação resolver
• Implementação de alterações mais
simples - os documentos criados em
diferentes versões da aplicação
podem coexistir.
Oracle Confidential – Internal/Restricted/Highly Restricted 16
Qual o melhor?
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Modelo Relacional
• Mais integridade no schema,
independente da aplicação
• Schema torna a aplicação mais fácil de
manter no longo prazo, pois há maior
controle nas mudanças
– Espera-se uma maior qualidade dos dados
– Permite aplicação de algumas validações
automáticas sobre os dados
• JOINS, consultas complexas resolvidas
pelo otimizador
Modelo baseado em Documentos
• Menor preocupação na definição de
Tipos de Dados, protótipos rápidos,
comece armazenar dados imediatamente
• Mais liberdade para representar dados
(ex. Campos custom)
• Menos dor-de-cabeça para aplicar
mudanças no modelo de dados
• Denormalização natural, registro auto-
contido (ex. facilita escalabilidade
horizontal via sharding)
Oracle Confidential – Internal/Restricted/Highly Restricted 17
Pontos fortes
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 18
Banco de Dados Híbrido: Confiabilidade + Flexibilidade
MySQL 5.7
Document Store
Suporte JSON
Nova API
BDs Relacionais
Tecnologia madura,
comprovadamente segura.
Transações, queries, JOINs
complexos e conjunto
extenso de ferrametnas
operacionais
NoSQL
Flexibilidade. Escalabilidade
horizontal e facilidade de
uso, schemaless, document
store (JSON)
Aplicações Modernas
Agile + DevOps com
proteção robusta dos
dados
Banco de Dados Híbrido
Melhor dos mundos, sem
trade-offs. Propriedades ACID
& confiabilidade de SGBDR +
flexibilidade de document store
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 19
Document Store
_id customer_shop
3412
customer
{
"name": "John Smith",
"email": "john@oracle.com",
"city": "San Francisco",
"country": "US",
"orders": [
{"date": "2017-08-24", "total": 312.20},
{"date": "2017-10-02", "total": 24.95}
]
}
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
SQL - Document Store
CREATE DATABASE customer_doc;
USE customer_doc;
CREATE TABLE customer (
_id INT NOT NULL AUTO_INCREMENT,
customer_shop JSON NOT NULL,
PRIMARY KEY (_id)
);
20
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
SQL - Document Store
INSERT INTO customer (_id, customer_shop) VALUES (3412,
'{
"name": "John Smith",
"email": "john@oracle.com",
"city": "San Francisco",
"country": "US",
"orders": [
{"date": "2017-08-24", "total": 312.20},
{"date": "2017-10-02", "total": 24.95}
]
}');
21
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 22
Relacional + Document Store
id name email city_id shop
3412 John Smith john@oracle.com 45
id city country_id
45 San Francisco US
customer_and_orders
city
{
"orders": [
{"date": "2017-08-24", "total": 312.20},
{"date": "2017-10-02", "total": 24.95}
]
}
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 23
Relacional + Document Store
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
CREATE DATABASE customer_hybrid;
USE customer_hybrid;
CREATE TABLE city (
id INT NOT NULL AUTO_INCREMENT,
city VARCHAR(60) NOT NULL,
country_id CHAR(2),
PRIMARY KEY(id)
);
CREATE TABLE customer_and_orders (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(60) NOT NULL,
email VARCHAR(50) NOT NULL,
city_id INT NOT NULL,
shop JSON NOT NULL,
PRIMARY KEY (id),
CONSTRAINT FK_customer_city
FOREIGN KEY (city_id)
REFERENCES city(id)
);
24
SQL - Relacional + Document Store
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
INSERT INTO city (id, city,
country_id)
VALUES (45, 'San Francisco', 'US');
SELECT * FROM city;
INSERT INTO customer_and_orders
(id, name, email, city_id, shop)
VALUES (3412, 'John Smith',
'john@oracle.com', 45,
'{
"orders": [
{"date": "2017-08-24",
"total": 312.20},
{"date": "2017-10-02",
"total": 24.95}
]
}');
SELECT * FROM customer_and_orders;
25
SQL - Relacional + Document Store
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Como usar o MySQL como Document Store
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
SQL – modelo híbrido
• Native JSON datatype
• JSON Functions
• Generated Columns
XDev API – modelo em documentos
• Document Store plugin
• X Protocol
• MySQL Shell
• Connector/J
• Connector/Net
• Connector/Node.js
• Connector/Python
27
2 formas de utilização de MySQL como Document Store
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
SQL – modelo híbrido
• Native JSON datatype
• JSON Functions
• Generated Columns
XDev API – modelo em documentos
• Document Store plugin
• X Protocol
• MySQL Shell
• Connector/J
• Connector/Net
• Connector/Node.js
• Connector/Python
28
2 formas de utilização de MySQL como Document Store
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Tipo nativo JSON
29
CREATE TABLE employees (data JSON);
INSERT INTO employees VALUES ('{"id": 1, "name": "Jane"}');
INSERT INTO employees VALUES ('{"id": 2, "name": "Joe"}');
SELECT * FROM employees;
+---------------------------+
| data |
+---------------------------+
| {"id": 1, "name": "Jane"} |
| {"id": 2, "name": "Joe"} |
+---------------------------+
2 rows in set (0,00 sec)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Vantagens sobre tipos TEXT/VARCHAR
1. Validação
2. Eficiência no armazenamento físico
Formato binário otimizado que permite um acesso mais rápido aos elementos de matrizes
30
INSERT INTO employees VALUES ('texto que não é JSON válido');
ERROR 3130 (22032): Invalid JSON text: "Expect a value here." at
position 0 in value (or column) 'texto que não é JSON válido'.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 31
Funções JSON
JSON_ARRAY_APPEND()
JSON_ARRAY_INSERT()
JSON_ARRAY()
JSON_CONTAINS_PATH()
JSON_CONTAINS()
JSON_DEPTH()
JSON_EXTRACT()
JSON_INSERT()
JSON_KEYS()
JSON_LENGTH()
JSON_MERGE()
JSON_OBJECT()
JSON_QUOTE()
JSON_REMOVE()
JSON_REPLACE()
JSON_SEARCH()
JSON_SET()
JSON_TYPE()
JSON_UNQUOTE()
JSON_VALID()
https://dev.mysql.com/doc/refman/5.7/en/json-functions.html
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Exemplo: JSON_EXTRACT
32
SET @document = '[10, 20, [30, 40]]';
SELECT JSON_EXTRACT(@document, '$[1]');
+---------------------------------+
| JSON_EXTRACT(@document, '$[1]') |
+---------------------------------+
| 20 |
+---------------------------------+
1 row in set (0.01 sec)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Generated Columns
33
id my_integer my_integer_plus_one
1 10 11
2 20 21
3 30 31
4 40 41
UPDATE t1 SET my_integer_plus_one = 10 WHERE id = 1;
ERROR 3105 (HY000): The value specified for generated column
'my_integer_plus_one' in table 't1' is not allowed.
Coluna atualizada automaticamente
com base na definição CREATE.
Somente leitura, é claro!
CREATE TABLE t1 (
id INT NOT NULL PRIMARY KEY auto_increment,
my_integer INT,
my_integer_plus_one INT AS (my_integer + 1)
);
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Testes com dados reais
• San Francisco OpenData
• 206K objetos JSON
• Importado de https://github.com/zemirco/sf-city-lots-json + ajustes
34
CREATE TABLE features (
id INT NOT NULL auto_increment primary key,
feature JSON NOT NULL
);
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 35
{
"type":"Feature",
"geometry":{
"type":"Polygon",
"coordinates":[
[
[-122.42200352825247,37.80848009696725,0],
[-122.42207601332528,37.808835019815085,0],
[-122.42110217434865,37.808803534992904,0],
[-122.42106256906727,37.80860105681814,0],
[-122.42200352825247,37.80848009696725,0]
]
]
},
"properties":{
"TO_ST":"0",
"BLKLOT":"0001001",
"STREET":"UNKNOWN",
"FROM_ST":"0",
"LOT_NUM":"001",
"ST_TYPE":null,
"ODD_EVEN":"E",
"BLOCK_NUM":"0001",
"MAPBLKLOT":"0001001"
}
}
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Comparação de Performance: JSON vs TEXT
36
# tipo JSON
SELECT DISTINCT
feature->"$.type" as json_extract
FROM features;
+--------------+
| json_extract |
+--------------+
| "Feature" |
+--------------+
1 row in set (1.25 sec)
# tipo TEXT
SELECT DISTINCT
feature->"$.type" as json_extract
FROM features;
+--------------+
| json_extract |
+--------------+
| "Feature" |
+--------------+
1 row in set (12.85 sec)
JSON 10x mais rápido que TEXT numa busca full scan
(sem índice, 206K documentos)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Indexando via Generated Columns
37
ALTER TABLE features ADD feature_type VARCHAR(30) AS (feature->"$.type");
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE features ADD INDEX (feature_type);
Query OK, 0 rows affected (0.73 sec)
Records: 0 Duplicates: 0 Warnings: 0
SELECT DISTINCT feature_type FROM features;
+--------------+
| feature_type |
+--------------+
| "Feature" |
+--------------+
1 row in set (0.06 sec)
Down from 1.25 sec to 0.06
sec
Creates index only. Does
not modify table rows.
Meta data change only
(FAST). Does not need to
touch table.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 38
Funções JSON: além do CRUD
JSON_ARRAY_APPEND()
JSON_ARRAY_INSERT()
JSON_ARRAY()
JSON_CONTAINS_PATH()
JSON_CONTAINS()
JSON_DEPTH()
JSON_EXTRACT()
JSON_INSERT()
JSON_KEYS()
JSON_LENGTH()
JSON_MERGE()
JSON_OBJECT()
JSON_QUOTE()
JSON_REMOVE()
JSON_REPLACE()
JSON_SEARCH()
JSON_SET()
JSON_TYPE()
JSON_UNQUOTE()
JSON_VALID()
https://dev.mysql.com/doc/refman/5.7/en/json-functions.html
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JSON Object Creation
39
SELECT JSON_OBJECT('id', id,
'street', feature->"$.properties.STREET",
'type', feature->"$.type"
) AS json_object
FROM features ORDER BY RAND() LIMIT 3;
+--------------------------------------------------------+
| json_object |
+--------------------------------------------------------+
| {"id": 122976, "type": "Feature", "street": "RAUSCH"} |
| {"id": 148698, "type": "Feature", "street": "WALLACE"} |
| {"id": 45214, "type": "Feature", "street": "HAIGHT"} |
+--------------------------------------------------------+
3 rows in set (3.11 sec)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JSON Array Creation
40
SELECT JSON_ARRAY(id,
feature->"$.properties.STREET",
feature->'$.type") AS json_array
FROM features ORDER BY RAND() LIMIT 3;
+-------------------------------+
| json_array |
+-------------------------------+
| [65298, "10TH", "Feature"] |
| [122985, "08TH", "Feature"] |
| [172884, "CURTIS", "Feature"] |
+-------------------------------+
3 rows in set (2.66 sec)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JSON_REPLACE()
41
SELECT JSON_REPLACE(feature, '$.type', JSON_ARRAY('feature', 'bug')) as
json_object FROM features LIMIT 1;
+--------------------------------------------------------+
| json_object |
+--------------------------------------------------------+
| {"type": ["feature", "bug"], "geometry": {"type": ..}} |
+--------------------------------------------------------+
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 42
Explore mais funções JSON
JSON_ARRAY_APPEND()
JSON_ARRAY_INSERT()
JSON_ARRAY()
JSON_CONTAINS_PATH()
JSON_CONTAINS()
JSON_DEPTH()
JSON_EXTRACT()
JSON_INSERT()
JSON_KEYS()
JSON_LENGTH()
JSON_MERGE()
JSON_OBJECT()
JSON_QUOTE()
JSON_REMOVE()
JSON_REPLACE()
JSON_SEARCH()
JSON_SET()
JSON_TYPE()
JSON_UNQUOTE()
JSON_VALID()
https://dev.mysql.com/doc/refman/5.7/en/json-functions.html
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 43
Exemplo CRUD modelo híbrido
MySQL 5.7.12+
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Exemplo Modelo híbrido: Schema + Schemaless
44
mysql> CREATE DATABASE product_hybrid_test;
mysql> USE product_hybrid_test;
mysql> CREATE TABLE product_info_hybrid (
product_id INT NOT NULL PRIMARY KEY,
description VARCHAR(60) NOT NULL,
price FLOAT NOT NULL,
attributes JSON NOT NULL
);
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
CREATE 1
mysql> INSERT INTO product_info_hybrid VALUES (
9,
't-shirt',
20.0,
'{
"size" : "M",
"color" : "red",
"fabric" : "cotton"
}');
Query OK, 1 row affected (0.01 sec)
45
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
CREATE 2
mysql> INSERT INTO product_info_hybrid VALUES (
10,
'socks',
15.0,
'{
"size" : "40"
}');
Query OK, 1 row affected (0.01 sec)
46
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
READ
mysql> SELECT * FROM product_info_hybrid;
+------------+-------------+-------+---------------------------------------------------+
| product_id | description | price | attributes |
+------------+-------------+-------+---------------------------------------------------+
| 9 | t-shirt | 20 | {"size": "M", "color": "red", "fabric": "cotton"} |
| 10 | socks | 15 | {"size": "40"} |
+------------+-------------+-------+---------------------------------------------------+
2 rows in set (0.00 sec)
47
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
READ com filtro
mysql> SELECT * FROM product_info_hybrid WHERE attributes->"$.size"="40";
+------------+-------------+-------+----------------+
| product_id | description | price | attributes |
+------------+-------------+-------+----------------+
| 10 | socks | 15 | {"size": "40"} |
+------------+-------------+-------+----------------+
1 row in set (0.00 sec)
48
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
UPDATE
mysql> UPDATE product_info_hybrid SET attributes = '{"size": "42"}' WHERE
product_id=10;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> SELECT * FROM product_info_hybrid;
+------------+-------------+-------+---------------------------------------------------+
| product_id | description | price | attributes |
+------------+-------------+-------+---------------------------------------------------+
| 9 | t-shirt | 20 | {"size": "M", "color": "red", "fabric": "cotton"} |
| 10 | socks | 15 | {"size": "42"} |
+------------+-------------+-------+---------------------------------------------------+
2 rows in set (0.00 sec)
49
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
DELETE
mysql> DELETE FROM product_info_hybrid WHERE attributes->"$.size"="42";
Query OK, 1 row affected (0.01 sec)
mysql> SELECT * FROM product_info_hybrid;
+------------+-------------+-------+---------------------------------------------------+
| product_id | description | price | attributes |
+------------+-------------+-------+---------------------------------------------------+
| 9 | t-shirt | 20 | {"size": "M", "color": "red", "fabric": "cotton"} |
+------------+-------------+-------+---------------------------------------------------+
1 row in set (0.00 sec)
50
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
SQL – modelo híbrido
• Native JSON datatype
• JSON Functions
• Generated Columns
XDev API – modelo em documentos
• Document Store plugin
• X Protocol
• MySQL Shell
• Connector/J
• Connector/Net
• Connector/Node.js
• Connector/Python
51
2 formas de utilização de MySQL como Document Store
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
XDev API
• Foco: facilidade de uso
• Abstração sobre SQL para operações
CRUD
• Add
• Find
• Modify
• Remove
• Sort
• Create Index
• X Sessions & Node Sessions
– abstração da conexão com BD
• Atualização dos conectores
– Connector/J
– Connector/Net
– Connector/Node.js
– Connector/Python
52
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Arquitetura SQL + NoSQL
53
MySQL
Plugins
X Protocol Plugin Memcached Plugin
Core
X ProtocolStd Protocol
X Protocol
33060
Std Protocol
3306
SQL API CRUD API
X and Std
Protocols
MySQL
Shell
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Arquitetura SQL + NoSQL
54
MySQL
Plugins
X Protocol Plugin Memcached Plugin
Core
X ProtocolStd Protocol
X Protocol
33060
Std Protocol
3306
SQL API CRUD API
X and Std
Protocols
MySQL
Shell
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 55
MySQL Shell
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 56
Exemplo CRUD Document API
MySQL 5.7.13+
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 57
CRUD: Documento vs Relacional
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 58
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 59
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 60
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 61
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 63
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL como Key-value Store
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Arquitetura SQL + NoSQL
66
MySQL
Plugins
X Protocol Plugin Memcached Plugin
Core
X ProtocolStd Protocol
X Protocol
33060
Std Protocol
3306
SQL API CRUD API
X and Std
Protocols
MySQL
Shell
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 67
MySQL com memcached: Key-Value Store
+1 000 000 QPS
*X86 48 cores
http://dimitrik.free.fr/blog/archives/2013/11/mysql-performance-over-1m-qps-with-
innodb-memcached-plugin-in-mysql-57.html
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
Conclusão
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
Um database flexível
– Mão-de-obra com conhecimentos
profundos
– Estável
– Custos efecientes e controlados
– Fácil mover dados entre instâncias
– Menos Drivers
– Menos Ferramentas
– SQL funciona, CRUD funciona
– Operacional e Analítico juntos
Muitos databases diferentes
– Requer repertório maior de
habilidades, dificulta encontrar mão de
obra com conhecimentos profundos
– Muitos Drivers
– Muitas Ferramentas
– Mais esforço para integrar,
compartilhar e mover dados
– Muito mais trabalho
– Separação muitas vezes desnecessária
de Operacional e Analítico
Por que combinar em um único database?
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
Livro:
Introduciong the MySQL 8
Document Store
– Chuck Bell, Editora Apress, 2018
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
Momento jabá
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
Treinamentos e Certificações
MySQL 5.6 Database
Administrator
MySQL 5.6 Developer
education.oracle.com/mysql
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
Enterprise Edition
Escalabilidade
Autenticação
Firewall
Auditoria
novo TDE
Criptografia
MySQL Enterprise Monitor
Oracle EM for MySQL
Plug-ins
Suporte
Hot
Backup
Monitor &
Workbench
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
cloud.oracle.com/pt_BR/mysql
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
http://www.oracle.com/webfolder/technetwork/tutorials/obe/
cloud/apaas/php/php-mysql-service/php-mysql-service.html
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
@MySQLBR meetup.com/MySQL-BRfacebook.com/MySQLBR
pt.planet.mysql.com
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
Perguntas?
Contatos:
airton.lastori@oracle.com
twitter.com/mysqlbr
facebook.com/mysqlbr
MySQL como Document Store PHP Conference 2017
Copyright © 2017 Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The preceding is intended to outline our general product direction. It is intended for
information purposes 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 upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
Ad

More Related Content

What's hot (20)

SQL Server 2017 Overview and Partner Opportunities
SQL Server 2017 Overview and Partner OpportunitiesSQL Server 2017 Overview and Partner Opportunities
SQL Server 2017 Overview and Partner Opportunities
Travis Wright
 
iForum 2015: SQL vs. NoSQL
iForum 2015: SQL vs. NoSQLiForum 2015: SQL vs. NoSQL
iForum 2015: SQL vs. NoSQL
Денис Резник
 
SQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the EnterpriseSQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the Enterprise
Anita Luthra
 
Database basics for new-ish developers -- All Things Open October 18th 2021
Database basics for new-ish developers  -- All Things Open October 18th 2021Database basics for new-ish developers  -- All Things Open October 18th 2021
Database basics for new-ish developers -- All Things Open October 18th 2021
Dave Stokes
 
MySQL Connector/Node.js and the X DevAPI
MySQL Connector/Node.js and the X DevAPIMySQL Connector/Node.js and the X DevAPI
MySQL Connector/Node.js and the X DevAPI
Rui Quelhas
 
ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News!
ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News! ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News!
ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News!
Embarcadero Technologies
 
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | EdurekaSQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
Edureka!
 
Strata+Hadoop World NY 2016 - Avinash Ramineni
Strata+Hadoop World NY 2016 - Avinash RamineniStrata+Hadoop World NY 2016 - Avinash Ramineni
Strata+Hadoop World NY 2016 - Avinash Ramineni
Avinash Ramineni
 
50 Shades of Data - how, when and why Big, Fast, Relational, NoSQL, Elastic, ...
50 Shades of Data - how, when and why Big, Fast, Relational, NoSQL, Elastic, ...50 Shades of Data - how, when and why Big, Fast, Relational, NoSQL, Elastic, ...
50 Shades of Data - how, when and why Big, Fast, Relational, NoSQL, Elastic, ...
Lucas Jellema
 
Introduction to azure document db
Introduction to azure document dbIntroduction to azure document db
Introduction to azure document db
Antonios Chatzipavlis
 
Make your SharePoint fly by tuning and optimizing SQL Server
Make your SharePoint  fly by tuning and optimizing SQL ServerMake your SharePoint  fly by tuning and optimizing SQL Server
Make your SharePoint fly by tuning and optimizing SQL Server
serge luca
 
MongoDB vs OrientDB
MongoDB vs OrientDBMongoDB vs OrientDB
MongoDB vs OrientDB
Stefano Campese
 
MongoDB - An Agile NoSQL Database
MongoDB - An Agile NoSQL DatabaseMongoDB - An Agile NoSQL Database
MongoDB - An Agile NoSQL Database
Gaurav Awasthi
 
GraphTour - Albelli: Running Neo4j on a large scale image platform
GraphTour - Albelli: Running Neo4j on a large scale image platformGraphTour - Albelli: Running Neo4j on a large scale image platform
GraphTour - Albelli: Running Neo4j on a large scale image platform
Neo4j
 
SQL vs NoSQL
SQL vs NoSQLSQL vs NoSQL
SQL vs NoSQL
Jacinto Limjap
 
NOSQL vs SQL
NOSQL vs SQLNOSQL vs SQL
NOSQL vs SQL
Mohammed Fazuluddin
 
3 CityNetConf - sql+c#=u-sql
3 CityNetConf - sql+c#=u-sql3 CityNetConf - sql+c#=u-sql
3 CityNetConf - sql+c#=u-sql
Łukasz Grala
 
SQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDBSQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDB
Marco Segato
 
Session #2, tech session: Build realtime search by Sylvain Utard from Algolia
Session #2, tech session: Build realtime search by Sylvain Utard from AlgoliaSession #2, tech session: Build realtime search by Sylvain Utard from Algolia
Session #2, tech session: Build realtime search by Sylvain Utard from Algolia
SaaS Is Beautiful
 
Mysql8for blr usercamp
Mysql8for blr usercampMysql8for blr usercamp
Mysql8for blr usercamp
Mysql User Camp
 
SQL Server 2017 Overview and Partner Opportunities
SQL Server 2017 Overview and Partner OpportunitiesSQL Server 2017 Overview and Partner Opportunities
SQL Server 2017 Overview and Partner Opportunities
Travis Wright
 
SQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the EnterpriseSQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the Enterprise
Anita Luthra
 
Database basics for new-ish developers -- All Things Open October 18th 2021
Database basics for new-ish developers  -- All Things Open October 18th 2021Database basics for new-ish developers  -- All Things Open October 18th 2021
Database basics for new-ish developers -- All Things Open October 18th 2021
Dave Stokes
 
MySQL Connector/Node.js and the X DevAPI
MySQL Connector/Node.js and the X DevAPIMySQL Connector/Node.js and the X DevAPI
MySQL Connector/Node.js and the X DevAPI
Rui Quelhas
 
ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News!
ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News! ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News!
ER/Studio and DB PowerStudio Launch Webinar: Big Data, Big Models, Big News!
Embarcadero Technologies
 
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | EdurekaSQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
Edureka!
 
Strata+Hadoop World NY 2016 - Avinash Ramineni
Strata+Hadoop World NY 2016 - Avinash RamineniStrata+Hadoop World NY 2016 - Avinash Ramineni
Strata+Hadoop World NY 2016 - Avinash Ramineni
Avinash Ramineni
 
50 Shades of Data - how, when and why Big, Fast, Relational, NoSQL, Elastic, ...
50 Shades of Data - how, when and why Big, Fast, Relational, NoSQL, Elastic, ...50 Shades of Data - how, when and why Big, Fast, Relational, NoSQL, Elastic, ...
50 Shades of Data - how, when and why Big, Fast, Relational, NoSQL, Elastic, ...
Lucas Jellema
 
Make your SharePoint fly by tuning and optimizing SQL Server
Make your SharePoint  fly by tuning and optimizing SQL ServerMake your SharePoint  fly by tuning and optimizing SQL Server
Make your SharePoint fly by tuning and optimizing SQL Server
serge luca
 
MongoDB - An Agile NoSQL Database
MongoDB - An Agile NoSQL DatabaseMongoDB - An Agile NoSQL Database
MongoDB - An Agile NoSQL Database
Gaurav Awasthi
 
GraphTour - Albelli: Running Neo4j on a large scale image platform
GraphTour - Albelli: Running Neo4j on a large scale image platformGraphTour - Albelli: Running Neo4j on a large scale image platform
GraphTour - Albelli: Running Neo4j on a large scale image platform
Neo4j
 
3 CityNetConf - sql+c#=u-sql
3 CityNetConf - sql+c#=u-sql3 CityNetConf - sql+c#=u-sql
3 CityNetConf - sql+c#=u-sql
Łukasz Grala
 
SQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDBSQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDB
Marco Segato
 
Session #2, tech session: Build realtime search by Sylvain Utard from Algolia
Session #2, tech session: Build realtime search by Sylvain Utard from AlgoliaSession #2, tech session: Build realtime search by Sylvain Utard from Algolia
Session #2, tech session: Build realtime search by Sylvain Utard from Algolia
SaaS Is Beautiful
 

Similar to MySQL como Document Store PHP Conference 2017 (20)

MySQL 8.0 - What's New ?
MySQL 8.0 - What's New ?MySQL 8.0 - What's New ?
MySQL 8.0 - What's New ?
Olivier DASINI
 
Novinky v Oracle Database 18c
Novinky v Oracle Database 18cNovinky v Oracle Database 18c
Novinky v Oracle Database 18c
MarketingArrowECS_CZ
 
20171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v120171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v1
Ivan Ma
 
MySQL 8.0 in a nutshell
MySQL 8.0 in a nutshellMySQL 8.0 in a nutshell
MySQL 8.0 in a nutshell
OracleMySQL
 
State ofdolphin short
State ofdolphin shortState ofdolphin short
State ofdolphin short
Mandy Ang
 
What's New in MySQL 8.0 @ HKOSC 2017
What's New in MySQL 8.0 @ HKOSC 2017What's New in MySQL 8.0 @ HKOSC 2017
What's New in MySQL 8.0 @ HKOSC 2017
Ivan Ma
 
MySQL Day Paris 2018 - MySQL JSON Document Store
MySQL Day Paris 2018 - MySQL JSON Document StoreMySQL Day Paris 2018 - MySQL JSON Document Store
MySQL Day Paris 2018 - MySQL JSON Document Store
Olivier DASINI
 
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 ?
Olivier DASINI
 
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...
Frederic Descamps
 
MySQL 8.0.1 DMR
MySQL 8.0.1 DMRMySQL 8.0.1 DMR
MySQL 8.0.1 DMR
MySQL Brasil
 
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document StoreConnector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Filipe Silva
 
MySQL Document Store for Modern Applications
MySQL Document Store for Modern ApplicationsMySQL Document Store for Modern Applications
MySQL Document Store for Modern Applications
Olivier DASINI
 
MySQL 8 loves JavaScript
MySQL 8 loves JavaScript MySQL 8 loves JavaScript
MySQL 8 loves JavaScript
Sanjay Manwani
 
Data dictionary pl17
Data dictionary pl17Data dictionary pl17
Data dictionary pl17
Ståle Deraas
 
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
Andrew Morgan
 
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
Olivier DASINI
 
SQL for Analytics.pdfSQL for Analytics.pdf
SQL for Analytics.pdfSQL for Analytics.pdfSQL for Analytics.pdfSQL for Analytics.pdf
SQL for Analytics.pdfSQL for Analytics.pdf
namtunguyen6
 
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...
Olivier DASINI
 
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...
Olivier DASINI
 
RMOUG MySQL 5.7 New Features
RMOUG MySQL 5.7 New FeaturesRMOUG MySQL 5.7 New Features
RMOUG MySQL 5.7 New Features
Dave Stokes
 
MySQL 8.0 - What's New ?
MySQL 8.0 - What's New ?MySQL 8.0 - What's New ?
MySQL 8.0 - What's New ?
Olivier DASINI
 
20171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v120171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v1
Ivan Ma
 
MySQL 8.0 in a nutshell
MySQL 8.0 in a nutshellMySQL 8.0 in a nutshell
MySQL 8.0 in a nutshell
OracleMySQL
 
State ofdolphin short
State ofdolphin shortState ofdolphin short
State ofdolphin short
Mandy Ang
 
What's New in MySQL 8.0 @ HKOSC 2017
What's New in MySQL 8.0 @ HKOSC 2017What's New in MySQL 8.0 @ HKOSC 2017
What's New in MySQL 8.0 @ HKOSC 2017
Ivan Ma
 
MySQL Day Paris 2018 - MySQL JSON Document Store
MySQL Day Paris 2018 - MySQL JSON Document StoreMySQL Day Paris 2018 - MySQL JSON Document Store
MySQL Day Paris 2018 - MySQL JSON Document Store
Olivier DASINI
 
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 ?
Olivier DASINI
 
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...
Frederic Descamps
 
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document StoreConnector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Filipe Silva
 
MySQL Document Store for Modern Applications
MySQL Document Store for Modern ApplicationsMySQL Document Store for Modern Applications
MySQL Document Store for Modern Applications
Olivier DASINI
 
MySQL 8 loves JavaScript
MySQL 8 loves JavaScript MySQL 8 loves JavaScript
MySQL 8 loves JavaScript
Sanjay Manwani
 
Data dictionary pl17
Data dictionary pl17Data dictionary pl17
Data dictionary pl17
Ståle Deraas
 
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
Andrew Morgan
 
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
Olivier DASINI
 
SQL for Analytics.pdfSQL for Analytics.pdf
SQL for Analytics.pdfSQL for Analytics.pdfSQL for Analytics.pdfSQL for Analytics.pdf
SQL for Analytics.pdfSQL for Analytics.pdf
namtunguyen6
 
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...
Olivier DASINI
 
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...
Olivier DASINI
 
RMOUG MySQL 5.7 New Features
RMOUG MySQL 5.7 New FeaturesRMOUG MySQL 5.7 New Features
RMOUG MySQL 5.7 New Features
Dave Stokes
 
Ad

More from MySQL Brasil (20)

MySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e UberMySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e Uber
MySQL Brasil
 
Alta disponibilidade com MySQL Enterprise
Alta disponibilidade com MySQL EnterpriseAlta disponibilidade com MySQL Enterprise
Alta disponibilidade com MySQL Enterprise
MySQL Brasil
 
MySQL Roadmap NoSQL HA Fev17
MySQL Roadmap NoSQL HA Fev17MySQL Roadmap NoSQL HA Fev17
MySQL Roadmap NoSQL HA Fev17
MySQL Brasil
 
Segurança no MySQL
Segurança no MySQLSegurança no MySQL
Segurança no MySQL
MySQL Brasil
 
5 razões estratégicas para usar MySQL
5 razões estratégicas para usar MySQL5 razões estratégicas para usar MySQL
5 razões estratégicas para usar MySQL
MySQL Brasil
 
Alta disponibilidade no MySQL 5.7 GUOB 2016
Alta disponibilidade no MySQL 5.7 GUOB 2016Alta disponibilidade no MySQL 5.7 GUOB 2016
Alta disponibilidade no MySQL 5.7 GUOB 2016
MySQL Brasil
 
MySQL 5.7 como Document Store
MySQL 5.7 como Document StoreMySQL 5.7 como Document Store
MySQL 5.7 como Document Store
MySQL Brasil
 
Enabling digital transformation with MySQL
Enabling digital transformation with MySQLEnabling digital transformation with MySQL
Enabling digital transformation with MySQL
MySQL Brasil
 
Alta Disponibilidade no MySQL 5.7 para aplicações em PHP
Alta Disponibilidade no MySQL 5.7 para aplicações em PHPAlta Disponibilidade no MySQL 5.7 para aplicações em PHP
Alta Disponibilidade no MySQL 5.7 para aplicações em PHP
MySQL Brasil
 
Alta Disponibilidade no MySQL 5.7
Alta Disponibilidade no MySQL 5.7Alta Disponibilidade no MySQL 5.7
Alta Disponibilidade no MySQL 5.7
MySQL Brasil
 
NoSQL no MySQL 5.7
NoSQL no MySQL 5.7NoSQL no MySQL 5.7
NoSQL no MySQL 5.7
MySQL Brasil
 
OpenStack & MySQL
OpenStack & MySQLOpenStack & MySQL
OpenStack & MySQL
MySQL Brasil
 
10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em Startups10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em Startups
MySQL Brasil
 
Novidades do MySQL para desenvolvedores ago15
Novidades do MySQL para desenvolvedores ago15Novidades do MySQL para desenvolvedores ago15
Novidades do MySQL para desenvolvedores ago15
MySQL Brasil
 
Estratégias de Segurança e Gerenciamento para MySQL
Estratégias de Segurança e Gerenciamento para MySQLEstratégias de Segurança e Gerenciamento para MySQL
Estratégias de Segurança e Gerenciamento para MySQL
MySQL Brasil
 
Novidades do Universo MySQL julho-15
Novidades do Universo MySQL julho-15Novidades do Universo MySQL julho-15
Novidades do Universo MySQL julho-15
MySQL Brasil
 
Serviços Escaláveis e de Alta Performance com MySQL e Java
Serviços Escaláveis e de Alta Performance com MySQL e JavaServiços Escaláveis e de Alta Performance com MySQL e Java
Serviços Escaláveis e de Alta Performance com MySQL e Java
MySQL Brasil
 
MySQL The State of the Dolphin - jun15
MySQL The State of the Dolphin - jun15MySQL The State of the Dolphin - jun15
MySQL The State of the Dolphin - jun15
MySQL Brasil
 
Aumentando a segurança, disponibilidade e desempenho com MySQL Enterprise Edi...
Aumentando a segurança, disponibilidade e desempenho com MySQL Enterprise Edi...Aumentando a segurança, disponibilidade e desempenho com MySQL Enterprise Edi...
Aumentando a segurança, disponibilidade e desempenho com MySQL Enterprise Edi...
MySQL Brasil
 
Desenvolvendo serviços escaláveis e de alta performance com MySQL
Desenvolvendo serviços escaláveis e de alta performance com MySQLDesenvolvendo serviços escaláveis e de alta performance com MySQL
Desenvolvendo serviços escaláveis e de alta performance com MySQL
MySQL Brasil
 
MySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e UberMySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e Uber
MySQL Brasil
 
Alta disponibilidade com MySQL Enterprise
Alta disponibilidade com MySQL EnterpriseAlta disponibilidade com MySQL Enterprise
Alta disponibilidade com MySQL Enterprise
MySQL Brasil
 
MySQL Roadmap NoSQL HA Fev17
MySQL Roadmap NoSQL HA Fev17MySQL Roadmap NoSQL HA Fev17
MySQL Roadmap NoSQL HA Fev17
MySQL Brasil
 
Segurança no MySQL
Segurança no MySQLSegurança no MySQL
Segurança no MySQL
MySQL Brasil
 
5 razões estratégicas para usar MySQL
5 razões estratégicas para usar MySQL5 razões estratégicas para usar MySQL
5 razões estratégicas para usar MySQL
MySQL Brasil
 
Alta disponibilidade no MySQL 5.7 GUOB 2016
Alta disponibilidade no MySQL 5.7 GUOB 2016Alta disponibilidade no MySQL 5.7 GUOB 2016
Alta disponibilidade no MySQL 5.7 GUOB 2016
MySQL Brasil
 
MySQL 5.7 como Document Store
MySQL 5.7 como Document StoreMySQL 5.7 como Document Store
MySQL 5.7 como Document Store
MySQL Brasil
 
Enabling digital transformation with MySQL
Enabling digital transformation with MySQLEnabling digital transformation with MySQL
Enabling digital transformation with MySQL
MySQL Brasil
 
Alta Disponibilidade no MySQL 5.7 para aplicações em PHP
Alta Disponibilidade no MySQL 5.7 para aplicações em PHPAlta Disponibilidade no MySQL 5.7 para aplicações em PHP
Alta Disponibilidade no MySQL 5.7 para aplicações em PHP
MySQL Brasil
 
Alta Disponibilidade no MySQL 5.7
Alta Disponibilidade no MySQL 5.7Alta Disponibilidade no MySQL 5.7
Alta Disponibilidade no MySQL 5.7
MySQL Brasil
 
NoSQL no MySQL 5.7
NoSQL no MySQL 5.7NoSQL no MySQL 5.7
NoSQL no MySQL 5.7
MySQL Brasil
 
10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em Startups10 Razões para Usar MySQL em Startups
10 Razões para Usar MySQL em Startups
MySQL Brasil
 
Novidades do MySQL para desenvolvedores ago15
Novidades do MySQL para desenvolvedores ago15Novidades do MySQL para desenvolvedores ago15
Novidades do MySQL para desenvolvedores ago15
MySQL Brasil
 
Estratégias de Segurança e Gerenciamento para MySQL
Estratégias de Segurança e Gerenciamento para MySQLEstratégias de Segurança e Gerenciamento para MySQL
Estratégias de Segurança e Gerenciamento para MySQL
MySQL Brasil
 
Novidades do Universo MySQL julho-15
Novidades do Universo MySQL julho-15Novidades do Universo MySQL julho-15
Novidades do Universo MySQL julho-15
MySQL Brasil
 
Serviços Escaláveis e de Alta Performance com MySQL e Java
Serviços Escaláveis e de Alta Performance com MySQL e JavaServiços Escaláveis e de Alta Performance com MySQL e Java
Serviços Escaláveis e de Alta Performance com MySQL e Java
MySQL Brasil
 
MySQL The State of the Dolphin - jun15
MySQL The State of the Dolphin - jun15MySQL The State of the Dolphin - jun15
MySQL The State of the Dolphin - jun15
MySQL Brasil
 
Aumentando a segurança, disponibilidade e desempenho com MySQL Enterprise Edi...
Aumentando a segurança, disponibilidade e desempenho com MySQL Enterprise Edi...Aumentando a segurança, disponibilidade e desempenho com MySQL Enterprise Edi...
Aumentando a segurança, disponibilidade e desempenho com MySQL Enterprise Edi...
MySQL Brasil
 
Desenvolvendo serviços escaláveis e de alta performance com MySQL
Desenvolvendo serviços escaláveis e de alta performance com MySQLDesenvolvendo serviços escaláveis e de alta performance com MySQL
Desenvolvendo serviços escaláveis e de alta performance com MySQL
MySQL Brasil
 
Ad

Recently uploaded (20)

2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 

MySQL como Document Store PHP Conference 2017

  • 1. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | MySQL como Document Store Airton Lastori Consultor MySQL [email protected] Dez-2017
  • 2. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | Você usa MySQL?
  • 3. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL é o banco de dados de código aberto mais popular do mundo. 3
  • 4. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | Popularidade dos Bancos de Dados http://db-engines.com/en/ranking_trend (339 systems in ranking, December 2017)
  • 5. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | “The demand for database administrators and developers is much higher than the current supply, as well, leading to lots of open positions.” https://stackoverflow.blog/2017/03/09 /developer-hiring-trends-2017/
  • 6. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Algumas novidades
  • 7. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Read Scale-Out Async Replication + Auto Failover Write Scale-Out Sharding S1 S2 S3 S4 MySQL Vision – 4 Steps Timeline MySQL Document Store Relational & Document Model MySQL HA Out-Of-Box HA
  • 8. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Standalone MySQL Replication 8 MySQL InnoDB Cluster MySQL Cluster (NDB) Arquiteturas para Alta Disponibilidade
  • 9. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL InnoDB Cluster Group Replication Router Router App App • Banco de dados replicado altamente disponível e tolerante a falhas • Permite topologias Multi-Primary (ativo-ativo) ou Single-Primary • Arquitetura cloud-friendly, shared- nothing, sem storage compartilhado • Automatiza failover e failback, reconfiguração e reconexão após falhas • GA, pronto para produção desde a versão 5.7.17 (dez/16) MySQL Shell
  • 10. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | • 2 anos em Desenvolvimento • 400+ Worklogs • 5000+ Bugs corrigidos • 500 novos testes • Suporte melhorado para JSON • API Document Store mais completa • CTEs e Window Functions • Melhor manipulação de Hot Rows • Unicode 9.0, utf8 charset padrão • Performance mais consistente via estatísticas • GIS • Mais facilidades para administração em Cloud • Novo Data Dictionary nativo • Invisible Indexes • Atualizações das configurações padrão • Refactoring, C++11, etc… 10 MySQL 8.0 Release Candidate 1
  • 11. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 11
  • 12. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Por que Document Store?
  • 13. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Read Scale-Out Async Replication + Auto Failover Write Scale-Out Sharding S1 S2 S3 S4 MySQL Vision – 4 Steps Timeline MySQL Document Store Relational & Document Model MySQL HA Out-Of-Box HA
  • 14. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 14 Relacional vs Não-relacional id name email city_id 3412 John Smith [email protected] 45 id city country_id 45 San Francisco US customer city id id_customer date total 381 3412 2017-08-24 312.20 412 3412 2017-10-02 24.95 shop_order Schemaless, NoSQL, Não-estruturado { "name": "John Smith", "email": "[email protected]", "city": "San Francisco", "country": "US", "orders": [ {"date": "2017-08-24", "total": 312.20}, {"date": "2017-10-02", "total": 24.95} ] } Schema, SQL, Estruturado
  • 15. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Modelo Relacional • Maior esforço antecipado durante a fase de design – modelagem de dados e normalização – definição do esquema físico • O banco de dados assegura a integridade (dados inválidos são rejeitados) – Tipos de dados – Restrições (chaves estrangeiras etc.) Modelo baseado em Documentos • Menor esforço antecipado – estrutura de dados definida no código do aplicativo • Aplicação é responsável pela integridade dos dados – possibilidade de dados de má qualidade serem inseridos no sistema (por causa de bugs, alterações na aplicação, etc.) Oracle Confidential – Internal/Restricted/Highly Restricted 15 Qual o melhor?
  • 16. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Modelo Relacional • Pequena curva de aprendizagem – Requer conhecimento de SQL • SQL permite que o otimizador execute consultas complexas de forma eficiente - especialmente quando há JOINS de várias tabelas • Alterações no modelo (schema) ao longo da evolução da aplicação podem ser problemáticas - especialmente para atualizações Modelo baseado em Documentos • Mais fácil de começar • JOINS limitados ou inexistentes, otimizador simples - complexidade de consultas passadas para a aplicação resolver • Implementação de alterações mais simples - os documentos criados em diferentes versões da aplicação podem coexistir. Oracle Confidential – Internal/Restricted/Highly Restricted 16 Qual o melhor?
  • 17. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Modelo Relacional • Mais integridade no schema, independente da aplicação • Schema torna a aplicação mais fácil de manter no longo prazo, pois há maior controle nas mudanças – Espera-se uma maior qualidade dos dados – Permite aplicação de algumas validações automáticas sobre os dados • JOINS, consultas complexas resolvidas pelo otimizador Modelo baseado em Documentos • Menor preocupação na definição de Tipos de Dados, protótipos rápidos, comece armazenar dados imediatamente • Mais liberdade para representar dados (ex. Campos custom) • Menos dor-de-cabeça para aplicar mudanças no modelo de dados • Denormalização natural, registro auto- contido (ex. facilita escalabilidade horizontal via sharding) Oracle Confidential – Internal/Restricted/Highly Restricted 17 Pontos fortes
  • 18. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 18 Banco de Dados Híbrido: Confiabilidade + Flexibilidade MySQL 5.7 Document Store Suporte JSON Nova API BDs Relacionais Tecnologia madura, comprovadamente segura. Transações, queries, JOINs complexos e conjunto extenso de ferrametnas operacionais NoSQL Flexibilidade. Escalabilidade horizontal e facilidade de uso, schemaless, document store (JSON) Aplicações Modernas Agile + DevOps com proteção robusta dos dados Banco de Dados Híbrido Melhor dos mundos, sem trade-offs. Propriedades ACID & confiabilidade de SGBDR + flexibilidade de document store
  • 19. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 19 Document Store _id customer_shop 3412 customer { "name": "John Smith", "email": "[email protected]", "city": "San Francisco", "country": "US", "orders": [ {"date": "2017-08-24", "total": 312.20}, {"date": "2017-10-02", "total": 24.95} ] }
  • 20. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | SQL - Document Store CREATE DATABASE customer_doc; USE customer_doc; CREATE TABLE customer ( _id INT NOT NULL AUTO_INCREMENT, customer_shop JSON NOT NULL, PRIMARY KEY (_id) ); 20
  • 21. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | SQL - Document Store INSERT INTO customer (_id, customer_shop) VALUES (3412, '{ "name": "John Smith", "email": "[email protected]", "city": "San Francisco", "country": "US", "orders": [ {"date": "2017-08-24", "total": 312.20}, {"date": "2017-10-02", "total": 24.95} ] }'); 21
  • 22. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 22 Relacional + Document Store id name email city_id shop 3412 John Smith [email protected] 45 id city country_id 45 San Francisco US customer_and_orders city { "orders": [ {"date": "2017-08-24", "total": 312.20}, {"date": "2017-10-02", "total": 24.95} ] }
  • 23. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 23 Relacional + Document Store
  • 24. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | CREATE DATABASE customer_hybrid; USE customer_hybrid; CREATE TABLE city ( id INT NOT NULL AUTO_INCREMENT, city VARCHAR(60) NOT NULL, country_id CHAR(2), PRIMARY KEY(id) ); CREATE TABLE customer_and_orders ( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(60) NOT NULL, email VARCHAR(50) NOT NULL, city_id INT NOT NULL, shop JSON NOT NULL, PRIMARY KEY (id), CONSTRAINT FK_customer_city FOREIGN KEY (city_id) REFERENCES city(id) ); 24 SQL - Relacional + Document Store
  • 25. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | INSERT INTO city (id, city, country_id) VALUES (45, 'San Francisco', 'US'); SELECT * FROM city; INSERT INTO customer_and_orders (id, name, email, city_id, shop) VALUES (3412, 'John Smith', '[email protected]', 45, '{ "orders": [ {"date": "2017-08-24", "total": 312.20}, {"date": "2017-10-02", "total": 24.95} ] }'); SELECT * FROM customer_and_orders; 25 SQL - Relacional + Document Store
  • 26. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Como usar o MySQL como Document Store
  • 27. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | SQL – modelo híbrido • Native JSON datatype • JSON Functions • Generated Columns XDev API – modelo em documentos • Document Store plugin • X Protocol • MySQL Shell • Connector/J • Connector/Net • Connector/Node.js • Connector/Python 27 2 formas de utilização de MySQL como Document Store
  • 28. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | SQL – modelo híbrido • Native JSON datatype • JSON Functions • Generated Columns XDev API – modelo em documentos • Document Store plugin • X Protocol • MySQL Shell • Connector/J • Connector/Net • Connector/Node.js • Connector/Python 28 2 formas de utilização de MySQL como Document Store
  • 29. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Tipo nativo JSON 29 CREATE TABLE employees (data JSON); INSERT INTO employees VALUES ('{"id": 1, "name": "Jane"}'); INSERT INTO employees VALUES ('{"id": 2, "name": "Joe"}'); SELECT * FROM employees; +---------------------------+ | data | +---------------------------+ | {"id": 1, "name": "Jane"} | | {"id": 2, "name": "Joe"} | +---------------------------+ 2 rows in set (0,00 sec)
  • 30. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Vantagens sobre tipos TEXT/VARCHAR 1. Validação 2. Eficiência no armazenamento físico Formato binário otimizado que permite um acesso mais rápido aos elementos de matrizes 30 INSERT INTO employees VALUES ('texto que não é JSON válido'); ERROR 3130 (22032): Invalid JSON text: "Expect a value here." at position 0 in value (or column) 'texto que não é JSON válido'.
  • 31. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 31 Funções JSON JSON_ARRAY_APPEND() JSON_ARRAY_INSERT() JSON_ARRAY() JSON_CONTAINS_PATH() JSON_CONTAINS() JSON_DEPTH() JSON_EXTRACT() JSON_INSERT() JSON_KEYS() JSON_LENGTH() JSON_MERGE() JSON_OBJECT() JSON_QUOTE() JSON_REMOVE() JSON_REPLACE() JSON_SEARCH() JSON_SET() JSON_TYPE() JSON_UNQUOTE() JSON_VALID() https://dev.mysql.com/doc/refman/5.7/en/json-functions.html
  • 32. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Exemplo: JSON_EXTRACT 32 SET @document = '[10, 20, [30, 40]]'; SELECT JSON_EXTRACT(@document, '$[1]'); +---------------------------------+ | JSON_EXTRACT(@document, '$[1]') | +---------------------------------+ | 20 | +---------------------------------+ 1 row in set (0.01 sec)
  • 33. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Generated Columns 33 id my_integer my_integer_plus_one 1 10 11 2 20 21 3 30 31 4 40 41 UPDATE t1 SET my_integer_plus_one = 10 WHERE id = 1; ERROR 3105 (HY000): The value specified for generated column 'my_integer_plus_one' in table 't1' is not allowed. Coluna atualizada automaticamente com base na definição CREATE. Somente leitura, é claro! CREATE TABLE t1 ( id INT NOT NULL PRIMARY KEY auto_increment, my_integer INT, my_integer_plus_one INT AS (my_integer + 1) );
  • 34. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Testes com dados reais • San Francisco OpenData • 206K objetos JSON • Importado de https://github.com/zemirco/sf-city-lots-json + ajustes 34 CREATE TABLE features ( id INT NOT NULL auto_increment primary key, feature JSON NOT NULL );
  • 35. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 35 { "type":"Feature", "geometry":{ "type":"Polygon", "coordinates":[ [ [-122.42200352825247,37.80848009696725,0], [-122.42207601332528,37.808835019815085,0], [-122.42110217434865,37.808803534992904,0], [-122.42106256906727,37.80860105681814,0], [-122.42200352825247,37.80848009696725,0] ] ] }, "properties":{ "TO_ST":"0", "BLKLOT":"0001001", "STREET":"UNKNOWN", "FROM_ST":"0", "LOT_NUM":"001", "ST_TYPE":null, "ODD_EVEN":"E", "BLOCK_NUM":"0001", "MAPBLKLOT":"0001001" } }
  • 36. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Comparação de Performance: JSON vs TEXT 36 # tipo JSON SELECT DISTINCT feature->"$.type" as json_extract FROM features; +--------------+ | json_extract | +--------------+ | "Feature" | +--------------+ 1 row in set (1.25 sec) # tipo TEXT SELECT DISTINCT feature->"$.type" as json_extract FROM features; +--------------+ | json_extract | +--------------+ | "Feature" | +--------------+ 1 row in set (12.85 sec) JSON 10x mais rápido que TEXT numa busca full scan (sem índice, 206K documentos)
  • 37. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Indexando via Generated Columns 37 ALTER TABLE features ADD feature_type VARCHAR(30) AS (feature->"$.type"); Query OK, 0 rows affected (0.01 sec) Records: 0 Duplicates: 0 Warnings: 0 ALTER TABLE features ADD INDEX (feature_type); Query OK, 0 rows affected (0.73 sec) Records: 0 Duplicates: 0 Warnings: 0 SELECT DISTINCT feature_type FROM features; +--------------+ | feature_type | +--------------+ | "Feature" | +--------------+ 1 row in set (0.06 sec) Down from 1.25 sec to 0.06 sec Creates index only. Does not modify table rows. Meta data change only (FAST). Does not need to touch table.
  • 38. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 38 Funções JSON: além do CRUD JSON_ARRAY_APPEND() JSON_ARRAY_INSERT() JSON_ARRAY() JSON_CONTAINS_PATH() JSON_CONTAINS() JSON_DEPTH() JSON_EXTRACT() JSON_INSERT() JSON_KEYS() JSON_LENGTH() JSON_MERGE() JSON_OBJECT() JSON_QUOTE() JSON_REMOVE() JSON_REPLACE() JSON_SEARCH() JSON_SET() JSON_TYPE() JSON_UNQUOTE() JSON_VALID() https://dev.mysql.com/doc/refman/5.7/en/json-functions.html
  • 39. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JSON Object Creation 39 SELECT JSON_OBJECT('id', id, 'street', feature->"$.properties.STREET", 'type', feature->"$.type" ) AS json_object FROM features ORDER BY RAND() LIMIT 3; +--------------------------------------------------------+ | json_object | +--------------------------------------------------------+ | {"id": 122976, "type": "Feature", "street": "RAUSCH"} | | {"id": 148698, "type": "Feature", "street": "WALLACE"} | | {"id": 45214, "type": "Feature", "street": "HAIGHT"} | +--------------------------------------------------------+ 3 rows in set (3.11 sec)
  • 40. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JSON Array Creation 40 SELECT JSON_ARRAY(id, feature->"$.properties.STREET", feature->'$.type") AS json_array FROM features ORDER BY RAND() LIMIT 3; +-------------------------------+ | json_array | +-------------------------------+ | [65298, "10TH", "Feature"] | | [122985, "08TH", "Feature"] | | [172884, "CURTIS", "Feature"] | +-------------------------------+ 3 rows in set (2.66 sec)
  • 41. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JSON_REPLACE() 41 SELECT JSON_REPLACE(feature, '$.type', JSON_ARRAY('feature', 'bug')) as json_object FROM features LIMIT 1; +--------------------------------------------------------+ | json_object | +--------------------------------------------------------+ | {"type": ["feature", "bug"], "geometry": {"type": ..}} | +--------------------------------------------------------+
  • 42. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 42 Explore mais funções JSON JSON_ARRAY_APPEND() JSON_ARRAY_INSERT() JSON_ARRAY() JSON_CONTAINS_PATH() JSON_CONTAINS() JSON_DEPTH() JSON_EXTRACT() JSON_INSERT() JSON_KEYS() JSON_LENGTH() JSON_MERGE() JSON_OBJECT() JSON_QUOTE() JSON_REMOVE() JSON_REPLACE() JSON_SEARCH() JSON_SET() JSON_TYPE() JSON_UNQUOTE() JSON_VALID() https://dev.mysql.com/doc/refman/5.7/en/json-functions.html
  • 43. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 43 Exemplo CRUD modelo híbrido MySQL 5.7.12+
  • 44. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Exemplo Modelo híbrido: Schema + Schemaless 44 mysql> CREATE DATABASE product_hybrid_test; mysql> USE product_hybrid_test; mysql> CREATE TABLE product_info_hybrid ( product_id INT NOT NULL PRIMARY KEY, description VARCHAR(60) NOT NULL, price FLOAT NOT NULL, attributes JSON NOT NULL );
  • 45. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | CREATE 1 mysql> INSERT INTO product_info_hybrid VALUES ( 9, 't-shirt', 20.0, '{ "size" : "M", "color" : "red", "fabric" : "cotton" }'); Query OK, 1 row affected (0.01 sec) 45
  • 46. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | CREATE 2 mysql> INSERT INTO product_info_hybrid VALUES ( 10, 'socks', 15.0, '{ "size" : "40" }'); Query OK, 1 row affected (0.01 sec) 46
  • 47. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | READ mysql> SELECT * FROM product_info_hybrid; +------------+-------------+-------+---------------------------------------------------+ | product_id | description | price | attributes | +------------+-------------+-------+---------------------------------------------------+ | 9 | t-shirt | 20 | {"size": "M", "color": "red", "fabric": "cotton"} | | 10 | socks | 15 | {"size": "40"} | +------------+-------------+-------+---------------------------------------------------+ 2 rows in set (0.00 sec) 47
  • 48. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | READ com filtro mysql> SELECT * FROM product_info_hybrid WHERE attributes->"$.size"="40"; +------------+-------------+-------+----------------+ | product_id | description | price | attributes | +------------+-------------+-------+----------------+ | 10 | socks | 15 | {"size": "40"} | +------------+-------------+-------+----------------+ 1 row in set (0.00 sec) 48
  • 49. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | UPDATE mysql> UPDATE product_info_hybrid SET attributes = '{"size": "42"}' WHERE product_id=10; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> SELECT * FROM product_info_hybrid; +------------+-------------+-------+---------------------------------------------------+ | product_id | description | price | attributes | +------------+-------------+-------+---------------------------------------------------+ | 9 | t-shirt | 20 | {"size": "M", "color": "red", "fabric": "cotton"} | | 10 | socks | 15 | {"size": "42"} | +------------+-------------+-------+---------------------------------------------------+ 2 rows in set (0.00 sec) 49
  • 50. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | DELETE mysql> DELETE FROM product_info_hybrid WHERE attributes->"$.size"="42"; Query OK, 1 row affected (0.01 sec) mysql> SELECT * FROM product_info_hybrid; +------------+-------------+-------+---------------------------------------------------+ | product_id | description | price | attributes | +------------+-------------+-------+---------------------------------------------------+ | 9 | t-shirt | 20 | {"size": "M", "color": "red", "fabric": "cotton"} | +------------+-------------+-------+---------------------------------------------------+ 1 row in set (0.00 sec) 50
  • 51. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | SQL – modelo híbrido • Native JSON datatype • JSON Functions • Generated Columns XDev API – modelo em documentos • Document Store plugin • X Protocol • MySQL Shell • Connector/J • Connector/Net • Connector/Node.js • Connector/Python 51 2 formas de utilização de MySQL como Document Store
  • 52. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | XDev API • Foco: facilidade de uso • Abstração sobre SQL para operações CRUD • Add • Find • Modify • Remove • Sort • Create Index • X Sessions & Node Sessions – abstração da conexão com BD • Atualização dos conectores – Connector/J – Connector/Net – Connector/Node.js – Connector/Python 52
  • 53. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Arquitetura SQL + NoSQL 53 MySQL Plugins X Protocol Plugin Memcached Plugin Core X ProtocolStd Protocol X Protocol 33060 Std Protocol 3306 SQL API CRUD API X and Std Protocols MySQL Shell
  • 54. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Arquitetura SQL + NoSQL 54 MySQL Plugins X Protocol Plugin Memcached Plugin Core X ProtocolStd Protocol X Protocol 33060 Std Protocol 3306 SQL API CRUD API X and Std Protocols MySQL Shell
  • 55. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 55 MySQL Shell
  • 56. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 56 Exemplo CRUD Document API MySQL 5.7.13+
  • 57. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 57 CRUD: Documento vs Relacional
  • 58. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 58
  • 59. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 59
  • 60. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 60
  • 61. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 61
  • 62. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
  • 63. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 63
  • 64. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
  • 65. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL como Key-value Store
  • 66. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Arquitetura SQL + NoSQL 66 MySQL Plugins X Protocol Plugin Memcached Plugin Core X ProtocolStd Protocol X Protocol 33060 Std Protocol 3306 SQL API CRUD API X and Std Protocols MySQL Shell
  • 67. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 67 MySQL com memcached: Key-Value Store +1 000 000 QPS *X86 48 cores http://dimitrik.free.fr/blog/archives/2013/11/mysql-performance-over-1m-qps-with- innodb-memcached-plugin-in-mysql-57.html
  • 68. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | Conclusão
  • 69. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | Um database flexível – Mão-de-obra com conhecimentos profundos – Estável – Custos efecientes e controlados – Fácil mover dados entre instâncias – Menos Drivers – Menos Ferramentas – SQL funciona, CRUD funciona – Operacional e Analítico juntos Muitos databases diferentes – Requer repertório maior de habilidades, dificulta encontrar mão de obra com conhecimentos profundos – Muitos Drivers – Muitas Ferramentas – Mais esforço para integrar, compartilhar e mover dados – Muito mais trabalho – Separação muitas vezes desnecessária de Operacional e Analítico Por que combinar em um único database?
  • 70. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | Livro: Introduciong the MySQL 8 Document Store – Chuck Bell, Editora Apress, 2018
  • 71. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | Momento jabá
  • 72. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | Treinamentos e Certificações MySQL 5.6 Database Administrator MySQL 5.6 Developer education.oracle.com/mysql
  • 73. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | Enterprise Edition Escalabilidade Autenticação Firewall Auditoria novo TDE Criptografia MySQL Enterprise Monitor Oracle EM for MySQL Plug-ins Suporte Hot Backup Monitor & Workbench
  • 74. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | cloud.oracle.com/pt_BR/mysql
  • 75. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | http://www.oracle.com/webfolder/technetwork/tutorials/obe/ cloud/apaas/php/php-mysql-service/php-mysql-service.html
  • 76. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | @MySQLBR meetup.com/MySQL-BRfacebook.com/MySQLBR pt.planet.mysql.com
  • 77. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | Perguntas? Contatos: [email protected] twitter.com/mysqlbr facebook.com/mysqlbr
  • 79. Copyright © 2017 Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The preceding is intended to outline our general product direction. It is intended for information purposes 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 upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.