SlideShare uma empresa Scribd logo
1 de 27
MySQL Advanced MySQL Replication MySQL Cluster MySQL Partitioning António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Advanced MySQL Replication António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Replication Concepts MySQL replication tracks updates performed in a MySQL master logs and updates one or more slave servers. The mechanism involved in MySQL replication requires binary logging to be active.   -Asynchronous replication, a slave doesn't need to be always active. -MySQL replication can be used to scale-out queries among different servers. -MySQL replication is a good solution for performing live backups. - Long distance data distribution. António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Replication Architecture MySQL replication architecture: - Each update performed in a database is replicated from the master to the slaves. - Only slaves keep track of their replication status. - One may set at what point the replication begins. António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Replication setup António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],MySQL slave Set the master properties in /etc/mysql/my.cnf: server-id=2 master-host = master_ip master-user = rep_slave master-password = password replicate-do-db={db_name}
António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09 MySQL Replication setup ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
MySQL Advanced MySQL Cluster António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Cluster MySQL cluster is designed to provide near perfect availability through a shared nothing architecture, in turn this means that all the nodes in a MySQL cluster can be replicated for failover. MySQL cluster is a in memory database, which means that all data must be located in RAM, since version 5.1.6 a mechanism is available to store data on disk although Indexes must still fit in ram. All data in MySQL is horizontally partitioned, across different storage nodes, which means that all table data is split across the storage nodes. António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Cluster MySQL cluster architecture consists of three types nodes: Storage nodes:  All data is stored in this nodes. SQL nodes:  Standard MySQL nodes, used for connection. Management nodes:  Used to change the setup of the cluster. António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Cluster António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09 Setup (Debian)‏ To setup a 3 node (API + engine + management) MySQL Cluster you must update 2 files: Edit /etc/mysql/my.cnf and add: [mysqld] ndbcluster [MYSQL_CLUSTER] ndb-connectstring=127.0.0. 1
MySQL Cluster António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09 Setup (debian)  Create a new configuration file in /etc/mysql/ndb_mgmd.cnf: [ndbd default] NoOfReplicas=1 DataMemory=80M IndexMemory=18M [ndb_mgmd] Id=1 hostname=localhost datadir=/var/lib/mysql-cluster [mysqld]
MySQL Cluster Startup order: #1 Management nodes: invoke-rc.d mysql-ndb-mgm start (start-initial)‏ #2 Data nodes invoke-rc.d mysql-ndb start #3 SQL nodes invoke-rc.d mysql start António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Cluster Testing the installation: bash$ ndb-mgm -e show Connected to Management Server at: 127.0.0.1:1186 Cluster Configuration --------------------- [ndbd(NDB)]  1 node(s)‏ id=2  @127.0.0.1  (Version: 5.1.22, Nodegroup: 0, Master)‏ [ndb_mgmd(MGM)] 1 node(s)‏ id=1  @127.0.0.1  (Version: 5.1.22)‏ [mysqld(API)]  1 node(s)‏ id=3  @127.0.0.1  (Version: 5.1.22)‏ António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Cluster Testing the installation: mysql> create table person (id int, name varchar(32)) engine = ndb; Query OK, 0 rows affected (2,34 sec)‏ mysql> insert into person (id, name ) values ('11','carlos'); Query OK, 1 row affected (0,00 sec)‏ mysql> select * from person; +------+--------+ | id  | name  | +------+--------+ |  11 | carlos | +------+--------+ 1 row in set (0,00 sec)‏ António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Advanced MySQL Partitioning António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Partitioning c oncepts Typical SQL doesn't provide guidance to underling physical storage layer, Partitioning allows you to split a table across multiple files, through the usage of a special partitioning rule called partitioning function. Partitioning can only take place in engines that support partitioning, engines like MyISAM or InnoDB and not like CSV or BlackHole. The big performance boost in database partition is that partitions that do not satisfy a certain rule are not scanned, this is called partition pruning. António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Partitioning Partition types ,[object Object],[object Object],[object Object],[object Object],[object Object],António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Partitioning examples Range partition: CREATE TABLE t1 ( r_name VARCHAR(50) NOT NULL, region_code TINYINT UNSIGNED NOT NULL )‏ PARTITION BY RANGE( region_code ) ( PARTITION p0 VALUES LESS THAN (64), PARTITION p1 VALUES LESS THAN (128), PARTITION p3 VALUES LESS THAN MAXVALUE ); António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Partitioning examples List Partition: CREATE TABLE employees ( id INT NOT NULL, fname VARCHAR(30), lname VARCHAR(30), hired DATE NOT NULL DEFAULT '1970-01-01', separated DATE NOT NULL DEFAULT '9999-12-31', job_code INT, store_id INT )‏ PARTITION BY LIST(store_id) ( PARTITION pNorth VALUES IN (16,15,3,5,6,9,17), PARTITION pEast VALUES IN (1,2,8,10,11,19,20), PARTITION pWest VALUES IN (7, 4,12,13,14,18)  ); António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Partitioning examples Hash Partition: CREATE TABLE employees ( id INT NOT NULL, fname VARCHAR(30), lname VARCHAR(30), hired DATE NOT NULL DEFAULT '1970-01-01', separated DATE NOT NULL DEFAULT '9999-12-31', job_code INT, store_id INT )‏ PARTITION BY HASH(store_id)‏ PARTITIONS 5; António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
MySQL Partitioning examples Key Partition: CREATE TABLE k1 ( id INT NOT NULL PRIMARY KEY, name VARCHAR(20))‏ PARTITION BY KEY()‏ PARTITIONS 4; CREATE TABLE k1 ( id INT NOT NULL, name VARCHAR(20), UNIQUE KEY (id) )‏ PARTITION BY KEY()‏ PARTITIONS 4; António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
Q&A ,[object Object],[object Object],António Amorim, Carlos Jesus. CU1 - First Database Testing Meeting, 20/Nov/08
MySQL Benchmarks MySQL Single server MySQL Cluster Oracle António Amorim, Carlos Jesus. CU1 -  DBWorkshop  9-10 /Feb/09
Test objectives ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],António Amorim, Carlos Jesus. CU1 - First Database Testing Meeting, 20/Nov/08 Network load(400K objects) ‏ PostgreSQL:  2072M MYSQL: 1050 Mb ORACLE-XE:  520 Mb
Single MySQL Server In order to pinpoint bottlenecks associated with MySQL, a series of basic tests were performed, these new tests made use of the available MDBExtractorIngestor package. Control and Monitor: Available at the local infrastructure was the SMS (Supervisor Monitor Scheduler) batch system, we deployed in one node the database and in another the Ingestor. At the local infrastructure was available the SMS (Supervisor Monitor Scheduler) batch system. The tests  basic 2 node client server model the nodes where as following: Hardware setup António Amorim, Carlos Jesus. CU1 - First Database Testing Meeting, 20/Nov/08
MySQL Ingestor, Old and new JdbcObjectUpdater, 4.5Gb of data. Tests For MDBExtractorIngestor António Amorim, Carlos Jesus. CU1 - First Database Testing Meeting, 20/Nov/08 JdbcObjectUpdater.java
Oracle datapump (local), 1Gb of data. Tests For DbBenchmark António Amorim, Carlos Jesus. CU1 - First Database Testing Meeting, 20/Nov/08 JdbcObjectUpdater.java MySQL Ingestor, Old and new JdbcObjectUpdater, 1Gb of data.

Mais conteúdo relacionado

Mais procurados

12cR2 Single-Tenant: Multitenant Features for All Editions
12cR2 Single-Tenant: Multitenant Features for All Editions12cR2 Single-Tenant: Multitenant Features for All Editions
12cR2 Single-Tenant: Multitenant Features for All EditionsFranck Pachot
 
Restore MySQL database from mysqlbackup
Restore MySQL database from mysqlbackup Restore MySQL database from mysqlbackup
Restore MySQL database from mysqlbackup AllDatabaseSolutions
 
Dbvisit replicate: logical replication made easy
Dbvisit replicate: logical replication made easyDbvisit replicate: logical replication made easy
Dbvisit replicate: logical replication made easyFranck Pachot
 
Step by Step Restore rman to different host
Step by Step Restore rman to different hostStep by Step Restore rman to different host
Step by Step Restore rman to different hostOsama Mustafa
 
Amazon aurora 1
Amazon aurora 1Amazon aurora 1
Amazon aurora 1EXEM
 
MySql 5.7 Backup Script
MySql 5.7 Backup ScriptMySql 5.7 Backup Script
MySql 5.7 Backup ScriptHızlan ERPAK
 
IBM DB2 LUW/UDB DBA Training by www.etraining.guru
IBM DB2 LUW/UDB DBA Training by www.etraining.guruIBM DB2 LUW/UDB DBA Training by www.etraining.guru
IBM DB2 LUW/UDB DBA Training by www.etraining.guruRavikumar Nandigam
 
Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7I Goo Lee
 
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...BertrandDrouvot
 
PostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesPostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesInMobi Technology
 
DB2UDB_the_Basics Day 4
DB2UDB_the_Basics Day 4DB2UDB_the_Basics Day 4
DB2UDB_the_Basics Day 4Pranav Prakash
 
What's New in PostgreSQL 9.6
What's New in PostgreSQL 9.6What's New in PostgreSQL 9.6
What's New in PostgreSQL 9.6EDB
 
Plmce 14 be a_hero_16x9_final
Plmce 14 be a_hero_16x9_finalPlmce 14 be a_hero_16x9_final
Plmce 14 be a_hero_16x9_finalMarco Tusa
 
1783696 huge space consumption of sm optstat in sysaux tablespace
1783696 huge space consumption of sm optstat in sysaux tablespace1783696 huge space consumption of sm optstat in sysaux tablespace
1783696 huge space consumption of sm optstat in sysaux tablespaceVictor Hugo
 
Install and upgrade Oracle grid infrastructure 12.1.0.2
Install and upgrade Oracle grid infrastructure 12.1.0.2Install and upgrade Oracle grid infrastructure 12.1.0.2
Install and upgrade Oracle grid infrastructure 12.1.0.2Biju Thomas
 

Mais procurados (20)

Physical_Standby_Database_R12.2.4
Physical_Standby_Database_R12.2.4Physical_Standby_Database_R12.2.4
Physical_Standby_Database_R12.2.4
 
12cR2 Single-Tenant: Multitenant Features for All Editions
12cR2 Single-Tenant: Multitenant Features for All Editions12cR2 Single-Tenant: Multitenant Features for All Editions
12cR2 Single-Tenant: Multitenant Features for All Editions
 
Restore MySQL database from mysqlbackup
Restore MySQL database from mysqlbackup Restore MySQL database from mysqlbackup
Restore MySQL database from mysqlbackup
 
Beginbackup
BeginbackupBeginbackup
Beginbackup
 
Dbvisit replicate: logical replication made easy
Dbvisit replicate: logical replication made easyDbvisit replicate: logical replication made easy
Dbvisit replicate: logical replication made easy
 
Step by Step Restore rman to different host
Step by Step Restore rman to different hostStep by Step Restore rman to different host
Step by Step Restore rman to different host
 
Amazon aurora 1
Amazon aurora 1Amazon aurora 1
Amazon aurora 1
 
MySQLinsanity
MySQLinsanityMySQLinsanity
MySQLinsanity
 
MySql 5.7 Backup Script
MySql 5.7 Backup ScriptMySql 5.7 Backup Script
MySql 5.7 Backup Script
 
IBM DB2 LUW/UDB DBA Training by www.etraining.guru
IBM DB2 LUW/UDB DBA Training by www.etraining.guruIBM DB2 LUW/UDB DBA Training by www.etraining.guru
IBM DB2 LUW/UDB DBA Training by www.etraining.guru
 
Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7
 
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
 
PostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesPostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major Features
 
DB2UDB_the_Basics Day 4
DB2UDB_the_Basics Day 4DB2UDB_the_Basics Day 4
DB2UDB_the_Basics Day 4
 
What's New in PostgreSQL 9.6
What's New in PostgreSQL 9.6What's New in PostgreSQL 9.6
What's New in PostgreSQL 9.6
 
2 db2 instance creation
2 db2 instance creation2 db2 instance creation
2 db2 instance creation
 
Plmce 14 be a_hero_16x9_final
Plmce 14 be a_hero_16x9_finalPlmce 14 be a_hero_16x9_final
Plmce 14 be a_hero_16x9_final
 
Mysql all
Mysql allMysql all
Mysql all
 
1783696 huge space consumption of sm optstat in sysaux tablespace
1783696 huge space consumption of sm optstat in sysaux tablespace1783696 huge space consumption of sm optstat in sysaux tablespace
1783696 huge space consumption of sm optstat in sysaux tablespace
 
Install and upgrade Oracle grid infrastructure 12.1.0.2
Install and upgrade Oracle grid infrastructure 12.1.0.2Install and upgrade Oracle grid infrastructure 12.1.0.2
Install and upgrade Oracle grid infrastructure 12.1.0.2
 

Destaque

Boost performance with MySQL 5.1 partitions
Boost performance with MySQL 5.1 partitionsBoost performance with MySQL 5.1 partitions
Boost performance with MySQL 5.1 partitionsGiuseppe Maxia
 
Testing mysql creatively in a sandbox
Testing mysql creatively in a sandboxTesting mysql creatively in a sandbox
Testing mysql creatively in a sandboxGiuseppe Maxia
 
Testing early mysql releases in a sandbox
Testing early mysql releases in a sandboxTesting early mysql releases in a sandbox
Testing early mysql releases in a sandboxGiuseppe Maxia
 
Juggle your data with Tungsten Replicator
Juggle your data with Tungsten ReplicatorJuggle your data with Tungsten Replicator
Juggle your data with Tungsten ReplicatorGiuseppe Maxia
 
MySQL Cluster Scaling to a Billion Queries
MySQL Cluster Scaling to a Billion QueriesMySQL Cluster Scaling to a Billion Queries
MySQL Cluster Scaling to a Billion QueriesBernd Ocklin
 
Java: strings e arrays
Java: strings e arraysJava: strings e arrays
Java: strings e arraysArthur Emanuel
 
State of the art of MySQL replication and clustering
State of the art of MySQL replication and clusteringState of the art of MySQL replication and clustering
State of the art of MySQL replication and clusteringGiuseppe Maxia
 

Destaque (9)

Boost performance with MySQL 5.1 partitions
Boost performance with MySQL 5.1 partitionsBoost performance with MySQL 5.1 partitions
Boost performance with MySQL 5.1 partitions
 
Testing mysql creatively in a sandbox
Testing mysql creatively in a sandboxTesting mysql creatively in a sandbox
Testing mysql creatively in a sandbox
 
Testing early mysql releases in a sandbox
Testing early mysql releases in a sandboxTesting early mysql releases in a sandbox
Testing early mysql releases in a sandbox
 
Juggle your data with Tungsten Replicator
Juggle your data with Tungsten ReplicatorJuggle your data with Tungsten Replicator
Juggle your data with Tungsten Replicator
 
Replication 101
Replication 101Replication 101
Replication 101
 
MySQL Cluster Scaling to a Billion Queries
MySQL Cluster Scaling to a Billion QueriesMySQL Cluster Scaling to a Billion Queries
MySQL Cluster Scaling to a Billion Queries
 
Java: strings e arrays
Java: strings e arraysJava: strings e arrays
Java: strings e arrays
 
State of the art of MySQL replication and clustering
State of the art of MySQL replication and clusteringState of the art of MySQL replication and clustering
State of the art of MySQL replication and clustering
 
MySQL highav Availability
MySQL highav AvailabilityMySQL highav Availability
MySQL highav Availability
 

Semelhante a MySQL-adv.ppt

All types of backups and restore
All types of backups and restoreAll types of backups and restore
All types of backups and restoreVasudeva Rao
 
My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)Gustavo Rene Antunez
 
My sql with querys
My sql with querysMy sql with querys
My sql with querysNIRMAL FELIX
 
Mater,slave on mysql
Mater,slave on mysqlMater,slave on mysql
Mater,slave on mysqlVasudeva Rao
 
Performence tuning
Performence tuningPerformence tuning
Performence tuningVasudeva Rao
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAsMark Leith
 
Download presentation
Download presentationDownload presentation
Download presentationwebhostingguy
 
My sql technical reference manual
My sql technical reference manualMy sql technical reference manual
My sql technical reference manualMir Majid
 
My SQL Portal Database (Cluster)
My SQL Portal Database (Cluster)My SQL Portal Database (Cluster)
My SQL Portal Database (Cluster)Nicholas Adu Gyamfi
 
RDS for MySQL, No BS Operations and Patterns
RDS for MySQL, No BS Operations and PatternsRDS for MySQL, No BS Operations and Patterns
RDS for MySQL, No BS Operations and PatternsLaine Campbell
 
10g rac asm
10g rac asm10g rac asm
10g rac asmVictor
 
My SYSAUX tablespace is full - please help
My SYSAUX tablespace is full - please helpMy SYSAUX tablespace is full - please help
My SYSAUX tablespace is full - please helpMarkus Flechtner
 
MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017Dave Stokes
 
MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017Dave Stokes
 
MySQL Scaling Presentation
MySQL Scaling PresentationMySQL Scaling Presentation
MySQL Scaling PresentationTommy Falgout
 
Scaling MySQL -- Swanseacon.co.uk
Scaling MySQL -- Swanseacon.co.uk Scaling MySQL -- Swanseacon.co.uk
Scaling MySQL -- Swanseacon.co.uk Dave Stokes
 
The OSSCube MySQL High Availability Tutorial
The OSSCube MySQL High Availability TutorialThe OSSCube MySQL High Availability Tutorial
The OSSCube MySQL High Availability TutorialOSSCube
 

Semelhante a MySQL-adv.ppt (20)

Slides
SlidesSlides
Slides
 
All types of backups and restore
All types of backups and restoreAll types of backups and restore
All types of backups and restore
 
My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)
 
My sql with querys
My sql with querysMy sql with querys
My sql with querys
 
Mater,slave on mysql
Mater,slave on mysqlMater,slave on mysql
Mater,slave on mysql
 
Performence tuning
Performence tuningPerformence tuning
Performence tuning
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
Mysql tutorial 5257
Mysql tutorial 5257Mysql tutorial 5257
Mysql tutorial 5257
 
Download presentation
Download presentationDownload presentation
Download presentation
 
My sql technical reference manual
My sql technical reference manualMy sql technical reference manual
My sql technical reference manual
 
My SQL Portal Database (Cluster)
My SQL Portal Database (Cluster)My SQL Portal Database (Cluster)
My SQL Portal Database (Cluster)
 
RDS for MySQL, No BS Operations and Patterns
RDS for MySQL, No BS Operations and PatternsRDS for MySQL, No BS Operations and Patterns
RDS for MySQL, No BS Operations and Patterns
 
Mysql ppt
Mysql pptMysql ppt
Mysql ppt
 
10g rac asm
10g rac asm10g rac asm
10g rac asm
 
My SYSAUX tablespace is full - please help
My SYSAUX tablespace is full - please helpMy SYSAUX tablespace is full - please help
My SYSAUX tablespace is full - please help
 
MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017
 
MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017
 
MySQL Scaling Presentation
MySQL Scaling PresentationMySQL Scaling Presentation
MySQL Scaling Presentation
 
Scaling MySQL -- Swanseacon.co.uk
Scaling MySQL -- Swanseacon.co.uk Scaling MySQL -- Swanseacon.co.uk
Scaling MySQL -- Swanseacon.co.uk
 
The OSSCube MySQL High Availability Tutorial
The OSSCube MySQL High Availability TutorialThe OSSCube MySQL High Availability Tutorial
The OSSCube MySQL High Availability Tutorial
 

Mais de webhostingguy

Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Frameworkwebhostingguy
 
MySQL and memcached Guide
MySQL and memcached GuideMySQL and memcached Guide
MySQL and memcached Guidewebhostingguy
 
Novell® iChain® 2.3
Novell® iChain® 2.3Novell® iChain® 2.3
Novell® iChain® 2.3webhostingguy
 
Load-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web serversLoad-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web serverswebhostingguy
 
SQL Server 2008 Consolidation
SQL Server 2008 ConsolidationSQL Server 2008 Consolidation
SQL Server 2008 Consolidationwebhostingguy
 
Master Service Agreement
Master Service AgreementMaster Service Agreement
Master Service Agreementwebhostingguy
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...webhostingguy
 
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...webhostingguy
 
Managing Diverse IT Infrastructure
Managing Diverse IT InfrastructureManaging Diverse IT Infrastructure
Managing Diverse IT Infrastructurewebhostingguy
 
Web design for business.ppt
Web design for business.pptWeb design for business.ppt
Web design for business.pptwebhostingguy
 
IT Power Management Strategy
IT Power Management Strategy IT Power Management Strategy
IT Power Management Strategy webhostingguy
 
Excel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for MerchandisersExcel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for Merchandiserswebhostingguy
 
Parallels Hosting Products
Parallels Hosting ProductsParallels Hosting Products
Parallels Hosting Productswebhostingguy
 
Microsoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 MbMicrosoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 Mbwebhostingguy
 

Mais de webhostingguy (20)

File Upload
File UploadFile Upload
File Upload
 
Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Framework
 
MySQL and memcached Guide
MySQL and memcached GuideMySQL and memcached Guide
MySQL and memcached Guide
 
Novell® iChain® 2.3
Novell® iChain® 2.3Novell® iChain® 2.3
Novell® iChain® 2.3
 
Load-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web serversLoad-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web servers
 
SQL Server 2008 Consolidation
SQL Server 2008 ConsolidationSQL Server 2008 Consolidation
SQL Server 2008 Consolidation
 
What is mod_perl?
What is mod_perl?What is mod_perl?
What is mod_perl?
 
What is mod_perl?
What is mod_perl?What is mod_perl?
What is mod_perl?
 
Master Service Agreement
Master Service AgreementMaster Service Agreement
Master Service Agreement
 
Notes8
Notes8Notes8
Notes8
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
 
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
 
Managing Diverse IT Infrastructure
Managing Diverse IT InfrastructureManaging Diverse IT Infrastructure
Managing Diverse IT Infrastructure
 
Web design for business.ppt
Web design for business.pptWeb design for business.ppt
Web design for business.ppt
 
IT Power Management Strategy
IT Power Management Strategy IT Power Management Strategy
IT Power Management Strategy
 
Excel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for MerchandisersExcel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for Merchandisers
 
OLUG_xen.ppt
OLUG_xen.pptOLUG_xen.ppt
OLUG_xen.ppt
 
Parallels Hosting Products
Parallels Hosting ProductsParallels Hosting Products
Parallels Hosting Products
 
Microsoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 MbMicrosoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 Mb
 
Reseller's Guide
Reseller's GuideReseller's Guide
Reseller's Guide
 

MySQL-adv.ppt

  • 1. MySQL Advanced MySQL Replication MySQL Cluster MySQL Partitioning António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 2. MySQL Advanced MySQL Replication António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 3. MySQL Replication Concepts MySQL replication tracks updates performed in a MySQL master logs and updates one or more slave servers. The mechanism involved in MySQL replication requires binary logging to be active. -Asynchronous replication, a slave doesn't need to be always active. -MySQL replication can be used to scale-out queries among different servers. -MySQL replication is a good solution for performing live backups. - Long distance data distribution. António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 4. MySQL Replication Architecture MySQL replication architecture: - Each update performed in a database is replicated from the master to the slaves. - Only slaves keep track of their replication status. - One may set at what point the replication begins. António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 5.
  • 6.
  • 7. MySQL Advanced MySQL Cluster António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 8. MySQL Cluster MySQL cluster is designed to provide near perfect availability through a shared nothing architecture, in turn this means that all the nodes in a MySQL cluster can be replicated for failover. MySQL cluster is a in memory database, which means that all data must be located in RAM, since version 5.1.6 a mechanism is available to store data on disk although Indexes must still fit in ram. All data in MySQL is horizontally partitioned, across different storage nodes, which means that all table data is split across the storage nodes. António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 9. MySQL Cluster MySQL cluster architecture consists of three types nodes: Storage nodes: All data is stored in this nodes. SQL nodes: Standard MySQL nodes, used for connection. Management nodes: Used to change the setup of the cluster. António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 10. MySQL Cluster António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09 Setup (Debian)‏ To setup a 3 node (API + engine + management) MySQL Cluster you must update 2 files: Edit /etc/mysql/my.cnf and add: [mysqld] ndbcluster [MYSQL_CLUSTER] ndb-connectstring=127.0.0. 1
  • 11. MySQL Cluster António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09 Setup (debian) Create a new configuration file in /etc/mysql/ndb_mgmd.cnf: [ndbd default] NoOfReplicas=1 DataMemory=80M IndexMemory=18M [ndb_mgmd] Id=1 hostname=localhost datadir=/var/lib/mysql-cluster [mysqld]
  • 12. MySQL Cluster Startup order: #1 Management nodes: invoke-rc.d mysql-ndb-mgm start (start-initial)‏ #2 Data nodes invoke-rc.d mysql-ndb start #3 SQL nodes invoke-rc.d mysql start António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 13. MySQL Cluster Testing the installation: bash$ ndb-mgm -e show Connected to Management Server at: 127.0.0.1:1186 Cluster Configuration --------------------- [ndbd(NDB)] 1 node(s)‏ id=2 @127.0.0.1 (Version: 5.1.22, Nodegroup: 0, Master)‏ [ndb_mgmd(MGM)] 1 node(s)‏ id=1 @127.0.0.1 (Version: 5.1.22)‏ [mysqld(API)] 1 node(s)‏ id=3 @127.0.0.1 (Version: 5.1.22)‏ António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 14. MySQL Cluster Testing the installation: mysql> create table person (id int, name varchar(32)) engine = ndb; Query OK, 0 rows affected (2,34 sec)‏ mysql> insert into person (id, name ) values ('11','carlos'); Query OK, 1 row affected (0,00 sec)‏ mysql> select * from person; +------+--------+ | id | name | +------+--------+ | 11 | carlos | +------+--------+ 1 row in set (0,00 sec)‏ António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 15. MySQL Advanced MySQL Partitioning António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 16. MySQL Partitioning c oncepts Typical SQL doesn't provide guidance to underling physical storage layer, Partitioning allows you to split a table across multiple files, through the usage of a special partitioning rule called partitioning function. Partitioning can only take place in engines that support partitioning, engines like MyISAM or InnoDB and not like CSV or BlackHole. The big performance boost in database partition is that partitions that do not satisfy a certain rule are not scanned, this is called partition pruning. António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 17.
  • 18. MySQL Partitioning examples Range partition: CREATE TABLE t1 ( r_name VARCHAR(50) NOT NULL, region_code TINYINT UNSIGNED NOT NULL )‏ PARTITION BY RANGE( region_code ) ( PARTITION p0 VALUES LESS THAN (64), PARTITION p1 VALUES LESS THAN (128), PARTITION p3 VALUES LESS THAN MAXVALUE ); António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 19. MySQL Partitioning examples List Partition: CREATE TABLE employees ( id INT NOT NULL, fname VARCHAR(30), lname VARCHAR(30), hired DATE NOT NULL DEFAULT '1970-01-01', separated DATE NOT NULL DEFAULT '9999-12-31', job_code INT, store_id INT )‏ PARTITION BY LIST(store_id) ( PARTITION pNorth VALUES IN (16,15,3,5,6,9,17), PARTITION pEast VALUES IN (1,2,8,10,11,19,20), PARTITION pWest VALUES IN (7, 4,12,13,14,18) ); António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 20. MySQL Partitioning examples Hash Partition: CREATE TABLE employees ( id INT NOT NULL, fname VARCHAR(30), lname VARCHAR(30), hired DATE NOT NULL DEFAULT '1970-01-01', separated DATE NOT NULL DEFAULT '9999-12-31', job_code INT, store_id INT )‏ PARTITION BY HASH(store_id)‏ PARTITIONS 5; António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 21. MySQL Partitioning examples Key Partition: CREATE TABLE k1 ( id INT NOT NULL PRIMARY KEY, name VARCHAR(20))‏ PARTITION BY KEY()‏ PARTITIONS 4; CREATE TABLE k1 ( id INT NOT NULL, name VARCHAR(20), UNIQUE KEY (id) )‏ PARTITION BY KEY()‏ PARTITIONS 4; António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 22.
  • 23. MySQL Benchmarks MySQL Single server MySQL Cluster Oracle António Amorim, Carlos Jesus. CU1 - DBWorkshop 9-10 /Feb/09
  • 24.
  • 25. Single MySQL Server In order to pinpoint bottlenecks associated with MySQL, a series of basic tests were performed, these new tests made use of the available MDBExtractorIngestor package. Control and Monitor: Available at the local infrastructure was the SMS (Supervisor Monitor Scheduler) batch system, we deployed in one node the database and in another the Ingestor. At the local infrastructure was available the SMS (Supervisor Monitor Scheduler) batch system. The tests basic 2 node client server model the nodes where as following: Hardware setup António Amorim, Carlos Jesus. CU1 - First Database Testing Meeting, 20/Nov/08
  • 26. MySQL Ingestor, Old and new JdbcObjectUpdater, 4.5Gb of data. Tests For MDBExtractorIngestor António Amorim, Carlos Jesus. CU1 - First Database Testing Meeting, 20/Nov/08 JdbcObjectUpdater.java
  • 27. Oracle datapump (local), 1Gb of data. Tests For DbBenchmark António Amorim, Carlos Jesus. CU1 - First Database Testing Meeting, 20/Nov/08 JdbcObjectUpdater.java MySQL Ingestor, Old and new JdbcObjectUpdater, 1Gb of data.