Most users of MySQL utilize the mysqldump utility to backup their database. While mysqldump is handy and easy-to-use (and free), if you have data which is important to your business, then you should take a look at the MySQL Enterprise Edition – and use MySQL Enterprise Backup instead. The MySQL Enterprise Backup allows you to backup your database without the table locking you get with mysqldump. And, it is extremely fast – especially when you have to restore your database. Here is a sample speed comparison between MySQL Enterprise Backup and …
[Read more]This post discusses archiving MySQL and MongoDB data, and determining what, when and how to archive data.
Many people store infrequently used data. This data is taking up storage space and might make your database slower than it could be. Archiving data can be a huge benefit, both regarding the performance impact and storage savings.
Why archive?
One of the reasons for archiving data is freeing up space on your database volumes. You can store archived data on slower, less expensive storage devices, and current data on the faster database drives. Archiving old data makes backups and restores run faster since they need to process less data. Last, but by no means least, archiving data has the benefit of making your queries perform more efficiently since they do not need to process through old …
[Read more]This blog compares how PostgreSQL and MySQL handle millions of queries per second.
Anastasia: Can open source databases cope with millions of queries per second? Many open source advocates would answer “yes.” However, assertions aren’t enough for well-grounded proof. That’s why in this blog post, we share the benchmark testing results from Alexander Korotkov (CEO of Development, Postgres Professional) and Sveta Smirnova (Principal Technical Services Engineer, Percona). The comparative research of PostgreSQL 9.6 and MySQL 5.7 performance will be especially valuable for environments with multiple databases.
The idea behind this research is to provide an honest comparison for the two popular RDBMSs. Sveta and Alexander wanted to test the most recent versions of both MySQL and PostgreSQL with the same tool, under the same challenging …
[Read more]MySQL has had a JSON data type since version 5.7 was released way back in '15. But did you know you could produce JSON output from non-JSON columns? It is very simple and saves a lot of time over trying to format it in your application.
World DatabaseWe will be using the good old World database that MySQL has used for years in documentation, examples, and in the classroom. Starting with a simple query we will build up to something more complex.
SELECT Name, District, Population FROM City;
This will output the data from the table in a tabular format.
'Kabul', 'Kabol', '1780000'
'Qandahar', 'Qandahar', '237500'
Array or Object?We have two options for composing JSON data: JSON_ARRAY and JSON_OBJECT.
Of the two, you will find JSON_ARRAY the least fussy. It will JSON-ize your data very easily. It takes a list of values or an empty list and returns a JSON array.
…[Read more]Why do we sometimes want to keep duplicate indexes?
I’ve done dutiful DBA work in the past to identify and remove what are commonly called duplicate indexes. That is, those indexes that look like (a) and (a,b). The thought is that a query will utilize an index as easily on (a) as on (a,b), and removing (a) will save storage cost and write performance. I’ve had the experience, though, of removing (a) and seeing performance tank.
(As an aside, these are really redundant indexes. A duplicate index would be (a,b) and (a,b) by two different names – this can commonly be done by object relational mapping (ORM) or other automated schema creation tools. I’ll call (a) and (a,b) redundant indexes below.)
This test is on Percona Server 5.7.14 with the sys schema installed and performance schema enabled.
Given two tables with the same number of rows and …
[Read more]Related resources Sharding MySQL with MySQL Fabric and ProxySQL MySQL Load Balancing with ProxySQL - an Overview How to set up read-write split in Galera Cluster using ProxySQL How ProxySQL adds Failover and Query Control to your MySQL Replication Setup Two Database Sharding Tools for MySQL
Having too large a (write) workload on a master is dangerous. If the master collapses and a …
[Read more]Related resources Sharding MySQL with MySQL Fabric and ProxySQL MySQL Load Balancing with ProxySQL - an Overview How to set up read-write split in Galera Cluster using ProxySQL How ProxySQL adds Failover and Query Control to your MySQL Replication Setup Two Database Sharding Tools for MySQL
Having too large a (write) workload on a master is dangerous. If the master collapses and a …
[Read more]We’ve been having a problem with MySQL replication at VividCortex. Replicas periodically tend to fall behind and we couldn’t really figure out how to speed things up. It wasn’t about resources. The replicas have plenty of CPU and I/O available. We’re also using multithreaded replication (a.k.a. MTR) but most of the replication threads were idle.
One thing that we decided to try out was the new
LOGICAL_CLOCK parallelization policy introduced in
MySQL 5.7.2. Here’s what the MySQL reference manual says about
slave-parallel-type:
When using a multi-threaded slave
(slave_parallel_workers is greater than 0), this
option specifies the policy used to decide which transactions are
allowed to execute in …
Today’s blog post is related again to MySQL Group Replication.
By default MySQL Group Replication runs in Single-Primary mode. And it’s the best option and the option you should use.
But sometimes it might happen that in very specific cases you would like to run you MGR Cluster in Multi-Primary mode: writing simultaneously on all the nodes member of the Group.
It’s of course feasible but you need to make some extra verification as not all workload are compatible with this behavior of the cluster.
Requirements
The requirements are the same as those for using MGR in Single-Primary mode:
- InnoDB Storage Engine
- Primary Keys
- IPv4 Network
- Binary Log Active
- Slave Updates Logged
- Binary …
This post discusses enabling and disabling jemalloc on Percona Server for MySQL.
The benefits of jemalloc versus glibc for use with MySQL have been widely discussed. With jemalloc (along with Transparent Huge Pages disabled) you have less memory fragmentation, and thus more efficient resource management of the available server memory.
For standard installations of Percona Server 5.6+ (releases starting with 5.6.19-67.0), the only thing needed to …
[Read more]