PlanetScaleDB is a sharded database built on Vitess. Learn key sharding concepts and apply them using our quickstart demo and sample app for rating puppies written in Rust.
Recently I posted about checkpointing in MySQL, where MySQL showed interesting “wave” behavior.
Soon after Dimitri posted a solution with how to fix “waves,” and I would like to dig a little more into proposed suggestions, as there are some materials to process.
This post will be very heavy on InnoDB configuration, so let’s start with the basic configuration for MySQL, but before that some initial environment.
I use MySQL version 8.0.21 on the hardware as described here.
As for the storage, I am not using some “old dusty SSD”, but production available Enterprise-Grade Intel SATA SSD …
[Read more]This is the announcement blogpost and this is my overview taken from medium:
The one where MySQL 8.0 lands on Google Cloud SQL
Ada Doglace and Lily Grace (lilygrams). Photo by Anthony Ferrara.
There are many things that makes me happy. Puppies (see picture), food, wine and databases… (not particularly in that order). And things that makes me even happier such as a well designed schema and proper usage of ORM (Object Relational Mapping).
MySQL was the database I used to love to hate. It grew on me and the fact that long strides were made to make it more consistent and more modern kept me away from …
[Read more]InnoDB ReplicaSet was introduced from MySQL 8.0.19. It works based on the MySQL asynchronous replication. Generally, InnoDB ReplicaSet does not provide high availability on its own like InnoDB Cluster, because with InnoDB ReplicaSet we need to perform the manual failover. AdminAPI includes the support for the InnoDB ReplicaSet. We can operate the InnoDB ReplicaSet using the MySQL shell.
- InnoDB cluster is the combination of MySQL shell and Group replication and MySQL router
- InnoDB ReplicaSet is the combination of MySQL shell and MySQL traditional async replication and MySQL router
Why InnoDB ReplicaSet?
- You can manually perform the switchover and failover with InnoDB ReplicaSet
- You can easily add the new node to your replication environment. InnoDB ReplicaSet helps with data provisioning (using MySQL clone plugin) and setting up the replication.
In this …
[Read more]Presentation of some of the new features of MySQL 8.0.21 released on July 13th, 2020.
The post MySQL 8.0.21 New Features Summary first appeared on dasini.net - Diary of a MySQL expert.
PMM (Percona Monitoring and Management) is a great community tool for monitoring your OSDB (MySQL, PostgreSQL, MongoDB) fleet. It’s feature rich, and it’s built and distributed as open-source based on several de-facto industry standard tools such as Grafana and Prometheus. In the second half of last year, major version 2 was released and whereas the major components remained mostly the same, some significant architectural changes were made, but this is out-of-scope for this post.
Upgrading to PMM2 is basically the same as starting from scratch with a fresh install; it requires re-adding all your servers, which can be a painful process if you have a large fleet of instances. For servers where you have OS level access, you can just install the PMM2 agent, but for RDS there is no access to the OS so another approach is required. In this blog, I will focus on getting a large number of RDS instances added.
Adding RDS instances …
[Read more]Oftentimes, we need to replicate between Amazon Aurora and an external MySQL server. The idea is to start by taking a point-in-time copy of the dataset. Next, we can configure MySQL replication to roll it forward and keep the data up-to-date.
This process is documented by Amazon, however, it relies on the mysqldump method to create the initial copy of the data. If the dataset is in the high GB/TB range, this single-threaded method could take a very long time. Similarly, there are ways to improve the import phase (which can easily take 2x the time of the export).
Let’s explore some tricks to significantly improve the speed of this process.
Preparation Steps
The first step is to enable binary logs in Aurora. Go to the Cluster-level parameter group and make sure binlog_format …
[Read more]VIEWs have been a handy feature of MySQL for many years but do you know about the WITH CHECK OPTION clause? The WITH CHECK OPTION clause is used for a updatable views to prohibit the changes to those views that would produce rows which are not included in the defining query.
VIEW Definition Since a lot of SQL
novices read my blog, I'd like to start with the definition of a
view "Views are stored queries that when invoked produce a
result set. A view acts as a virtual table" according the
MySQL Manual.
SQL > CREATE VIEW
x_city AS
SELECT
Name,
…
So you need to build a new set of databases, perhaps in a new location or geographical zone and the business wants it done yesterday cause the newly launched product hit the front page of hacker news and your website … Continue reading →
Question: Hey, I got a UNIQUE INDEX, but I can store multiple rows with the same value, NULL. That is surprising. Is that a bug?
This is a rewrite of the same in German from 9 years ago.
root@localhost [kris]> create table t ( a integer, b integer, unique (a,b));
Query OK, 0 rows affected (0.09 sec)
root@localhost [kris]> insert into t values (1, 2);
Query OK, 1 row affected (0.01 sec)
root@localhost [kris]> insert into t values (1, 2);
ERROR 1062 (23000): Duplicate entry '1-2' for key 't.a'
This does not work, as expected. But this does:
root@localhost [kris]> truncate table t;
Query OK, 0 rows affected (0.16 sec)
root@localhost [kris]> insert into t values ( 1, NULL);
Query OK, 1 row affected (0.02 sec)
root@localhost [kris]> insert into t values ( 1, NULL);
Query OK, 1 row affected (0.03 …
[Read more]