Blog
Notes from the field
Architecture, high availability, backups, and sharding from consulting work. This archive is mostly MySQL, Galera, and Vitess.
- MySQL
MySQL – How to encrypt backups?
Data has to be protected, this is quite clear. We protect the data by implementing firewalls, defining user privileges, roles, setting up an encryption of the data at rest and in transit. What is important to keep in mind is that the backups also have to be protected. If you create a logical backup of
- MySQL
MySQL – How to backup the database?
In one of the previous blog posts we have discussed what are the types of backup that you can use with MySQL. We have taken a look at the different backup methods. What we haven’t done is to show how to backup MySQL. This blog will focus solely on the backup process. Again, we are
- MySQL
MySQL Architecture – Sharding – How to approach sharding?
In the previous blog post we have started to look at the sharding in MySQL. We have discussed why someone may want to pursue sharding and when it’s a good time for that. In this blog post we will talk about different approaches to sharding. What are the different methods in which you can shard
- MySQL
MySQL – What are backup solutions for MySQL?
Most of you are probably aware of the simple fact that the database backups are quite useful. If it happens that someone forgets a WHERE clause in an UPDATE query, backups may be the way to recover your business. Let’s just assume that we do not need to explain “why?” we should take backups, let’s
- MySQL
MySQL Architecture – Sharding – Why shard MySQL database?
With this blog post we would like to start a small series that will focus on sharding in MySQL. If you wonder, should you shard your data? At which point it is a necessity? What are the approaches to sharding the data? How to build the sharded environment? How to design it to minimize the
- Galera
Galera – Limitations of Galera Cluster compared to standalone MySQL
Galera is a quite useful piece of technology that allows us to build highly available database clusters. This is one of the reasons why we are hearing questions about it a lot during our MySQL consulting activities. If you wonder what it is, we have an introductory post that explains basic concepts and features of
- Galera
How to deploy a two-node Galera cluster?
Galera cluster, be it MariaDB Cluster, Percona XtraDB Cluster or Galera Cluster from Codership uses quorum calculations to make sure the data consistency is safe in case of a split-brain and that the majority of the nodes will continue to operate while nodes that are in the minority will stop executing changes. We have discussed
- MySQL
MySQL – How to rename a database?
In one of the recent blog posts we have discussed how to rename a table in MySQL. Another common question is: how to rename a database? Let’s say we have one database with one table in it: mysql> use sbtest; Reading table information for completion of table and column names You can turn off this
- Vitess
Vitess – How to use vtexplain tool in Vitess?
Vitess attempts to be as transparent for the user as possible. As you may imagine, for a platform that supports sharding, this is not the easiest thing to do. There are quite a few factors you should consider when planning the execution of the queries. Indexes, sharding design, how to aggregate cross-shard data and so
- MySQL
MySQL – How to rename a table?
In this short blog post we will take a look at how to rename a table in MySQL. Sounds fairly simple, but we’ll try to dig a little deeper under the surface. How to rename a table in MySQL? As for the table, the solution is very simple: mysql> USE sbtest; Reading table information for
- Vitess
Vitess – Sharding example using Sysbench-TPCC schema
In previous blog posts we have looked at how to migrate TPCC-like schema that has been created using SysBench. Now, we have it in our Vitess cluster and we would like to take it a next step further and see how it can be sharded. Analysing the schema and queries The first step that we
- MySQL
How to create a database in MySQL?
This is another short blog where we try to answer questions commonly asked (at least per Google) by MySQL users. Today we will take a look at the following question: how to create a database in MySQL? What is a database in MySQL? First of all, the question is – what is a database in
- Vitess
Vitess – How to migrate into Vitess? External vttablet
In the previous blog in our Vitess series we have explained how to migrate your data into Vitess cluster using logical backup and then keep it in sync for the period of testing using asynchronous replication. Let’s try something similar but a bit different this time. We are going to use a nice feature of
- MySQL
MySQL – How to change the root password?
One of the most common questions according to Google is how to change the root password in MySQL. This blog is an attempt to answer this question. We will try to consider different scenarios that you may encounter in real life – how to change passwords in general, if you know it and, which is
- Vitess
Vitess – How to migrate into Vitess? Replication
In the previous couple of blogs we have been looking at the basic scaling options in Vitess. We have added replicas, sharded our data, created custom shards and many more. In this blog we would like to start a new series, learning more about how the application interacts with Vitess, how to identify performance issues,
- Galera
Galera – How To Avoid SST?
State transfer – SST or IST Let’s start by discussing what SST is and why we may want to avoid it if possible? We are not going into details regarding different types of state transfer methods in Galera. What should suffice to say is that there are two types – Incremental State Transfer (IST) and
- MySQL
MySQL – How to configure clone plugin for SSL?
As we have mentioned in one of our previous blog posts, clone plugin is a nice addition to MySQL as it allows users to easily provision nodes with data while not even leaving MySQL CLI. In the previous blog we have explained how to provision a new node to join the MySQL replication cluster. We
- MySQL
MySQL – How to install and use clone plugin?
For ages MySQL was lacking an ability to provision new instances with data, at least for the community builds. Well, technically there always was mysqldump but let’s forget about using it on any kind of scale. It’s too slow to be used in most of the real world scenarios. Finally, Oracle added a ‘clone’ plugin
- Vitess
Vitess – New patch release (v12.0.1) with Apache Log4j patch
Today’s blog is a short but quite important one. As you might be aware, a new vulnerability has been identified in Apache Log4j, a Java library intended to create error logs in the applications. It has been assigned CVE CVE-2021-44228. The issue itself is quite serious, remote code execution through properly crafted log messages with
- Galera
Galera – How to calculate the quorum?
As we have discussed in one of previous blogs, Galera uses a concept of quorum to determine if a given node is a part of the cluster and can proceed with handling the traffic or is it partitioned and should cease any operations. We have briefly touched how the quorum is calculated but we haven’t
- Galera
Galera – How to add a Galera node to the cluster?
Galera Cluster is a very useful flavour of MySQL with its strengths in High Availability and easiness of provisioning new nodes and keeping the existing nodes in sync. We have a couple of blog posts covering different features of the Galera cluster. Quite common question we hear is: how to add a new Galera node
- Galera
MySQL Architecture – What to use? MySQL replication or Galera Cluster?
In the past we have written blogs discussing MySQL asynchronous replication and providing basic insights into Galera Cluster. MySQL replication is a well-known, battle-tested solution but also Galera Cluster is a mature, well-tested product. We are quite frequently asked: which one should I choose? Would Galera Cluster work better for me than MySQL replication? This
- MySQL
How to create a user in MySQL?
One of the most commonly asked, MySQL-related questions according to Google, is: “How to create a user?” We would like to answer this question in this short blog post. So, how to do it? Of course, there are many software tools that can make it easier for you, for example MySQL Workbench, we will focus
- Vitess
Vitess – How to upgrade Vitess Cluster?
Quite recently we have seen the release of a new Vitess version (v12.0.0) and this may lead to some questions – how to upgrade your Vitess installation when you use the Kubernetes and Vitess operator? In this blog post we would like to show the upgrade process of a simple Vitess cluster. There are several
- MySQL
MySQL Architecture – When to use MySQL replication?
While working with customers, performing MySQL consulting and discussing architecture, we quite frequently are being asked a very important question. Which MySQL flavour we should use? What are the pros and cons of using MySQL replication, Galera Cluster or InnoDB Cluster? This is definitely a complex question but we thought we could prepare a couple
- Galera
Galera Cluster – Understanding the network latency impact
As we have discussed in one of our previous blog posts, Galera is sensitive to network latency. This discussion also comes up quite often in our MySQL consulting engagements. We have thought that it might be interesting to take a look at this in more detail and show you what kind of impact it has.
- Vitess
Vitess – Merging the shards
In the last blog we have split one shard into several smaller ones, to accommodate a significant increase of load on one of the accounts. In this blog we are going to pretend that this condition no longer exists and we want to bring the cluster back to its original shape. If you would like
- Vitess
Vitess – Sharding the shard
In the last blog we ended up with three shards for our newsbtest keyspace. This is great but let’s assume that we quickly have noticed that our problem has not disappeared. One of the shards is generating the majority of the load and it impacts the whole application. How can we deal with such issue?
- Galera
Galera Cluster – what is it?
MySQL comes in different shapes and sizes. Asynchronous replication, semisynchronous replication, NDB Cluster, Galera Cluster, InnoDB Cluster. We are not even mentioning MariaDB as a separate entity. One of the common questions we hear when delivering MySQL consulting is: what should I use? What are the differences between X and Y? This blog post is
- Vitess
Vitess – Shard the keyspace
Let’s say that we are running out of the write capacity in my primary database. In more simple words, our application executes such a number of writes per second that the database is not able to deal with them. It can be the replication (even multithreaded) that becomes the bottleneck, it can be just a
- Vitess
Vitess – New keyspace and xtrabackup
Last time we ended up with scaling the ‘sbtest’ keyspace up and down. We have also discussed how we can monitor the state of the replication between primary vttablet and replicas. Let’s continue by adding another keyspace to the mix. If you would like to follow our steps you can clone this repository: vitesstests Adding
- Vitess
Vitess – Scaling keyspace up and down
We left our cluster while sysbench was loading the data into the Vitess. This process may take a bit of time, let’s start this blog by discussing what we can do to monitor the status of the process. If you would like to follow our steps you can clone this repository: vitesstests Monitoring the replication
- Vitess
Intro to Vitess
Database landscape changed quite rapidly in the last couple of years. In the past the typical setup that we have seen was the database cluster. It could have been a standard, asynchronous replication-based cluster. It could have been a more cluster-aware solution like Galera. We are mentioning here solutions related to MySQL but this trend
- Vitess
Vitess – deploying a cluster
Step-by-step guide to deploying a Vitess cluster on a clean Kubernetes environment.