mysql roadmap nosql ha fev17

56
MySQL 5.7 Visão e Roadmap Airton Lastori [email protected] Fevereiro-2017

Upload: mysql-brasil

Post on 22-Jan-2018

150 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: MySQL Roadmap NoSQL HA Fev17

MySQL 5.7 Visão e Roadmap

Airton Lastori [email protected] Fevereiro-2017

Page 2: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Visão

apresentada no Oracle Open World 2016 em San Francisco, CA

2

Page 3: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 3

Scale-Out

Ease-of-Use

Out-of-Box Solution

MySQL

Page 4: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 4

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

Page 5: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 5

Read Scale-Out

Async Replication + Auto Failover

Write Scale-Out

Sharding

S1

S2

S3

S4

MySQL Vision – S1

Timeline

MySQL Document Store

Relational & Document Model

MySQL HA

Out-Of-Box HA

Page 6: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 6

http://db-engines.com/en/ranking_trend (jan-2017)

Page 7: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 7

http://db-engines.com/en/ranking_categories

183 NoSQL

12 categorias

Page 10: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 10

Exemplo CRUD Document API MySQL 5.7.12+

Page 11: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 11

Page 12: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 12

Page 13: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 13

Page 14: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Page 15: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 15

Page 16: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Page 17: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 17

Page 18: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, 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

Page 19: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Exemplo Modelo híbrido: Schema + Schemaless

19

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

);

Page 20: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 20

Exemplo CRUD modelo híbrido MySQL 5.7.12+

Page 21: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, 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)

21

Page 22: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, 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)

22

Page 23: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, 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)

23

Page 24: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, 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)

24

Page 25: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, 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)

25

Page 26: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, 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)

26

Page 27: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Coluna

• 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

JSON

• Mais liberdade para representar dados (ex. Campos custom)

• Denormalização natural, registro auto-contido (ex. facilita escalabilidade horizontal via sharding)

• Protótipos rápidos, comece armazenar dados imediatamente

• Menor preocupação na definição de Tipos de Dados

• Menos dor-de-cabeça para aplicar mudanças no modelo de dados

Oracle Confidential – Internal/Restricted/Highly Restricted 27

Coluna ou JSON? Você escolhe!

Page 28: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 28

Read Scale-Out

Async Replication + Auto Failover

Write Scale-Out

Sharding

S1

S2

S3

S4

MySQL Vision – S1

Timeline

MySQL Document Store

Relational & Document Model

MySQL HA

Out-Of-Box HA

Page 29: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 29

Read Scale-Out

Async Replication + Auto Failover

Write Scale-Out

Sharding

S1

S2

S3

S4

MySQL Vision – S2

Timeline

MySQL Document Store

Relational & Document Model

MySQL HA

Out-Of-Box HA

Page 30: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

MySQL Connector

Application MySQL Connector

Application

MySQL Shell

MySQL Connector

Application

MySQL Connector

Application

MySQL InnoDB Cluster – Architecture – S2

MySQL InnoDB

cluster MySQL Enterprise Monitor

Page 31: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

MySQL

InnoDB cluster

MySQL InnoDB Cluster – Architecture – S2

M

M M

MySQL Connector

Application

MySQL Router

MySQL Connector

Application

MySQL Router

MySQL Shell

HA

Group Replication

Page 32: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Master Primário

MySQL Replication

Slave Réplica

Page 33: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Falhou!

MySQL Replication

Novo Master

Page 34: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Sem perda de dados e failover facilitado com replicação Semi-síncrona

Topologias resilientes com Múltiplos Slaves

34

Master Slave 1 (local) Primeira opção de failover (sempre mais atualizado)

Slave 2 (remoto) Segunda opção de failover

Page 35: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Componentes para Roteamento de conexões

MySQL Connectors

• Funcionalidades nativas de Failover ou Load Balancing

MySQL Router (novo )

•Middleware leve

• Roteamento baseado nas conexões

• Failover para o primeiro disponível ou Load Balancing

MySQL Utilities

•mysqlfailover – monitora a replicação, promove novo master e redireciona slaves

Page 36: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Arquitetura: replication + router + mysqlfailover

Router

App

VIP

mysqlfailover

Read-write

Read-only

Page 37: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

DC 1 - ativo

Arquitetura: replication + router + mysqlfailover

Router

App

VIP

mysqlfailover

Read-write

Read-only

DC 2 - standby

Router

App

VIP

mysqlfailover

semisync semisync async

Page 38: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

MySQL Group Replication

Grupo 3+ primários atuando como 1

Primário

Réplica

Page 39: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

High-Availability

1 membro falhou! Grupo continua disponível

Page 40: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

High-Availability

2 membros falharam Modo Somente Leitura

Page 41: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

MySQL Group Replication: O que é?

• Replicação multi-master para InnoDB

– permite escrita em qualquer nó do cluster

– recuperação automática (failover, switchover e failback)

– Inspirado no protocolo PAXOS: consenso da maioria

• Plug-in disponível no MySQL 5.7.17+ GA

– Suportado em todas plataformas MySQL • Linux, Windows, Solaris, OSX, FreeBSD

41

M

M M

MySQL Connector

Application

MySQL Router

MySQL Connector

Application

MySQL Router

HA

Group Replication

Page 42: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

MySQL Group Replication: O que fornece?

• Uma camada de banco de dados distribuída, simples de usar e com alta disponibilidade

– Topologias Ativo-Ativo, escreva em qualquer nó • Detecção e resolução automática de conflitos

– Reconfiguração automática ao adicionar, remover nós, crashes e falhas

– Distribuído e tolerante a falhas

– Arquitetura shared-nothing , sem necessidade de storage compartilhado

– Compatível com InnoDB

– Modos de operação single-primary ou multi-primary

42

Page 43: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Master-Slave Replication

Replication vs. Group Replication

Group Replication

Router Router Router

App App App

VIP

mysqlfailover

Read-write

Read-only

Page 44: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

MySQL Group Replication: Casos de Uso

• Replicação Elástica

– Ambientes que exigem uma infra-estrutura de replicação fluida, onde o número de servidores tem de crescer ou encolher dinamicamente e com a menor esforço possível.

• Alternativa a topologias Master-Slave

– Um único servidor Master pode ser um gargalo ou ponto único de falha.

– Escrever em um grupo de nós pode ser mais escalável em certas circunstâncias.

• Sharding com Alta Disponibilidade

– O MySQL Group Replication pode implementar shards altamente disponíveis em um sistema com escalabilidade horizontal.

44

Page 45: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 46

Read Scale-Out

Async Replication + Auto Failover

Write Scale-Out

Sharding

S1

S2

S3

S4

MySQL Vision – S3

Timeline

MySQL Document Store

Relational & Document Model

MySQL HA

Out-Of-Box HA

Page 46: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

S1 S2 S3 S4 S…

M

M M

MySQL Connector

Application

MySQL Router

MySQL Connector

Application

MySQL Router

MySQL Shell

HA

MySQL InnoDB Cluster – Architecture - S3 MySQL

InnoDB cluster

Read-Only Slaves

Page 47: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 48

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

Page 48: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

S1 S2 S3 S4 S…

M

M M

MySQL Connector

Application

MySQL Router

MySQL Connector

Application

MySQL Router

MySQL Shell

HA

Rep

licaS

et (

Shar

d 1

)

S1 S2 S3 S4 S…

M

M M

MySQL Connector

Application

MySQL Router

HA

Rep

licaS

et (

Shar

d 2

)

S1 S2 S3 S4

M

M M

HA

Rep

licaS

et (

Shar

d 3

)

MySQL Connector

Application

MySQL Router

MySQL InnoDB Cluster – Architecture - S4 MySQL

InnoDB cluster

Page 49: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 50

• Community (GPL)

– Database (InnoDB, MyISAM, MEMORY, etc)

– Cluster (NDB)

• Comercial

– Standard – Enterprise – Cluster CGE – OEM/ISV

• Oracle Cloud – MySQL Cloud Service

Ofertas MySQL

Page 50: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 51

Enterprise Edition

Escalabilidade Autenticação

Firewall Auditoria novo TDE

Criptografia

MySQL Enterprise Monitor Oracle EM for MySQL

Plug-ins

Suporte

Hot Backup

Monitor & Workbench

Page 51: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 53

+

MySQL Enterprise Edition

Page 52: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

• Simples & Automatizado

• Integrado

• Oracle Premier Support

• Enterprise Backup, Monitor, Security

54

Novo! MySQL Cloud Service

Page 53: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 55 cloud.oracle.com/mysql

Page 54: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 56

Treinamentos e Certificações

MySQL 5.6 Database Administrator MySQL 5.6 Developer

education.oracle.com/mysql

Page 55: MySQL Roadmap NoSQL HA Fev17

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Obrigado!

[email protected]

Page 56: MySQL Roadmap NoSQL HA Fev17