Archive for MySQL

Choosing the right MySQL High Availability Solution – webinar replay

MySQL-HA-Logo1.pngEarlier this week, I presented a webinar on MySQL High Availability options for MySQL – what they are and how to choose the most appropriate one for your application.

The replay of this webinar can now be viewed here or if you just want to look at the charts then scroll down. At the end of this post, I include a summary of the Q&A from the webinar.

How important is your data? Can you afford to lose it? What about just some of it? What would be the impact if you couldn’t access it for a minute, an hour, a day or a week?

Different applications can have very different requirements for High Availability. Some need 100% data reliability with 24x7x365 read & write access while many others are better served by a simpler approach with more modest HA ambitions.

MySQL has an array of High Availability solutions ranging from simple backups, through replication and shared storage clustering – all the way up to 99.999% available shared nothing, geographically replicated clusters. These solutions also have different ‘bonus’ features such as full InnoDB compatibility, in-memory real-time performance, linear scalability and SQL & NoSQL APIs.

The purpose of this webinar is to help you decide where your application sits in terms of HA requirements and discover which of the MySQL solutions best fit the bill. It will also cover what you need outside of the database to ensure High Availability – state of the art monitoring being a prime example.

The charts

 

Questions and Answers

  • What does “HA” stands for? High Availability
  • What is meant by scale-out? Scale-out is where you increase the capacity or the throughput of the system by adding extra (usually commodity) machines – this is the opposite of scale-up where you buy the biggest single server that you can find. It tends to be much more economical this way and you can add extra capacity if and when you need it.
  • Most of my applications are for small businesses were the data load is not that big, is this session worth listening too? Yes – the focus of this presentation is on keeping your data safe and accessible, not on scaling to massive volumes and throughput. Scale-out is touched on as if you need that as well then it can influence your choice of High Availability solution
  • How does all this compare with Amazon Aurora? Aurora is something that’s offered by Amazon and is supported by them. Aurora can only be run on AWS – the solutions covered here can be taken to lots of different environments – whether cloud or ‘bare metal’
  • what amount of work would be involved in migrating actual InnoDB based DB’s into NDB? As you’d expect, it depends on the application. Changes should be minor to get it to run but you might need to make more adjustments to get the best performance. This white paper is a good place to start.
  • Is it possible to migrate InnoDB data to MySQL Cluster? Yes. The first thing to note is that to use MySQL Cluster, you have to use the mysqld (MySQL Server) process that comes with the MySQL Cluster package; once you’ve switched to that binary then you can run ALTER TABLE my_tab ENGINE=NDB; provided that your schema is compatible with MySQL Cluster. Alternatively you can perform a mysqldump and then load the data in.
  • Does MySQL Fabric solutions support “rolling upgrade”? Yes – you can perform a rolling upgrade of the managed MySQL Servers but you have to do it yourself, Fabric doesn’t automate it at present
  • What about master-master replication? You can use active-active replication but the application is responsibe for avoiding conflicts between the two sites unless you use MySQL Cluster/NDB (where the functionality is built into the database)
  • What’s the maximum distance that the master and slave can be apart? For MySQL Replication, there is no maximum distance; the latency of the master isn’t impacted if you stick with the default asynchronous replication. If you use semi-synchronous replication then the latency of your transactions will be impacted by the WAN latency between the master and slave site(s).
  • Is there a monetary investment to implement this or is it free? The database technology presented in this session can be used under the GPL open source license; if you buy a commercal edition then you get access to some additional tools such as MySQL Enterprise Monitor and MySQL Cluster Manager.
  • Can we check the transaction sequence in slave side? Yes, with MySQL replication, you can check which transactions have been applied on the slave.
  • Can the slave switch over to master, in case the master needs to be shut down? Yes – that’s a very common use case
  • Do we have seperate binlog for different databases (schemas)? All of the databases (schemas) within the MySQL Server use the same binary log. When that log file fills up, it’s rotated out and a new one used.
  • How can I implement “auto-failover” in mysql 5.6 replication? Are you talking abaout “mysqlfailover” script? You can use the mysqlfailover utility or MySQL Fabric
  • What are the similarties and differences between InnoDB and the NDB/MySQL Cluster engines? We’ll cover some of this in this presentation and you can find more details in this white paper
  • With master-master replication, there were some parameters to control the autoincrement IDs so that we could avoid conflicts with active-active MySQL replication? If you ensure that the same row isn’t written to on both masters then you can avoid conflicts. One option could be to store odd primary keys on one and even on the other. You can then set the auto_increment_increment and auto_increment_offset parameters and then use auto-increment primary keys on each MySQL Server
  • Is there an online backup tool available in mysql – without locking my database? Yes – if you’re using InnoDB then you can use MySQL Enterprise Backup (part of MySQL Enterprise Edition and it’s also much faster than mysqldump); MySQL Cluster it has a built-in online backup tool (which can be simpler to use in conjunction with MySQL Cluter Manager which is part of MySQL Cluster Carrier Grade Edition)
  • In multi-source replication, how are data conflicts handled? If more than one master modifies the same row, which one is applied? That’s left as an exercise for the application. The application is responsible for making sure that there are no conflicting updates (if you care about the conflicts). You could also use MySQL Fabric to shard the data.
  • With MySQL Group Replication, if one master is down, will transactions still be applied? With MySQL Group Replication, updates can be sent to any of the servers and so if one is unavailable just switch to any of the others
  • what is the maximum data size MySQL can handle in it’s latest release? The maximum size of an InnoDB table[space] is four billion pages (64TB with the default 16k page size). Beyond that you start partitioning or use MySQL Fabric
  • Can you give a short definition for sharding? Sharding is where you take the data for a table and split it accross multiple MySQL Server instances. Typically you’ll choose one or more columns from the table to act as the sharding key to decide which shard a specific row should be stored in. You can also have functional sharding where you decide that the whole of table A will be in one shard and all of table B in another
  • Is there a storage engine to handle JSON documents? Here’s an interesting blog on that topic
  • What algorithms are available for sharding in MySQL? With MySQL Fabric you can use a hash or define ranges for the shard key. With MySQL Cluster, the sharding is completely transparrent to the application but it uses a MD5 hashing under the covers
  • In MySQL cluster is all the data replicated to all of the data nodes? Data is synchrously replicated between the 2 data nodes forming a node group. Different node groups are responsible for different shards for any given table
  • What’s the maximum number of data nodes in MySQL Cluster? 48
  • Which it best inter-connect method between MySQL Cluster data nodes for highest performance? Infiniband and GB Ethernet have both shown great results. If you’re able to configure the behaviour then low latency will help get the best performance
  • Can I colocate MySQL Cluster data nodes with MySQL Servers in order use all posible resources? Yes, you can co-locate data nodes and MySQL Servers. Note that the management node (ndb_mgmd) should not run on the same machine as any of the data nodes – read this post for details on how to deploy MySQL Cluster nodes for High Availability




SQL/NoSQL and MySQL Cluster 7.4 Presentations now available

My 2 sessions from 2014’s MySQL Central at Oracle OpenWorld are now available:

NoSQL and SQL: The Best of Both Worlds [CON2853]

There’s a lot of excitement about NoSQL data stores, with the promise of simple access patterns, flexible schemas, scalability, and high availability. The downside comes in the form of losing ACID transactions, consistency, flexible queries, and data integrity checks. What if you could have the best of both worlds? This session shows how MySQL Cluster provides simultaneous SQL and native NoSQL access to your data—whether it’s in a simple key-value API (memcached) or REST, JavaScript, Java, or C++. You will hear how the MySQL Cluster architecture delivers in-memory real-time performance; 99.999 percent availability; online maintenance; and linear, horizontal scalability through transparent autosharding.

MySQL Cluster: Dive into the Latest Developments [CON3815]

Wednesday, Oct 1, 3:30 PM – 4:15 PM – Moscone South – 250

I’ll be co-presenting this session with Bernd Ocklin – Director MySQL Cluster, Oracle

MySQL Cluster does more than scale beyond a billion transactions per minute. It’s also the in-memory database at the heart of mobile phone networks and online games. Scaling for the masses. A touch of your mobile phone’s green button likely has already gotten you in contact with MySQL Cluster. Driven by these extreme use cases, this session covers how to build business-critical scalable solutions with MySQL Cluster.





My NoSQL/SQL and MySQL Cluster sessions at Oracle OpenWorld

I have 2 sessions at Oracle OpenWorld in San Francisco this Thursday (2nd October 2014); please come along if your in town and feel free to grab me after the sessions for any extra questions:

NoSQL and SQL: The Best of Both Worlds [CON2853]

Thursday, Oct 2, 9:30 AM – 10:15 AM – Moscone South – 252

There’s a lot of excitement about NoSQL data stores, with the promise of simple access patterns, flexible schemas, scalability, and high availability. The downside comes in the form of losing ACID transactions, consistency, flexible queries, and data integrity checks. What if you could have the best of both worlds? This session shows how MySQL Cluster provides simultaneous SQL and native NoSQL access to your data—whether it’s in a simple key-value API (memcached) or REST, JavaScript, Java, or C++. You will hear how the MySQL Cluster architecture delivers in-memory real-time performance; 99.999 percent availability; online maintenance; and linear, horizontal scalability through transparent autosharding.

MySQL Cluster: Dive into the Latest Developments [CON3815]

Wednesday, Oct 1, 3:30 PM – 4:15 PM – Moscone South – 250

I’ll be co-presenting this session with Bernd Ocklin – Director MySQL Cluster, Oracle

MySQL Cluster does more than scale beyond a billion transactions per minute. It’s also the in-memory database at the heart of mobile phone networks and online games. Scaling for the masses. A touch of your mobile phone’s green button likely has already gotten you in contact with MySQL Cluster. Driven by these extreme use cases, this session covers how to build business-critical scalable solutions with MySQL Cluster.





I’ll be presenting at Oracle OpenWorld next week

I'm speaking at MySQL Central @ Oracle OpenWorld 2014
I will be presenting two sessions at MySQL Central @ Oracle OpenWorld in San Francisco next Thursday (2nd Ocotber). I hope to see as many of you there as possible and I’ll be around after the session to continue answering any questions.

NoSQL and SQL: The Best of Both Worlds [CON2853]

There’s a lot of excitement about NoSQL data stores, with the promise of simple access patterns, flexible schemas, scalability, and high availability. The downside comes in the form of losing ACID transactions, consistency, flexible queries, and data integrity checks. What if you could have the best of both worlds? This session shows how MySQL Cluster provides simultaneous SQL and native NoSQL access to your data—whether it’s in a simple key-value API (memcached) or REST, JavaScript, Java, or C++. You will hear how the MySQL Cluster architecture delivers in-memory real-time performance; 99.999 percent availability; online maintenance; and linear, horizontal scalability through transparent autosharding.

MySQL Cluster: Dive into the Latest Developments [CON3815]

MySQL Cluster is the distributed, shared-nothing version of MySQL. It’s typically used for applications that need any combination of high availability, real-time performance, and scaling of reads and writes. After a brief introduction to the technology, its uses, and the new features added in MySQL Cluster 7.3, this session focuses on the very latest developments happening in MySQL Cluster 7.4. As you’d expect from a real-time, scalable, distributed, in-memory database, performance continues to be a top priority, as do simplicity of use and robustness. Come hear firsthand what’s being done to make sure MySQL Cluster continues to dominate in mission-critical, high-performance applications.





Webinar – Automated Sharding and High Availability with MySQL Fabric

MySQL Fabric
On Tuesday 17th December, we’ll be presenting a webinar on the latest developments for MySQL Fabric (a framework for managing pools of MySQL server – together with 2 applications: automated sharding and High Availablity). As always, the webinar is free and you should register here.

This is your opportunity to hear the details directly from the engineering team and put your questions to them.

This session will present MySQL Fabric and help you understand how you will be able to leverage it to address your scaling needs:

  • Architecture for performance of a sharded deployment
  • Management of MySQL server farms via MySQL Fabric
  • MySQL Fabric as a tool for handling sharding and high-availability
  • Application demands when working with a sharded database
  • Connector demands when working with a sharded database
  • Approaches to mixing sharded and global tables

When:

  • Tue, Dec 17: 10:00 Pacific time (America)
  • Tue, Dec 17: 11:00 Mountain time (America)
  • Tue, Dec 17: 12:00 Central time (America)
  • Tue, Dec 17: 13:00 Eastern time (America)
  • Tue, Dec 17: 16:00 São Paulo time
  • Tue, Dec 17: 18:00 UTC
  • Tue, Dec 17: 18:00 Western European time
  • Tue, Dec 17: 19:00 Central European time
  • Tue, Dec 17: 20:00 Eastern European time
  • Tue, Dec 17: 23:30 India, Sri Lanka
  • Wed, Dec 18: 02:00 Singapore/Malaysia/Philippines time
  • Wed, Dec 18: 02:00 China time
  • Wed, Dec 18: 03:00 日本
  • Wed, Dec 18: 05:00 NSW, ACT, Victoria, Tasmania (Australia)




MySQL & Friends – FOSDEM 2014 CfP last chance!

MySQL & Friends devroom
Heads up that Friday (6th December) is your last chance to submit a 30 minute session proposal for next year’s MySQL & Friends Devroom at FOSDEM. I presented last year and I was really impressed by the number of attendees, the organisation and the positive reception (I’ll be there again next year – hopefully presenting). If you’ve got a MySQL-related topic that you’d like to present to an enthusiastic open-source community then this is a agreat opportunity.

Submit your proposal(s) for a 30 minute session here.

FOSDEM 2014 is free event running in Brussels over the weekend of 1st & 2nd February, with the MySQL content aimed for the Saturday. This is a huge event (5,000+) and has a great, informal, developer-focused atmosphere – even if you don’t want to present, it’s worth attending if you can.





Holding MySQL HA workshop in Oxford

All Your Base Conference - MySQL HA WorkshopOn 17th October I’ll be running a hands-on workshop on the various technologies available to provide High Availability using MySQL. The workshop is being held on 17th October (the day before the All Your Base conference) in Oxford (UK). The cost is £250 + VAT and you can register here.

This workshop provides an introduction to what High Availability (HA) is; what technology options are available to achieve it with MySQL and how to actually implement your own HA solutions. The session will be a mixture of presentations, demonstrations and (most importantly) hands-on tutorials.

We’ll start with an overview of High Availability – in general and in the context of MySQL and then a survey of the technologies to choose from:

  • MySQL Replication
  • MySQL Cluster
  • DRBD
  • Shared storage clustering options
    • Windows Server Failover Clustering
    • Solaris Clusters
    • Oracle Virtual Machine

There will be deep-dives on MySQL Replication and MySQL Cluster and this is where the hands-on parts of the workshop will focus:

  • What these technologies achieve and how
  • Get your own database clusters up and running (hands-on)
  • “What happens when I do this…?” (hands-on)
  • Monitoring (mix of hands-on and demos)

The plan is to get everyone up and running with multiple VMs on their laptops so that they can experiment and test with MySQL Cluster and MySQL Replication over multiple (virtual) hosts. As a stretch, we’ll try creating a Cluster running over everyone’s machine at the same time – though that might be stretching the logisitics! I’ve got a supply of 30 USB sticks and hope to have 2-3 unique virtual appliances on each – what could go wrong?





New replication & HA white papers

MySQLReplication and High Availability logoWith the General Availability of the standalone MySQL Utilities it now makes sense to use these to simplify (and optionally automate) your MySQL Replication and High Availability solutions. In light of that, 4 of our MySQL white papers have been updated to reflect the new opportunities:

MySQL Guide to High Availability Solutions. Data is the currency of today’s web, mobile, social, enterprise and cloud applications. Ensuring data is always available is a top priority for any organization – minutes of downtime will result in significant loss of revenue and reputation.

This Guide is designed to assist Developers, Architects and DBAs in navigating the complex waters of HA. It presents:

  • A methodology for selecting the right HA solution to meet Service Level Agreements
  • A tour of the leading certified HA solutions for MySQL
  • Operational best practices to implement and support HA

MySQL Replication: High Availability – Building a Self-Healing Replication Topology. Download the whitepaper to learn how to improve user-experience, reduce cost and innovate faster using MySQL replication.

Global Transaction Identifiers (GTIDs) are one of the core new features of MySQL 5.6 replication, providing a foundation to building self-healing, highly available data clusters.

By reading this whitepaper, you will be able to:

  • Illustrate use-cases and implementation of MySQL replication
  • Learn how High Availability (HA) with MySQL replication is achieved using GTIDs
  • Gain an overview of MySQL replication utilities
  • Discover resources for achieving HA with MySQL replication

The paper concludes with an overview of operational best practices.

MySQL Replication: An Introduction. Download the whitepaper to learn how MySQL replication enables the largest web, cloud, mobile and social applications to scale-out on commodity hardware, while reducing the risks of downtime.

The whitepaper discusses:

  • Replication concepts
  • Replication enhancements in MySQL 5.6
  • Replication use-cases
  • Replication topologies
  • Replication monitoring and management

The paper concludes with resources to get started with MySQL replication in building next generation services.

MySQL Replication Tutorial: Configuration, Provisioning and Management. Download the whitepaper for practical examples and best practices in building highly available services using MySQL replication as well as MySQL Utilities.

By reading this paper, you will be able to:

  • Configure and provision MySQL replication (with or without MySQL Utilities)
  • Migrate to semi-synchronous replication
  • Administer and trouble-shoot MySQL replication (with or without MySQL Utilities)
  • Promote a slave to be the new master in the event of a failed Master (manual or automatic, with or without MySQL Utilities

The paper concludes with additional resources to tune and optimize MySQL replication for your environment.





MySQL Utilities Webinar – Q&A + replay now available

MySQL Utilities logoDr Charles Bell and I recently presented a webinar on MySQL Utilities; there was a heavy focus on what you can acheive with them and how you should use them. In case you couldn’t attend or want to listen to some of the details again, the replay from that webinar is available here.

Abstract:

MySQL Utilities provide a collection of command-line utilities that are used for maintaining and administering MySQL databases, including:

  • Admin Utilities (Clone, Copy, Compare, Diff, Export, Import)
  • Replication Utilities (Setup, Configuration, Automated Slave Promotion)
  • General Utilities (Disk Usage, Redundant Indexes, Search Meta Data)

Andrew Morgan and Chuck Bell will guide you through these utilities, and many more, explaining what you can gain from these tools and how to use them (for example how a single command repeatedly checks your master server and in the event it fails, automatically promotes one of the slaves to be the new master).

Question & Answer Summary:

  • Using these utilities, can we export/import routines’ source as well? Yes.
  • I generally run multi-master behind a proxy (haproxy). I was wondering if the replication check would work. But I guess mysql still does not support multi-master or ring replcation. It depends on want you intend to do exactly. There are some limitation, but we intend to improve the utilities over time. So, just test the utilities on your environment and your are welcome to share your feedback with us.
  • Do you need the python connector if you have the utilities on workbench? No, it is bundled as part of WB.
  • What does “mysqluserclone” do that “SHOW GRANTS FOR USER” doesn’t do? It actually creates the users, clone them and not simply show its privileges like SHOW GRANTS. You can find more details here.
  • With mysqlfailover can I set a sequence to swith specific order if a fail occurs with the master? Yes, you can. It will follow the sequence of the defined candidates.
  • Can I run mysqlfailover on a independent server that check the master and their slave servers or it can run on the master or slave servers (mandatory)? Running on an independent server is ideal. After all, you don’t want it to disappear when the master’s host fails.
  • How many MySQL instances can I manage with mysqlfailover, I mean there is possible to check more than one array with the same independent server? With one mysqlfailover instance you can monitor one topology, i.e. one master and all its slaves. If you have more than one topology (using a different master) you can use a mysqlfailover instance to monitor each one.
  • If a master goes down and replication failover is successful, how hard is it to bring that old master back into the fold, assuming it was just a network disruption? You can use mysqlreplicate to set the old master as a slave of the new master resulted by the failover, that will update the old master. then you can use mysqlrpladmin to switchover the just added slave, to make it a master again, that back your original replication setup.
  • Can mysqlprocgrep log what it kills? There is no option to log what it is done. But you can redirect the utility output if it contains the information you need.
  • How does mysqldbcompare handle auto-increment columns? It will find the difference between auto_increment values. So, currently if it is different it will identify the difference. You will get the difference, as: changed or missing rows are shown in a standard format of GRID, CSV, TAB, or VERTICAL. you can choose in which format you want to get the difference.
  • I use Pacemaker/Corosync to achieve failover. Is mysqlfailover suitable for use in that context? Do I need to add extra logic around it, some wrapper script? If so, does Oracle provide a ready-made scripts for Pacemaker/Corosync? mysqlfailover was designed to work independently, and provides some functionalities that may help with the integration with other systems (like the possibility to execute external pre- pos- failover scripts). We do not have a ready-made script for Pacemaker/Corosync. For more information check here.
  • How long are the frm files kept if the database is corrupt or was deleted. The .frm files are not removed in any way. So there is no deletion or removal of the .frm files. The .frm files are an integral part of the server and stored in the datadir.
  • Can mysqlserverclone clone instances between separate servers? Using SSH? mysqlserverclone, starts a new instance, that mimics a running server or a offline server by taking a look to his configuration, but to copy objects like tables, to another instance you need to use mysqldbcopy. We do not currently support SSH. If you see this as a much needed feature, please open a feature request via bugs.mysql.com. That will help us understand the need and urgency.

 





MySQL Virtual Developers Day

MySQL Virtual Developers DayI’ll be presenting the keynote for Wednesday’s (31st July) MySQL Virtual Developer Day. The idea behind this event is that you get half a day of on-line presentations as well as live Q&A. My session focuses on what’s new in MySQL – in particular MySQL 5.6 and MySQL Cluster 7.3. As you’ll come to have expected, the event is free but you need to register here.
In the following agenda, all times are local to Singapore…
MySQL Virtual Developers Day (APAC) Agenda