Is it better to connect read and write operations to the same TiDB or different TiDB instances, and is there a difference?

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

Original topic: 读写连接同一个tidb好,还是连接不同的tidb好,这块有区别吗?

| username: TiDBer_oHSwKxOH

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] 7.3
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots / Logs / Monitoring]
Is it better to connect read and write operations to the same TiDB instance, or to different TiDB instances? Is there a difference in this regard?

| username: zhanggame1 | Original post link

Short connections don’t matter, but long connections will definitely be fixed on one TiDB.
Read-write separation is also possible.

| username: Kongdom | Original post link

If resources are sufficient, read-write separation is definitely better.

| username: TiDBer_oHSwKxOH | Original post link

The reason for master-slave separation is that a monolithic database cannot handle double writes.

| username: TiDBer_oHSwKxOH | Original post link

There are some points I didn’t consider. If there is a big data team, you can consider read-write separation, directing all AP queries to the same TiDB and setting the engine to TiFlash.

| username: TiDBer_oHSwKxOH | Original post link

There are some points I didn’t consider. If there is a big data team, you can consider read-write separation, directing all AP queries to the same TiDB and setting the engine to TiFlash.

| username: 有猫万事足 | Original post link

Yes, the advantage of this is that even if your AP business is completely down, it will not affect the TP business.

| username: tidb狂热爱好者 | Original post link

Reply to avoid missing the daily check-in.

| username: redgame | Original post link

Connecting to different TiDB instances is good.

| username: zhimadi | Original post link

Doesn’t the official recommendation suggest using HAProxy?

| username: tidb菜鸟一只 | Original post link

It’s definitely better to be different.

| username: TiDBer_E7MM03rf | Original post link

Check-in to avoid breaking the streak.

| username: tidb狂热爱好者 | Original post link

Reply to avoid missing the daily check-in.

| username: TiDBer_vfJBUcxl | Original post link

Connecting to different TiDB instances is good.

| username: zhanggame1 | Original post link

It’s best to use load balancing and not worry about this issue.

| username: 昵称想不起来了 | Original post link

If resources are sufficient, separation is definitely better. If resources are insufficient, remember that the official team previously released a method for implementing SQL rule-based routing for separation.

| username: tidb狂热爱好者 | Original post link

Reply to avoid missing the daily check-in.

| username: Jellybean | Original post link

Best practice: separate instances if possible.

| username: TiDBer_vfJBUcxl | Original post link

If you can use load balancing, then use load balancing.

| username: cassblanca | Original post link

Isn’t automatic load balancing good?