MySQL para Desenvolvedores

77
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 1 Airton Lastori [email protected] 30-jan-2013 MySQL para Desenvolvedores

description

O MySQL é o banco de dados open source mais popular do mundo, usado em grandes sites como Facebook, Youtube, Twitter, Globo.com e também em aplicações mobile e embarcadas. Nesta palestra abordaremos várias opções de arquitetura com MySQL, as opções de APIs para interação com MySQL com exemplos de utilização e um guia de como começar a desenvolver para MySQL.

Transcript of MySQL para Desenvolvedores

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 1

Airton Lastori [email protected]

30-jan-2013

MySQL para Desenvolvedores

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 2

@MySQLBR

meetup.com/MySQL-BR

facebook.com/MySQLBR

MySQLBR

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 3

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 4

Alguns clientes MySQL

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 5

Alguns clientes MySQL

fonte: alexa.com/topsites 30-jan-2013

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 6

Alguns clientes MySQL

mysql.com/customers

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 7

Alguns clientes MySQL

mysql.com/customers

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 8

Tipos de aplicação

0%

10%

20%

30%

40%

50%

60%

70%

Enterprise

Community

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 9

Desafio de desenvolvedor #1

Quais são os requisitos não

funcionais da minha aplicação?

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 10

Na escolha da solução, considerar...

Escalabilidade, performance, disponibilidade,

estabilidade, segurança, simplicidade, flexibilidade,

custo total de propriedade, conhecimento da equipe...

Ah! Não esqueça da fase de produção, dos DBAs...

ferramentas, suporte, rotinas de manutenção.

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 11

MySQL para desenvolvedores

Portfolio

Ambiente de desenvolvimento

Escalabilidade e Alta-disponibilidade

Conhecendo melhor o

universo MySQL para

fazer boas escolhas…

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 12

MySQL para desenvolvedores

Portfolio

Ambiente de desenvolvimento

Escalabilidade e Alta-disponibilidade

Conhecendo melhor o

universo MySQL para

fazer boas escolhas…

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 13

MySQL Database Community Server

MySQL Cluster

MySQL Workbench

MySQL Connectors

MySQL Proxy

Documentação não GPL

Forums, Lists, Bugs, Blogs…

Compromisso Oracle com MySQL Community Portfólio disponível para download e uso sob GPL

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 14

Conectores: amplo suporte a várias linguagens

Oracle

• Connector/ODBC

• Connector/Net (ADO.NET)

• Connector/Python

• Connector/J (JDBC)

• Connector/C (C API)

• Connector/C++ (C++ API)

Comunidade

• PHP

• Perl

• Ruby

• TCL

• Eiffel

• …

dev.mysql.com/doc/refman/5.5/en/connectors-apis.html

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 15

Oracle Premier Lifetime Support

Oracle Product Certifications/Integrations

MySQL Enterprise High Availability

MySQL Enterprise Security

MySQL Enterprise Scalability

MySQL Enterprise Backup

MySQL Enterprise Monitor/Query Analyzer

MySQL Workbench

MySQL Enterprise Edition Maior produtividade e mitigação de riscos

MySQL Enterprise Audit

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 16

MySQL para desenvolvedores

Portfolio

Ambiente de desenvolvimento

Escalabilidade e Alta-disponibilidade

Conhecendo melhor o

universo MySQL para

fazer boas escolhas…

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 17

Desafio de desenvolvedor #2

Instalação básica, ambiente de

desenvolvimento…

...em 15 minutos, ou menos!

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 18

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 19

mysql.com/downloads/mysql

No Linux ou Mac, prefira os binários

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 20

Client mysql / mysql.exe

Server mysqld / mysqld.exe

Cliente-Servidor

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 21

Iniciar ou Parar o servidor MySQL no Windows

…ou via MySQL Notifier

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 22

Iniciar ou Parar o servidor MySQL no Linux

/usr/local/mysql/bin> mysqld_safe --defaults-file=/etc/my.cnf &

/usr/local/mysql/bin> mysqladmin shutdown

Parar:

Iniciar:

dev.mysql.com/doc/refman/5.5/en/mysqld-safe.html

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 23

Primeira conexão

C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql -uroot -p

Enter password: ****

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 8

Server version: 5.5.28 MySQL Community Server (GPL)

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 24

Teste via MySQL Workbench 1/2

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 25

Teste via MySQL Workbench 2/2

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 26

App + Connector JDBC, ODBC, .Net, PHP, Python, Perl, Ruby, Native C API…

Server mysqld / mysqld.exe

Cliente-Servidor

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 27

Desafio de desenvolvedor #3

Hello World…

...em Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 28

Adicione o driver MySQL ao CLASSPATH caminho completo do .jar

C:\>set CLASSPATH

CLASSPATH=.;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip;C:\Program

Files\MySQL\mysql-connector-java-5.1.22\mysql-connector-java-5.1.22-bin.jar

Confira:

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 29

HelloMysql.java 1/2

import java.sql.*;

public class HelloMysql {

public static void main(String args[]){

System.out.println("Tentando conectar ao MySQL...");

try {

Class.forName("com.mysql.jdbc.Driver");

String url = "jdbc:mysql://localhost:3306/mysql";

String usuario = "root";

String senha = "root";

Connection con = DriverManager.getConnection(url, usuario, senha);

System.out.println("URL: " + url);

System.out.println("Connection: " + con);

Continua…

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 30

HelloMysql.java 2/2 Statement stmt = con.createStatement(); //objeto Statement

ResultSet rs; //objeto ResultSet

rs = stmt.executeQuery("SELECT * FROM world.country");

System.out.println("Ola mundo!");

while(rs.next()){

String nomePais = rs.getString("Name");

System.out.print(nomePais + ", ");

}//end while

con.close();

} catch( Exception e ) {

e.printStackTrace();

}//end catch

}//end main

}//end class HelloMysql PRONTO!

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 31

java HelloMysql C:\tutorial>javac HelloMysql.java

C:\tutorial>java HelloMysql

Tentando conectar ao MySQL...

URL: jdbc:mysql://localhost:3306/mysql

Connection: com.mysql.jdbc.JDBC4Connection@ed07f45

Ola mundo!

Aruba, Afghanistan, Angola, Anguilla, Albania, Andorra, Netherlands Antilles, Un

ited Arab Emirates, Argentina, Armenia, American Samoa, Antarctica, French South

ern territories, Antigua and Barbuda, Australia, Austria, Azerbaijan, Burundi, B

elgium, Benin, Burkina Faso, Bangladesh, Bulgaria, Bahrain, Bahamas, Bosnia and

Herzegovina, Belarus, Belize, Bermuda, Bolivia, Brazil, Barbados, Brunei, Bhutan

ietnam, Vanuatu, Wallis and Futuna, Samoa, Yemen, Yugoslavia, South Africa, Zamb

ia, Zimbabwe,

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 32

Próximo passo: documentação

Reference Manual

1. Tutorial

2. SQL Syntax

3. Connectors & APIs, Memcached

4. Functions, Views, Stored Programs

5. Optimization

dev.mysql.com/doc/refman/5.5/en/index.html

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 33

MySQL para desenvolvedores

Portfolio

Ambiente de desenvolvimento

Escalabilidade e Alta-disponibilidade

Conhecendo melhor o

universo MySQL para

fazer boas escolhas…

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 34

Desafio do desenvolvedor #4

Projetar uma solução para

disponibilidade 24x7…

...a famosa alta-disponibilidade

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 35

% 9 9 9 9 35 dias 4 days 50 min 5 min 8 horas

Replicação

Clustering &

Virtualização

Clustering &

Redundância

Geográfica

ISPs &

Corporativo

On-Line

Services

eCommerce

Telecoms, Militar

. 9 4 dias

Cu

sto

& C

om

ple

xid

ad

e

Alta-Disponibilidade

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 36

Aplicação

Master Slave

• Modelo assíncrono (padrão)

• Modelo semi-síncrono (a partir da versão 5.5)

Escritas & Leituras

Replicação MySQL

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 37

Aplicação

Master Slave

• Master down

• Slave promovido para Master

Escritas & Leituras

MySQL failover

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 38

Replicação

Clustering &

Virtualização

Clustering &

Redundância

Geográfica

Replicação

DRBD

Cu

sto

& C

om

ple

xid

ad

e

Alta-Disponibilidade

% 9 9 9 9 35 dias 4 days 50 min 5 min 8 horas

eCommerce

Telecoms, Militar

. 9 4 dias

ISPs &

Corporativo

On-Line

Services

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 39

Soluções certificadas MySQL HA: resumo

mysql.com/why-mysql/white-papers/mysql_wp_ha_strategy_guide.php

MySQL 5.6

Replication

Windows

Cluster

Solaris

Cluster

Oracle VM

Template DRBD

MySQL

Cluster

Nível de disponibilidade 99.9% 99.95% 99.99% 99.99% 99.99% 99.999%

Auto-Failover ✔ ✔ ✔ ✔ ✔ ✔

Sem perda de dados durante

failover ✔

Semi-Sync ✔ ✔ ✔ ✔ ✔

Plataformas suportadas All Windows Solaris Linux Linux All

Modo de clusterização Master +

Slaves

Active /

Passive

Active /

Passive

Active /

Passive

Active /

Passive

Multi-

Master

Dispensa Shared Storage ✔ ✖ ✖ ✖ ✔ ✔

Ponto único de suporte ✔ ✖ ✔ ✔ ✔ ✔

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 40

Desafio do desenvolvedor #5

Projetar uma solução que possa

crescer para comportar milhões

de usuários…

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 41

Scale Out

• Adicionar mais servidores para

aumentar performance

• MySQL adota esta abordagem

em sistemas altamente

escaláveis em hardware

commodity (Intel / AMD)

Scale Up

• Trocar por hardware mais

poderoso, adicionar memória,

CPU

• Outras soluções normalmente

usam hardware proprietário

(SMP)

Escalabilidade: horizontal vs vertical

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 42

2008

até 4 CPU

MySQL 5.0

MySQL AB

até 16 CPU

MySQL 5.1

Sun

até 32 CPU

MySQL 5.5

Oracle

até 48 CPU

MySQL 5.6

Evolução da escalabilidade do MySQL

2009 2010 2013

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 43

Sysbench

32-core

Mesmo Hardware

Tuning ótimo

Benchmarks MySQL 5.5 vs 5.6

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 44

Sysbench

32-core

Same Hardware

Optimal Tuning

Sysbench

32-core

Mesmo Hardware

Tuning ótimo

Benchmarks MySQL 5.5 vs 5.6

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 45

Escalabilidade horizontal

Replicação MySQL

• método mais simples e mais comum

• indicado para aplicações de LEITURA intensiva

• problemas com cache duplicado em aplicações com datasets grandes

Particionamento Funcional

• dividir a carga em múltiplos nós, com responsabilidades distintas

• os nós podem ter redundância via replicação para alta-disponibilidade

• normalmente não é transparente para a aplicação e também recorre ao scale up para cada database funcional, o que impõe limites

Data Sharding

• método de maior sucesso para escalar aplicações MySQL de grande porte hoje

• dados compartilhados em tabelas/caches globais, SOA

• difícil de adaptar aplicações legadas

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 46

Replicação MySQL: escalando LEITURAS

• Divisão de leituras e escritas (R/W Split)

• É possível adicionar mais slaves, dividir a carga

Leituras

Aplicação

Master Slave

Escritas & Leituras

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 47

Data Node 1

Data Node 2

Data Node 3

Data Node 4

Table T1

P2

P3

P4

P1

Data Sharding: escalando ESCRITAS

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 48

Data Node 1

Data Node 2

F1

Data Node 3

Data Node 4

Table T1

P2

P3

P4

P1

Data Sharding: escalando ESCRITAS

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 49

Data Node 1

Data Node 2

F1

F3

Data Node 3

Data Node 4

Table T1

P2

P3

P4

P1

Data Sharding: escalando ESCRITAS

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 50

Data Node 1

Data Node 2

F1

F3

Data Node 3

Data Node 4

F2

Table T1

P2

P3

P4

P1

Data Sharding: escalando ESCRITAS

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 51

Data Node 1

Data Node 2

F1

F3

Data Node 3

Data Node 4

F2

F4

Table T1

P2

P3

P4

P1

Data Sharding: escalando ESCRITAS

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 52

Desafios do desenvolvedor #4 + #5

É possível combinar alta-

disponibilidade e escalabilidade?

...assim como Facebook, Twitter, Youtube

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 53

Data Node 1

Data Node 2

F1

F1

Data Node 3

Data Node 4

Table T1

P2

P3

P4

P1

Data Sharding + Replicação

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 54

Data Node 1

Data Node 2

F1 F3

F1

Data Node 3

Data Node 4

Table T1

P2

P3

P4

P1 F3

Data Sharding + Replicação

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 55

Data Node 1

Data Node 2

F1 F3

F3 F1

Data Node 3

Data Node 4

F2

F2

Table T1

P2

P3

P4

P1

Alta-Disponibilidade: Replicação Síncrona

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 56

Data Node 1

Data Node 2

F1 F3

F3 F1

Data Node 3

Data Node 4

F2 F4

F4 F2

Table T1

P2

P3

P4

P1

Data Sharding + Replicação

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 57

Data Node 1

Data Node 2

F1 F3

F3 F1

Data Node 3

Data Node 4

F2 F4

F4 F2

Gro

up

1

Table T1

P2

P3

P4

P1

Data Sharding + Replicação

Gro

up

2

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 58

Data Node 1

Data Node 2

F1 F3

F3 F1

Data Node 3

Data Node 4

F2 F4

F4 F2

Gro

up

1

Table T1

P2

P3

P4

P1

Data Sharding + Replicação

Gro

up

2

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 59

Casos de muito sucesso

Facebook

Youtube

Twitter

Flickr

Evernote

Pinterest

highscalability.com

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 60

MySQL Cluster Data Nodes

Data Layer

Clients

Application Layer

Management

MySQL Cluster: auto-sharding

Table T1

P2

P3

P4

P1 F1

F3

F3

F1 F2

F4

F4

F2

Management

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 61

Os mesmos dados

acessados

simultaneamente

através de interfaces

SQL e NoSQL

APIs de Acesso aos Dados

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 62

Alguns Clientes MySQL Cluster

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 63

•2 milhões usuários, com 30.000 novos

usuários por dia

•10.000 usuários concorrentes

•10.000 Transações Por Segundo

•99.999% uptime

“The MySQL support service has

been essential in helping us for

troubleshooting and giving

recommendations for the production

cluster.” Carlos Morales (DBA), Playfulplay.com

blogs.oracle.com/MySQL/entry/mysql_cluster_powers_el_chavo

Caso de sucesso

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 64

MySQL Cluster

• Arquitetura shared-nothing in-memory parallel

• Modelo relacional ACID, SQL

Carrier Grade Database

• 99.999% de disponibilidade

• Self-healing, failover abaixo de 1 segundo Alta Disponibilidade

• Performance em tempo real para altas cargas

• Latência baixa e preditiva Alta Performance

• Elasticidade, crescimento incremental

• Escalabilidade linear, distribuition aware Escalabilidade

• Open Source, hardware commodity

• APIs NoSQL (C++, Java, Memcached, Node.js) Open Source

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 65

MySQL Cluster Auto-Install (beta)

Simples de instalar e provisionar clusters multi-node

Complementa MySQL Cluster Manager no gerenciamento de cliclo de vida

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 66

1. Download MCM/Cluster edelivery.oracle.com:

2. Unzip e execute o comando:

MySQL Cluster Manager Para testes em uma única máquina

C:\MySQL\mcm\bin> mcmd –bootstrap

MySQL Cluster Manager 1.1.2 started

Connect to MySQL Cluster Manager by running “C:\MySQL\mcm\bin\mcm" -a NOVA:1862

Configuring default cluster 'mycluster'...

Starting default cluster 'mycluster'...

Cluster 'mycluster' started successfully

ndb_mgmd NOVA:1186

ndbd NOVA

ndbd NOVA

mysqld NOVA:3306

mysqld NOVA:3307

ndbapi *

Connect to the database by running “C:\MySQL\mcm\cluster\bin\mysql" -h NOVA -P 3306 -u root

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 69

Exemplos JavaScript / Node.js API

Blog:

Tutorial Getting Started with the NoSQL JavaScript / Node.js API for

MySQL Cluster

10 June 2012

blogs.oracle.com/MySQL/entry/tutorial_getting_started_with_the

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 70

Novo Desafio do desenvolvedor

Big Data

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 71

ORGANIZE ANALYZE

DECIDE

MySQL in the Big Data Lifecycle

Binlog API

BI Solutions

NoSQL APIs

ACQUIRE

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 72

MySQL e Big Data

Whitepaper:

MySQL and Hadoop – Big Data Integration

December 2012

mysql.com/why-mysql/white-papers/mysql-

and-hadoop-guide-to-big-data-integration/

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 73

Sumário

O MySQL é o banco de dados open source mais popular do

mundo, usado em grandes sites, aplicações mobile e

embarcadas.

Há várias opções de arquiteturas e APIs, oferecendo enorme

flexibilidade, escalabilidade e alta-disponibilidade.

Instale e comece a usar em menos de 15min. Use e abuse da

documentação!

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 74

@MySQLBR

meetup.com/MySQL-BR

facebook.com/MySQLBR

Obrigado!

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 75

Perguntas?

MySQL para Desenvolvedores

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 76

Clients & Connectors Native C API, JDBC, ODBC, .Net, PHP, Ruby, Python, VB, Perl

Connection Pool, SQL Interface, Parser, Optimizer, Caches Enterprise Management

Services and Utilities

Backup & Recovery

Monitor

Workbench

Utilities

mysqld

Clients and Apps

Arquitetura MySQL Server

Storage Engines InnoDB, MyISAM, Memory, Archive, Cluster (NDB API), etc…

Filesystems, Files and Logs Data, Index, Redo, Undo, Binary, Error, Slow

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 77

Storage Engines

MyISAM InnoDB NDB Cluster

Transações ✖ ✔ ✔

Nível de Lock Tabela Linha Linha

Replicação Assíncrona ou

Semi-síncrona

Assíncrona ou

Semi-síncrona Síncrona, Multi-master

Foreign Keys ✖ ✔ a partir da v7.3

Full-text indexes ✔ a partir da v5.6 ✖

Compressão de dados somente Leitura ✔ ✖

Caches somente Índices Dados e Índices Dados e Índices

Suporte Geospacial Tipos de Dados e Índices somente Tipos de Dados somente Tipos de Dados

Limite de armazenamento 256TB 64TB 384EB

dev.mysql.com/doc/refman/5.5/en/storage-engines.html