The write efficiency of TiDB 7.5.0 is not as fast as MySQL 8.0.35

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb7.5.0 写入效率没有mysql8.0.35快

| username: 谢斌1204

Today, using sysbench to generate 20 tables with 10 million rows each, it takes about 7 minutes per table for TiDB and about 5 minutes per table for MySQL.

| username: 路在何chu | Original post link

This test is meaningless. Configuration will affect the results, and the sample size is too small to draw any conclusions.

| username: 啦啦啦啦啦 | Original post link

What is TiDB 5.7.0? There isn’t such a version, right? Also, TiDB is a distributed database. How is the cluster configured?

| username: zhanggame1 | Original post link

First, let’s look at the hardware configuration. We don’t even know the environmental differences.

| username: 谢斌1204 | Original post link

All hardware configurations are just virtual machines (clones).

| username: 谢斌1204 | Original post link

7.5.0 typed incorrectly.

| username: zhanggame1 | Original post link

3 TiKV nodes?

| username: 谢斌1204 | Original post link

Hmm!!

| username: 小龙虾爱大龙虾 | Original post link

Distributed systems have relatively high hardware requirements. Distributed systems generally have longer links, and a single link cannot compare to centralized systems, but multiple machines can achieve higher throughput.

| username: zhanggame1 | Original post link

If TiDB uses the same physical machine to run multiple TiKV instances, the I/O performance will drop significantly.

| username: 像风一样的男子 | Original post link

Comparing distributed databases and single-node databases is not very meaningful; in the same single-node environment, MySQL’s performance is definitely higher than TiDB’s. TiDB’s advantage lies in its scalability.

| username: wangccsy | Original post link

Try version 7.5.

| username: Kongdom | Original post link

:joy: Pay attention to the question, it was tested with 7.5.

| username: kelvin | Original post link

Each has its own advantages, depending on the needs.

| username: Kongdom | Original post link

:thinking: Performance cannot be discussed without considering configuration. Additionally, the applicable scenarios for the two other databases are different, and in some cases, they are indeed not as fast as MySQL.

| username: 这里介绍不了我 | Original post link

Treat it according to different scenarios, there are both advantages and disadvantages.

| username: Billmay表妹 | Original post link

You need to fully explain the background information before everyone can help you make a judgment. A single sentence is not enough to make a judgment.

| username: forever | Original post link

It would be best to share the topology. If it’s a single-machine deployment with multiple TiKV instances, several times the I/O will definitely be slow.

| username: 江湖故人 | Original post link

The network and disk I/O costs for single-machine and cluster writes are different, so it is normal to see discrepancies. You can try setting TiKV’s sync-log to false. By default, it is true, which means that a commit needs to wait for most nodes to succeed before returning an ACK to the client. Generally speaking, enabling sync-log results in about a 30% performance loss [1].

| username: Jayjlchen | Original post link

TiDB has a naturally high-availability architecture, which should be compared to MySQL’s MGR architecture. Additionally, you can add more TiDB servers and perform some TiKV parameter write tuning to avoid throttling.