Recently we upgrade our database cluster to version 8.x .
Read this PDF to get some experience MySQL_8.x_upgrade
Recently we upgrade our database cluster to version 8.x .
Read this PDF to get some experience MySQL_8.x_upgrade
Connecteam is a SaaS company that provides an employee management solution for deskless teams. Over the last couple of years, we’ve been growing tremendously and we recently started to face one of the hardest technical challenges: horizontal scaling. In the era of cloud computing, provisioning new resources is a breeze, but handling those resources in an efficient manner and providing a five nines uptime while allowing a fast-paced development environment is not an easy undertaking.
As you know, MySQL 8.0 can be used as JSON Document Store to store your documents without being linked to any schema. You can also use CRUD operations to deal with these documents using the MySQL X DevAPI.
Of course in documents, it’s possible to also store temporal attributes like date, time, datetime, …
Let’s see how we can deal with such attributes.
This is an example of a collection of documents with a datetime
attribute createdOn:
As those attributes don’t have a real type, can we use the
createdOn attribute as if it was a real datetime
field ?
Let’s try to get all the documents have a created data >
'2021-12-02':
We can see that the document “dave” has been filtered out. However, we can see that “kenny” and “miguel” are also present… and this is correct as …
[Read more]For a long time, MyDumper has been in Max Bubenick’s personal GitHub repository. Now, we decided to move to a new MyDumper’s Organization as requested earlier this year by a user from the community.
There were also two other reasons why we decided to move it. The first one is related to how the project is evolving, and the second is that it will allow us to implement integrations to other projects.
We can see the evolution of the project, noting the increase in commits of the last year:
We tried to keep the release cycle every two months, focusing on closing as many bugs as possible and implementing new features requested. It was not an easy task, as lots of changes had to be implemented in mydumper and myloader engine to allow the new features to be developed.
…[Read more]AWS has just announced the general availability of Aurora MySQL 8 compatibility (known as Aurora Version 3). This is long awaited addition to RDS MySQL 8 and provides many of the new features that can be found in the open-source MySQL 8 community version.
For those unfamiliar with Amazon Aurora my Understanding AWS RDS Aurora Capabilities presentation from Percona Live 2021 provides a great introduction of the benefits of this managed service.
There is a lot to digest and the …
[Read more]
MySQL 8.0.27 introduced a new variable to
control the maximum of parallel threads InnoDB can use for
creating (sorting and building) secondary indexes: innodb_ddl_threads.
This new variable is coupled with another new variable:
innodb_ddl_buffer_size.
If you have fast storage and multiple CPU cores, tuning these variables can speed up secondary index creation.
For this example, I used the airportdb database, and I added a
secondary index to the largest table, booking.
Let’s start with the default settings:
SQL alter table booking …[Read more]
Working on a real case scenario in a five node Percona XtraDB Cluster (PXC), we were forced to use wsrep_sync_wait = 1, because the app does reads-after-write and we send reads to all the nodes. We had the idea to leave some nodes in DESYNC mode to reduce the flow control messages during peak load and expected to have a steadier write throughput keeping the read consistency.
We decided to test Perconas’s new PXC Scheduler Handler which is an application that manages integration between ProxySQL and Galera/PXC (the scope is to maintain the ProxySQL mysql_server table, if a negative scenario occurs, like: failures, service degradation, and maintenance). However, we realized that when a node is in DESYNC mode, it is kicked out of the read hostgroup. That is …
[Read more]In reply to a question about how to conditionally drop an index on a table in MySQL. It appears the syntax doesn’t exist. However, maybe it does and I missed it. If I did miss it, I’m sure somebody will let me know. However, I simply have a dropIndexIfExists stored procedure for this type of database maintenance.
Below is my dropIndexIfExists stored procedure:
-- Conditionally drop the procedure.
DROP PROCEDURE IF EXISTS dropIndexIfExists;
-- Change the default semicolon delimiter to write a PSM
-- (Persistent Stored Module) or stored procedure.
DELIMITER $$
-- Create the procedure.
CREATE PROCEDURE dropIndexIfExists
( pv_table_name VARCHAR(64)
, pv_index_name VARCHAR(64))
BEGIN
/* Declare a local variable for the SQL statement. */
DECLARE stmt VARCHAR(1024);
/* Set a session variable with two parameter markers. */
SET @SQL := CONCAT('ALTER TABLE ',pv_table_name,'DROP INDEX ',pv_index_name);
/* Check if the constraint exists. …[Read more]
I was working through some tutorials for my students and noticed that there was a change in how a WHERE clause must be written against the information_schema.table_constraints table. It might have been made in an earlier release, I actually hadn’t checked it since 2014 when I wrote this early post on capturing MySQL Foreign Keys.
You could use the following WHERE case insensitive clause:
WHERE tc.constraint_type = 'foreign key'
Now, you must use a case sensitive WHERE clause:
WHERE tc.constraint_type = 'FOREIGN KEY'
I’d love to know why but I can’t seem to find a note on the change. As always, I hope this helps those looking for an answer.
A year ago, I blogged about An Unprivileged User can Crash your MySQL Server. At the time, I presented how to protect yourself against this problem without explaining how to generate a crash. In this post, I am revisiting this vulnerability, not giving the exploit yet, but presenting the fix. Also, because the default configuration of Group Replication in 5.7 is still vulnerable