Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Upcoming SlideShare
Loading in...5
×

MySQL para Desenvolvedores de Games

565

Published on

O MySQL é o banco de dados open source mais popular do mundo, usado em grandes sites, games, 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.

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
565
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "MySQL para Desenvolvedores de Games"

  1. 1. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 121Airton Lastoriairton.lastori@oracle.com07-jun-2013MySQL para Desenvolvedores de Games
  2. 2. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 122@MySQLBRmeetup.com/MySQL-BRfacebook.com/MySQLBRMySQLBR
  3. 3. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 123Alguns clientes MySQL
  4. 4. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 124Alguns clientes MySQLfonte: alexa.com/topsites 30-jan-2013
  5. 5. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 125Alguns clientes MySQLmysql.com/customers
  6. 6. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 126Alguns clientes MySQLmysql.com/customers
  7. 7. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 127MySQL: casos de sucesso+ de 20 indústriasmysql.com/customers
  8. 8. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 128Indústria: Gamesmysql.com/customers/industry/?id=83
  9. 9. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 129Seu game precisa de um SGBD?Qual o tipo de distribuição do game?Download, Streaming, Online, Mobile...
  10. 10. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1210Quase todos tipos de games modernosnecessitam de um sistema robusto dearmazenamento de dadosDependendo da distribuição, o banco de dados pode serembarcado, centralizado ou distribuído.
  11. 11. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1211Game sem UIMySQLgamemysqlgame.com
  12. 12. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1212Como escolher um SGBD?Desafio de desenvolvedor #1
  13. 13. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1213…pense nos requisitos não funcionais…
  14. 14. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1214Na 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.
  15. 15. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1215Como o MySQL atendeAlguns destes requisitos?
  16. 16. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1216MySQL para desenvolvedoresPortfolioAmbiente dedesenvolvimentoEscalabilidade eAlta-disponibilidadeConhecendo melhor ouniverso MySQL parafazer boas escolhas…
  17. 17. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1217MySQL para desenvolvedoresPortfolioAmbiente dedesenvolvimentoEscalabilidade eAlta-disponibilidadeConhecendo melhor ouniverso MySQL parafazer boas escolhas…
  18. 18. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1218 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 CommunityPortfólio disponível para download e uso sob GPL
  19. 19. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1219Conectores: amplo suporte a várias linguagensOracle• 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
  20. 20. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1220Oracle PremierLifetime SupportOracle ProductCertifications/IntegrationsMySQL EnterpriseHigh AvailabilityMySQL EnterpriseSecurityMySQL EnterpriseScalabilityMySQL EnterpriseBackupMySQL EnterpriseMonitor/Query AnalyzerMySQL WorkbenchMySQL Enterprise EditionMaior produtividade e mitigação de riscosMySQL EnterpriseAudit
  21. 21. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1221MySQL para desenvolvedoresPortfolioAmbiente dedesenvolvimentoEscalabilidade eAlta-disponibilidadeConhecendo melhor ouniverso MySQL parafazer boas escolhas…
  22. 22. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1222Desafio de desenvolvedor #2Instalação básica, ambiente dedesenvolvimento…...em 15 minutos, ou menos!
  23. 23. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1223
  24. 24. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1224mysql.com/downloads/mysqlNo Linux ou Mac, prefira os binários
  25. 25. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1225Clientmysql / mysql.exeServermysqld / mysqld.exeCliente-Servidor
  26. 26. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1226Iniciar ou Parar o servidor MySQL no Windows…ou via MySQL Notifier
  27. 27. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1227Iniciar ou Parar o servidor MySQL no Linux/usr/local/mysql/bin> mysqld_safe --defaults-file=/etc/my.cnf &/usr/local/mysql/bin> mysqladmin shutdownParar:Iniciar:dev.mysql.com/doc/refman/5.5/en/mysqld-safe.html
  28. 28. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1228Primeira conexãoC:Program FilesMySQLMySQL Server 5.5bin>mysql -uroot -pEnter password: ****Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 8Server 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 itsaffiliates. Other names may be trademarks of their respectiveowners.Type help; or h for help. Type c to clear the current input statement.mysql>
  29. 29. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1229Teste via MySQL Workbench 1/2
  30. 30. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1230Teste via MySQL Workbench 2/2
  31. 31. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1231App + ConnectorJDBC, ODBC, .Net, PHP, Python, Perl, Ruby, Native C API…Servermysqld / mysqld.exeCliente-Servidor
  32. 32. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1232Desafio de desenvolvedor #3Hello World…...em Java
  33. 33. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1233Adicione o driver MySQL ao CLASSPATHcaminho completo do .jarC:>set CLASSPATHCLASSPATH=.;C:Program Files (x86)Javajre6libextQTJava.zip;C:ProgramFilesMySQLmysql-connector-java-5.1.22mysql-connector-java-5.1.22-bin.jarConfira:
  34. 34. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1234HelloMysql.java 1/2import 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…
  35. 35. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1235HelloMysql.java 2/2Statement stmt = con.createStatement(); //objeto StatementResultSet rs; //objeto ResultSetrs = stmt.executeQuery("SELECT * FROM world.country");System.out.println("Ola mundo!");while(rs.next()){String nomePais = rs.getString("Name");System.out.print(nomePais + ", ");}//end whilecon.close();} catch( Exception e ) {e.printStackTrace();}//end catch}//end main}//end class HelloMysqlPRONTO!
  36. 36. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1236java HelloMysqlC:tutorial>javac HelloMysql.javaC:tutorial>java HelloMysqlTentando conectar ao MySQL...URL: jdbc:mysql://localhost:3306/mysqlConnection: com.mysql.jdbc.JDBC4Connection@ed07f45Ola mundo!Aruba, Afghanistan, Angola, Anguilla, Albania, Andorra, Netherlands Antilles, United Arab Emirates, Argentina, Armenia, American Samoa, Antarctica, French Southern territories, Antigua and Barbuda, Australia, Austria, Azerbaijan, Burundi, Belgium, Benin, Burkina Faso, Bangladesh, Bulgaria, Bahrain, Bahamas, Bosnia andHerzegovina, Belarus, Belize, Bermuda, Bolivia, Brazil, Barbados, Brunei, Bhutan…ietnam, Vanuatu, Wallis and Futuna, Samoa, Yemen, Yugoslavia, South Africa, Zambia, Zimbabwe,
  37. 37. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1237Próximo passo: documentaçãoReference Manual1. Tutorial2. SQL Syntax3. Connectors & APIs, Memcached4. Functions, Views, Stored Programs5. Optimizationdev.mysql.com/doc/refman/5.5/en/index.html
  38. 38. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1238MySQL para desenvolvedoresPortfolioAmbiente dedesenvolvimentoEscalabilidade eAlta-disponibilidadeConhecendo melhor ouniverso MySQL parafazer boas escolhas…
  39. 39. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1239Desafio do desenvolvedor #4Projetar uma solução paradisponibilidade 24x7…...a famosa alta-disponibilidade
  40. 40. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1240Alta-Disponibilidade
  41. 41. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1241AplicaçãoMaster Slave• Modelo unidirecional assíncrono (padrão)• Modelo semi-síncrono (a partir da versão 5.5)Escritas & LeiturasReplicação MySQL
  42. 42. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1242AplicaçãoMaster Slave• Master down• Slave promovido para MasterEscritas & LeiturasMySQL failover
  43. 43. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1243Alta-Disponibilidade
  44. 44. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1244Soluções certificadas MySQL HA: resumomysql.com/why-mysql/white-papers/mysql_wp_ha_strategy_guide.phpMySQL 5.6ReplicationWindowsClusterSolarisClusterOracle VMTemplateDRBDMySQLClusterNível de disponibilidade 99.9% 99.95% 99.99% 99.99% 99.99% 99.999%Auto-Failover ✔ ✔ ✔ ✔ ✔ ✔Sem perda de dados durantefailover✔Semi-Sync✔ ✔ ✔ ✔ ✔Plataformas suportadas All Windows Solaris Linux Linux AllModo de clusterizaçãoMaster +SlavesActive /PassiveActive /PassiveActive /PassiveActive /PassiveMulti-MasterDispensa Shared Storage ✔ ✖ ✖ ✖ ✔ ✔Ponto único de suporte ✔ ✖ ✔ ✔ ✔ ✔
  45. 45. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1245Desafio do desenvolvedor #5Projetar uma solução que possacrescer para comportar milhõesde usuários…
  46. 46. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1246Scale Out• Adicionar mais servidores paraaumentar performance• MySQL adota esta abordagemem sistemas altamenteescaláveis em hardwarecommodity (Intel / AMD)Scale Up• Trocar por hardware maispoderoso, adicionar memória,CPU• Outras soluções normalmenteusam hardware proprietário(SMP)Escalabilidade: horizontal vs vertical
  47. 47. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1250Escalabilidade horizontalReplicação MySQL• método mais simples emais comum• indicado para aplicaçõesde LEITURA intensiva• problemas com cacheduplicado em aplicaçõescom datasets grandesParticionamentoFuncional• dividir a carga em múltiplosnós, com responsabilidadesdistintas• os nós podem terredundância via replicaçãopara alta-disponibilidade• normalmente não étransparente para a aplicaçãoe também recorre ao scale uppara cada database funcional,o que impõe limitesData Sharding• método de maior sucessopara escalar aplicaçõesMySQL de grande portehoje• dados compartilhados emtabelas/caches globais,SOA• difícil de adaptaraplicações legadas
  48. 48. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1251Replicação MySQL: escalando LEITURAS• Divisão de leituras e escritas (R/W Split)• É possível adicionar mais slaves, dividir a cargaLeiturasAplicaçãoMaster SlaveEscritas & Leituras LeiturasSlave…
  49. 49. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1252Data Node 1Data Node 2Data Node 3Data Node 4Table T1P2P3P4P1Data Sharding: escalando ESCRITAS
  50. 50. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1253Data Node 1Data Node 2F1Data Node 3Data Node 4Table T1P2P3P4P1Data Sharding: escalando ESCRITAS
  51. 51. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1254Data Node 1Data Node 2F1F3Data Node 3Data Node 4Table T1P2P3P4P1Data Sharding: escalando ESCRITAS
  52. 52. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1255Data Node 1Data Node 2F1F3Data Node 3Data Node 4F2Table T1P2P3P4P1Data Sharding: escalando ESCRITAS
  53. 53. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1256Data Node 1Data Node 2F1F3Data Node 3Data Node 4F2F4Table T1P2P3P4P1Data Sharding: escalando ESCRITAS
  54. 54. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1257Desafios do desenvolvedor #4 + #5É possível combinar alta-disponibilidade e escalabilidade?...assim como Facebook, Twitter, Youtube
  55. 55. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1258Data Node 1Data Node 2F1F1Data Node 3Data Node 4Table T1P2P3P4P1Data Sharding + Replicação
  56. 56. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1259Data Node 1Data Node 2F1 F3F1Data Node 3Data Node 4Table T1P2P3P4P1F3Data Sharding + Replicação
  57. 57. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1260Data Node 1Data Node 2F1 F3F3 F1Data Node 3Data Node 4F2F2Table T1P2P3P4P1Alta-Disponibilidade: Replicação Síncrona
  58. 58. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1261Data Node 1Data Node 2F1 F3F3 F1Data Node 3Data Node 4F2 F4F4 F2Table T1P2P3P4P1Data Sharding + Replicação
  59. 59. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1262Data Node 1Data Node 2F1 F3F3 F1Data Node 3Data Node 4F2 F4F4 F2Group1Table T1P2P3P4P1Data Sharding + ReplicaçãoGroup2
  60. 60. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1263Data Node 1Data Node 2F1 F3F3 F1Data Node 3Data Node 4F2 F4F4 F2Group1Table T1P2P3P4P1Data Sharding + ReplicaçãoGroup2
  61. 61. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1265Desafios do desenvolvedor #4 + #5É possível ter alta-disponibilidadee escalabilidade com menoresforço de implementação?
  62. 62. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1266MySQL Cluster• Arquitetura shared-nothing in-memory parallel• Modelo relacional ACID, SQLCarrier GradeDatabase• 99.999% de disponibilidade• Self-healing, failover abaixo de 1 segundoAlta Disponibilidade• Performance em tempo real para altas cargas• Latência baixa e preditivaAlta Performance• Elasticidade, crescimento incremental• Escalabilidade linear, distribuition awareEscalabilidade• Open Source, hardware commodity• APIs NoSQL (C++, Java, Memcached, Node.js)Open Source
  63. 63. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1267Alguns Clientes MySQL Cluster
  64. 64. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1268Alguns Clientes MySQL Cluster
  65. 65. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1269MySQL Cluster Data NodesData LayerClientsApplication LayerManagementmgm_ndbdMySQL Cluster: auto-shardingTable T1P2P3P4P1F1F3F3F1F2F4F4F2Managementmgm_ndbdmysqldmysqldndbd ndbd ndbd ndbd
  66. 66. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1270MySQL Cluster Data NodesData LayerClientsApplication LayerManagementmgm_ndbdMySQL Cluster: alta-disponibilidadeTable T1F1F3F3F1F2F4F4F2Managementmgm_ndbdmysqldmysqldndbd ndbd ndbd ndbd
  67. 67. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1271MySQL Cluster Data NodesData LayerClientsApplication LayerManagementMySQL Cluster: auto-shardingTable T1P2P3P4P1F1F3F3F1F2F4F4F2Management
  68. 68. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1272•2 milhões usuários, com 30.000 novosusuários por dia•10.000 usuários concorrentes•10.000 Transações Por Segundo•99.999% uptime“The MySQL support service hasbeen essential in helping us fortroubleshooting and givingrecommendations for the productioncluster.”Carlos Morales (DBA), Playfulplay.comblogs.oracle.com/MySQL/entry/mysql_cluster_powers_el_chavoCaso de sucesso
  69. 69. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1273Bônus para o desenvolvedorEscreva via NoSQL (schemaless)e consulte via SQL
  70. 70. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1274Os mesmos dadosacessadossimultaneamenteatravés de interfacesSQL e NoSQLAPIs de Acesso aos Dados
  71. 71. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1275<estado:SP,Campinas>prefix key value<estado:SP,Campinas>key valuePrefix Table Key-col Val-col policyestado: mapa.cidades sigla_estado cidade clusterConfig tablessigla_estado ... cidade ...SP ... Campinas ...Tabela cidades do DB mapavisão da Aplicaçãovisão MySQL ClusterCluster & MemcachedSchema configurávelSELECT * FROM mapa.cidadesWHERE cidade LIKE ’C%’;
  72. 72. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1276Exemplos Memcached APIOn-demand Webinar:NoSQL Memcached API for MySQL Cluster22 August 2012mysql.com/news-and-events/on-demand-webinars/display-od-723.html
  73. 73. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1277Exemplos JavaScript / Node.js APIBlog:Tutorial Getting Started with the NoSQL JavaScript / Node.js API forMySQL Cluster10 June 2012blogs.oracle.com/MySQL/entry/tutorial_getting_started_with_the
  74. 74. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1278MySQL Cluster Auto-Install (beta) Simples de instalar e provisionar clusters multi-node Complementa MySQL Cluster Manager no gerenciamento de cliclo de vida
  75. 75. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12791. Download MCM/Cluster edelivery.oracle.com:2. Unzip e execute o comando com usuário diferente de root:MySQL Cluster ManagerPara testes em uma única máquinaC:MySQLmcmbin> mcmd --bootstrapMySQL Cluster Manager 1.1.2 startedConnect to MySQL Cluster Manager by running “C:MySQLmcmbinmcm" -a NOVA:1862Configuring default cluster mycluster...Starting default cluster mycluster...Cluster mycluster started successfullyndb_mgmd NOVA:1186ndbd NOVAndbd NOVAmysqld NOVA:3306mysqld NOVA:3307ndbapi *Connect to the database by running “C:MySQLmcmclusterbinmysql" -h NOVA -P 3306 -u root
  76. 76. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1280Mais sobre como começar com MySQL ClusterWhitepaper:MySQL Cluster Evaluation GuideFebruary 2012mysql.com/why-mysql/white-papers/mysql-cluster-evaluation-guide/
  77. 77. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1281Sumário O MySQL é o banco de dados open source mais popular domundo, usado em grandes sites, games, aplicações mobile eembarcadas. Há várias opções de arquiteturas e APIs, oferecendo enormeflexibilidade, escalabilidade e alta-disponibilidade. Instale e comece a usar em menos de 15min. Use e abuse dadocumentação!
  78. 78. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1282@MySQLBRmeetup.com/MySQL-BRfacebook.com/MySQLBRObrigado!
  79. 79. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1283Perguntas?MySQL para Desenvolvedores
  80. 80. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1284MySQL Boot CampAcceleratedMySQL PerformanceTuning Boot CampAcceleratedMySQL for BegginersMySQL for DatabaseAdministratorsMySQL PerformanceTuningMySQL High AvailabilityMySQL ClusterMySQL DBAMySQL Boot CampAcceleratedMySQL for DevelopersMySQL PerformanceTuning Boot CampAcceleratedMySQL for BegginersMySQL and PHPDeveloping DynamicWeb ApplicationgMySQL Advanced StoredProceduresMySQLDevelopermysql.com/trainingCertificaçõesOpcionalNecessárioTreinamentos e certificações
  81. 81. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1285Clients & ConnectorsNative C API, JDBC, ODBC, .Net, PHP, Ruby, Python, VB, PerlConnection Pool, SQL Interface, Parser, Optimizer, CachesEnterprise ManagementServices and UtilitiesBackup & RecoveryMonitorWorkbenchUtilitiesmysqldClients and AppsArquitetura MySQL ServerStorage EnginesInnoDB, MyISAM, Memory, Archive, Cluster (NDB API), etc…Filesystems, Files and LogsData, Index, Redo, Undo, Binary, Error, Slow
  82. 82. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1286Storage EnginesMyISAM InnoDB NDB ClusterTransações ✖ ✔ ✔Nível de Lock Tabela Linha LinhaReplicaçãoAssíncrona ouSemi-síncronaAssíncrona ouSemi-síncronaSíncrona, Multi-masterForeign Keys ✖ ✔ a partir da v7.3Full-text indexes ✔ a partir da v5.6 ✖Compressão de dados somente Leitura ✔ ✖Caches somente Índices Dados e Índices Dados e ÍndicesSuporte Geospacial Tipos de Dados e Índices somente Tipos de Dados somente Tipos de DadosLimite de armazenamento 256TB 64TB 384EBdev.mysql.com/doc/refman/5.5/en/storage-engines.html

×