SlideShare uma empresa Scribd logo
1 de 10
Baixar para ler offline
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 121
Insert Picture Here
MySQL Cluster schema
management
Frazer Clement
MySQL Cluster Technical lead
frazer.clement@oracle.com
messagepassing.blogspot.com
November 2014
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.2
MySQLD
●
Each MySQLD maintains independent schema information in Data
Directory structure, and on disk .frm files
●
MySQLD stores SQL level schema information, actual creation of
tables, indices, storage is delegated to the storage engine (SE).
●
ha_ndbcluster the Ndb 'storage engine' layer uses a 'Global Schema
Lock' (GSL) and 'Schema distribution' via the mysql.ndb_schema table to
synchronise schemas across all MySQLDs in a cluster.
●
MySQLD has the concept of certain schema operations (DDL) being
'online' or 'in place' as opposed to 'offline' or 'copying'.
●
Generally any schema change can be done offline/copying, and only a
(growing) subset can be done online / inplace.
Schema management Offline / copying schema changes commonly
require at least 2*table storage to complete
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.3
MySQLD
For offline / copying changes :
●
Much of the work is done by MySQLD :
Create table sql#xxx with new schema, Scan old table copying and
reformatting rows, Rename table name to sql#yyy, sql#xxx to table
name, drop table sql#yyy.
●
MySQLD will take protective table locks on the MySQLD where the
DDL is running, but these have no effect on queries or DML from NdbApi
clients or other MySQLDs.
●
The scan/copy part of offline schema change is not consistent w.r.t.
ongoing updates, so they must be stopped during the schema change.
Schema management Offline / copying schema changes can be
effectively 'online' if they are performed at a
backup site, and replication is used.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.4
MySQLD
●
For online/inplace changes most of the work is delegated to the SE as
it is usually very implementation specific.
●
Sometimes MySQLD takes more conservative locks than necessary
(e.g. table locks) while online schema operations are running. These
can lock out concurrent access on the MySQLD where the DDL is
running. This is confusing and limiting, but it is still possible to run
queries and DML via NdbApi and other MySQLDs.
Schema management
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.5
Ndb
●
Ndb has its own Data dictionary (see ndb_show_tables, ndb_desc
etc)
●
Data dictionary is distributed, transactional etc, independent of
MySQLD view of schema
●
Transactions (since 7.0) ensure clean rollback if participants fail or
resources are exhausted during a schema operation.
●
Ndb schema objects are versioned with a Major and Minor version.
Compatible (online) changes only increment the Minor part of the
version.
●
For tables, the Ndb data dictionary contains the table's .frm content as
a Blob. This allows the SE to 'create' the tables on newly started / re-
initialised MySQLD nodes.
Schema management
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.6
Currently supported Ndb online schema operations
●
Add index
●
Drop index
●
Add column (at end of row)
●
Reorganise partitions
Add index uses an Ndb-internal 'live copy' mechanism (similar to the
node recovery) to build an index while the indexed data is changing.
Add column makes use of 'Dynamic columns' inside LDM to add a
column by only changing table metadata- no need to scan/modify every
row.
Reorg uses triggers and special row markers.
Schema management
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.7
Issues in online schema change
●
Handling ongoing write activity
●
Minimising transient storage increase.
●
Amount of data involved if every row must be touched
●
Re-optimising storage if data is removed.
●
Compatible and non-compatible changes for existing clients
●
Dependencies between schema and clients
●
Replication
●
Backup and Restore
Schema management
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.8
Schema object versions + NdbApi
●
Visible via ndb_show_tables (and ndbinfo in 7.4+)
●
Online change (e.g. add column) increments minor version
●
Offline change (e.g. drop column) increments major version (or
changes schema object id)
●
NdbApi clients have a schema object cache, where each object is
versioned.
●
NdbApi operations carry the schema object versions they were defined
against.
●
If the data node's version differs only in the minor version, the operation
can proceed. If it differs in major version, it is rejected.
●
On schema object version error, clients will invalidate their local objects
and re-fetch.
Schema management
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.9
Schema object versions + NdbApi
●
This mechanism allows online schema upgrades where clients can
lazily update their schema object caches.
MySQLD approach
MySQLD is involved in all schema changes via schema distribution.
Schema changes are logically made to occur on epoch boundaries.
MySQLD controls (its) schema object invalidation.
MySQLD controls the schema used for Binlogging at any point in time,
Schema management
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.10
Replication
●
Replication supports a set of attribute (column) type promotions and
demotions, as well as different numbers of columns at Master + Slave.
●
This allows different schemas at Master and Slave
Backup + Restore
ndb_restore supports a set of column type promotions and demotions
designed to mirror those supported by replication. This allows B+R on a
slave with different cluster to be a schema change mechanism and
ensures that the worst-case recovery mechanism (B+R) works even
when schemas are misaligned between replicas.
Schema management

Mais conteúdo relacionado

Mais procurados

2012 10 24_briefing room
2012 10 24_briefing room2012 10 24_briefing room
2012 10 24_briefing roomNuoDB
 
MariaDB CONNECT Storage Engine
MariaDB CONNECT Storage EngineMariaDB CONNECT Storage Engine
MariaDB CONNECT Storage EngineSerge Frezefond
 
The Future of Distributed Databases
The Future of Distributed DatabasesThe Future of Distributed Databases
The Future of Distributed DatabasesNuoDB
 
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007eLiberatica
 
Architecture of exadata database machine – Part II
Architecture of exadata database machine – Part IIArchitecture of exadata database machine – Part II
Architecture of exadata database machine – Part IIParesh Nayak,OCP®,Prince2®
 
MySQL 5.5&5.6 new features summary
MySQL 5.5&5.6 new features summaryMySQL 5.5&5.6 new features summary
MySQL 5.5&5.6 new features summaryLouis liu
 
MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)
MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)
MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)Frazer Clement
 
Design Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational DatabasesDesign Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational Databasesguestdfd1ec
 
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document StoreConnector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document StoreFilipe Silva
 
6 Data Modeling for NoSQL 2/2
6 Data Modeling for NoSQL 2/26 Data Modeling for NoSQL 2/2
6 Data Modeling for NoSQL 2/2Fabio Fumarola
 
MySQL For Oracle Developers
MySQL For Oracle DevelopersMySQL For Oracle Developers
MySQL For Oracle DevelopersRonald Bradford
 
Triangle MySQL User Group MySQL Fabric Presentation Feb 12th, 2015
Triangle MySQL User Group MySQL Fabric Presentation Feb 12th, 2015Triangle MySQL User Group MySQL Fabric Presentation Feb 12th, 2015
Triangle MySQL User Group MySQL Fabric Presentation Feb 12th, 2015Dave Stokes
 
NoSQL and MySQL webinar - best of both worlds
NoSQL and MySQL webinar - best of both worldsNoSQL and MySQL webinar - best of both worlds
NoSQL and MySQL webinar - best of both worldsMat Keep
 
In-memory Database and MySQL Cluster
In-memory Database and MySQL ClusterIn-memory Database and MySQL Cluster
In-memory Database and MySQL Clustergrandis_au
 
IN-MEMORY DATABASE SYSTEMS FOR BIG DATA MANAGEMENT.SAP HANA DATABASE.
IN-MEMORY DATABASE SYSTEMS FOR BIG DATA MANAGEMENT.SAP HANA DATABASE.IN-MEMORY DATABASE SYSTEMS FOR BIG DATA MANAGEMENT.SAP HANA DATABASE.
IN-MEMORY DATABASE SYSTEMS FOR BIG DATA MANAGEMENT.SAP HANA DATABASE.George Joseph
 
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014Dave Stokes
 
NoSQL Databases
NoSQL DatabasesNoSQL Databases
NoSQL DatabasesBADR
 

Mais procurados (20)

2012 10 24_briefing room
2012 10 24_briefing room2012 10 24_briefing room
2012 10 24_briefing room
 
MariaDB CONNECT Storage Engine
MariaDB CONNECT Storage EngineMariaDB CONNECT Storage Engine
MariaDB CONNECT Storage Engine
 
The Future of Distributed Databases
The Future of Distributed DatabasesThe Future of Distributed Databases
The Future of Distributed Databases
 
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
 
Architecture of exadata database machine – Part II
Architecture of exadata database machine – Part IIArchitecture of exadata database machine – Part II
Architecture of exadata database machine – Part II
 
MySQL 5.5&5.6 new features summary
MySQL 5.5&5.6 new features summaryMySQL 5.5&5.6 new features summary
MySQL 5.5&5.6 new features summary
 
MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)
MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)
MySQL Cluster Local Checkpoint (LCP) evolution in 7.6 (2019)
 
Design Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational DatabasesDesign Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational Databases
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document StoreConnector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
 
6 Data Modeling for NoSQL 2/2
6 Data Modeling for NoSQL 2/26 Data Modeling for NoSQL 2/2
6 Data Modeling for NoSQL 2/2
 
MySQL For Oracle Developers
MySQL For Oracle DevelopersMySQL For Oracle Developers
MySQL For Oracle Developers
 
Triangle MySQL User Group MySQL Fabric Presentation Feb 12th, 2015
Triangle MySQL User Group MySQL Fabric Presentation Feb 12th, 2015Triangle MySQL User Group MySQL Fabric Presentation Feb 12th, 2015
Triangle MySQL User Group MySQL Fabric Presentation Feb 12th, 2015
 
NoSQL and MySQL webinar - best of both worlds
NoSQL and MySQL webinar - best of both worldsNoSQL and MySQL webinar - best of both worlds
NoSQL and MySQL webinar - best of both worlds
 
In-memory Database and MySQL Cluster
In-memory Database and MySQL ClusterIn-memory Database and MySQL Cluster
In-memory Database and MySQL Cluster
 
IN-MEMORY DATABASE SYSTEMS FOR BIG DATA MANAGEMENT.SAP HANA DATABASE.
IN-MEMORY DATABASE SYSTEMS FOR BIG DATA MANAGEMENT.SAP HANA DATABASE.IN-MEMORY DATABASE SYSTEMS FOR BIG DATA MANAGEMENT.SAP HANA DATABASE.
IN-MEMORY DATABASE SYSTEMS FOR BIG DATA MANAGEMENT.SAP HANA DATABASE.
 
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
 
Mysql For Developers
Mysql For DevelopersMysql For Developers
Mysql For Developers
 
Mysql database
Mysql databaseMysql database
Mysql database
 
NoSQL Databases
NoSQL DatabasesNoSQL Databases
NoSQL Databases
 

Semelhante a MySQL Cluster Schema management (2014)

MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014) MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014) Frazer Clement
 
Metadata Synchronization in MySQL NDB Cluster 8.0
Metadata Synchronization in MySQL NDB Cluster 8.0Metadata Synchronization in MySQL NDB Cluster 8.0
Metadata Synchronization in MySQL NDB Cluster 8.0Arnab Ray
 
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA -   UKOUGEmbracing Database Diversity: The New Oracle / MySQL DBA -   UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUGKeith Hollman
 
001 hbase introduction
001 hbase introduction001 hbase introduction
001 hbase introductionScott Miao
 
20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptxIvan Ma
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesTarique Saleem
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL SupportMysql User Camp
 
Data has a better idea the in-memory data grid
Data has a better idea   the in-memory data gridData has a better idea   the in-memory data grid
Data has a better idea the in-memory data gridBogdan Dina
 
Oracle to MySQL 2012
Oracle to MySQL  2012 Oracle to MySQL  2012
Oracle to MySQL 2012 Marco Tusa
 
NA14G05 - A DB2 DBAs Guide to pureScale.pdf
NA14G05 - A DB2 DBAs Guide to pureScale.pdfNA14G05 - A DB2 DBAs Guide to pureScale.pdf
NA14G05 - A DB2 DBAs Guide to pureScale.pdfsunildupakuntla
 
MySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disksMySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disksDave Stokes
 
Active/Active Database Solutions with Log Based Replication in xDB 6.0
Active/Active Database Solutions with Log Based Replication in xDB 6.0Active/Active Database Solutions with Log Based Replication in xDB 6.0
Active/Active Database Solutions with Log Based Replication in xDB 6.0EDB
 
Secrets of Spark's success - Deenar Toraskar, Think Reactive
Secrets of Spark's success - Deenar Toraskar, Think Reactive Secrets of Spark's success - Deenar Toraskar, Think Reactive
Secrets of Spark's success - Deenar Toraskar, Think Reactive huguk
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability ConsiderationsNavid Malek
 
Consolidate and prepare for cloud efficiencies
Consolidate and prepare for cloud efficienciesConsolidate and prepare for cloud efficiencies
Consolidate and prepare for cloud efficienciesDLT Solutions
 
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015
MySQL's NoSQL  -- Texas Linuxfest August 22nd 2015MySQL's NoSQL  -- Texas Linuxfest August 22nd 2015
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015Dave Stokes
 

Semelhante a MySQL Cluster Schema management (2014) (20)

MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014) MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014)
 
Metadata Synchronization in MySQL NDB Cluster 8.0
Metadata Synchronization in MySQL NDB Cluster 8.0Metadata Synchronization in MySQL NDB Cluster 8.0
Metadata Synchronization in MySQL NDB Cluster 8.0
 
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA -   UKOUGEmbracing Database Diversity: The New Oracle / MySQL DBA -   UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
 
001 hbase introduction
001 hbase introduction001 hbase introduction
001 hbase introduction
 
20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New Features
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 
Data has a better idea the in-memory data grid
Data has a better idea   the in-memory data gridData has a better idea   the in-memory data grid
Data has a better idea the in-memory data grid
 
Oracle to MySQL 2012
Oracle to MySQL  2012 Oracle to MySQL  2012
Oracle to MySQL 2012
 
NA14G05 - A DB2 DBAs Guide to pureScale.pdf
NA14G05 - A DB2 DBAs Guide to pureScale.pdfNA14G05 - A DB2 DBAs Guide to pureScale.pdf
NA14G05 - A DB2 DBAs Guide to pureScale.pdf
 
MySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disksMySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disks
 
Active/Active Database Solutions with Log Based Replication in xDB 6.0
Active/Active Database Solutions with Log Based Replication in xDB 6.0Active/Active Database Solutions with Log Based Replication in xDB 6.0
Active/Active Database Solutions with Log Based Replication in xDB 6.0
 
FAQ
FAQFAQ
FAQ
 
Secrets of Spark's success - Deenar Toraskar, Think Reactive
Secrets of Spark's success - Deenar Toraskar, Think Reactive Secrets of Spark's success - Deenar Toraskar, Think Reactive
Secrets of Spark's success - Deenar Toraskar, Think Reactive
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability Considerations
 
Consolidate and prepare for cloud efficiencies
Consolidate and prepare for cloud efficienciesConsolidate and prepare for cloud efficiencies
Consolidate and prepare for cloud efficiencies
 
NoSQL and MySQL
NoSQL and MySQLNoSQL and MySQL
NoSQL and MySQL
 
3 olap storage
3 olap storage3 olap storage
3 olap storage
 
3 olap storage
3 olap storage3 olap storage
3 olap storage
 
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015
MySQL's NoSQL  -- Texas Linuxfest August 22nd 2015MySQL's NoSQL  -- Texas Linuxfest August 22nd 2015
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015
 

Último

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 

Último (20)

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 

MySQL Cluster Schema management (2014)

  • 1. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 121 Insert Picture Here MySQL Cluster schema management Frazer Clement MySQL Cluster Technical lead frazer.clement@oracle.com messagepassing.blogspot.com November 2014
  • 2. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.2 MySQLD ● Each MySQLD maintains independent schema information in Data Directory structure, and on disk .frm files ● MySQLD stores SQL level schema information, actual creation of tables, indices, storage is delegated to the storage engine (SE). ● ha_ndbcluster the Ndb 'storage engine' layer uses a 'Global Schema Lock' (GSL) and 'Schema distribution' via the mysql.ndb_schema table to synchronise schemas across all MySQLDs in a cluster. ● MySQLD has the concept of certain schema operations (DDL) being 'online' or 'in place' as opposed to 'offline' or 'copying'. ● Generally any schema change can be done offline/copying, and only a (growing) subset can be done online / inplace. Schema management Offline / copying schema changes commonly require at least 2*table storage to complete
  • 3. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.3 MySQLD For offline / copying changes : ● Much of the work is done by MySQLD : Create table sql#xxx with new schema, Scan old table copying and reformatting rows, Rename table name to sql#yyy, sql#xxx to table name, drop table sql#yyy. ● MySQLD will take protective table locks on the MySQLD where the DDL is running, but these have no effect on queries or DML from NdbApi clients or other MySQLDs. ● The scan/copy part of offline schema change is not consistent w.r.t. ongoing updates, so they must be stopped during the schema change. Schema management Offline / copying schema changes can be effectively 'online' if they are performed at a backup site, and replication is used.
  • 4. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.4 MySQLD ● For online/inplace changes most of the work is delegated to the SE as it is usually very implementation specific. ● Sometimes MySQLD takes more conservative locks than necessary (e.g. table locks) while online schema operations are running. These can lock out concurrent access on the MySQLD where the DDL is running. This is confusing and limiting, but it is still possible to run queries and DML via NdbApi and other MySQLDs. Schema management
  • 5. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.5 Ndb ● Ndb has its own Data dictionary (see ndb_show_tables, ndb_desc etc) ● Data dictionary is distributed, transactional etc, independent of MySQLD view of schema ● Transactions (since 7.0) ensure clean rollback if participants fail or resources are exhausted during a schema operation. ● Ndb schema objects are versioned with a Major and Minor version. Compatible (online) changes only increment the Minor part of the version. ● For tables, the Ndb data dictionary contains the table's .frm content as a Blob. This allows the SE to 'create' the tables on newly started / re- initialised MySQLD nodes. Schema management
  • 6. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.6 Currently supported Ndb online schema operations ● Add index ● Drop index ● Add column (at end of row) ● Reorganise partitions Add index uses an Ndb-internal 'live copy' mechanism (similar to the node recovery) to build an index while the indexed data is changing. Add column makes use of 'Dynamic columns' inside LDM to add a column by only changing table metadata- no need to scan/modify every row. Reorg uses triggers and special row markers. Schema management
  • 7. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.7 Issues in online schema change ● Handling ongoing write activity ● Minimising transient storage increase. ● Amount of data involved if every row must be touched ● Re-optimising storage if data is removed. ● Compatible and non-compatible changes for existing clients ● Dependencies between schema and clients ● Replication ● Backup and Restore Schema management
  • 8. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.8 Schema object versions + NdbApi ● Visible via ndb_show_tables (and ndbinfo in 7.4+) ● Online change (e.g. add column) increments minor version ● Offline change (e.g. drop column) increments major version (or changes schema object id) ● NdbApi clients have a schema object cache, where each object is versioned. ● NdbApi operations carry the schema object versions they were defined against. ● If the data node's version differs only in the minor version, the operation can proceed. If it differs in major version, it is rejected. ● On schema object version error, clients will invalidate their local objects and re-fetch. Schema management
  • 9. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.9 Schema object versions + NdbApi ● This mechanism allows online schema upgrades where clients can lazily update their schema object caches. MySQLD approach MySQLD is involved in all schema changes via schema distribution. Schema changes are logically made to occur on epoch boundaries. MySQLD controls (its) schema object invalidation. MySQLD controls the schema used for Binlogging at any point in time, Schema management
  • 10. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.10 Replication ● Replication supports a set of attribute (column) type promotions and demotions, as well as different numbers of columns at Master + Slave. ● This allows different schemas at Master and Slave Backup + Restore ndb_restore supports a set of column type promotions and demotions designed to mirror those supported by replication. This allows B+R on a slave with different cluster to be a schema change mechanism and ensures that the worst-case recovery mechanism (B+R) works even when schemas are misaligned between replicas. Schema management