Questions about the Minimum Topology in Production Environment

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

Original topic: 生产环境最小拓扑疑问

| username: 啦啦啦啦啦

[TiDB Usage Environment] Production Environment
[Encountered Problem: Problem Phenomenon and Impact]
Generally, having two TiDB server nodes can ensure high availability. Why does the official website recommend a minimum topology architecture with 3 TiDB nodes?

| username: ealam_小羽 | Original post link

I am wondering if it might be an issue with leader election. If there are only two nodes, once a network partition occurs, both nodes will consider themselves as the leader. After the network is restored, it will be difficult to determine which one should be the leader. With three nodes, the majority can decide the leader. Most systems that require leader election generally have an odd number of nodes rather than an even number.

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

It is said that the TiDB server is stateless and there is no concept of a master node, except when executing DDL where there might be an owner. I noticed that in the recently launched Aliyun’s cloud TiDB, the TiDB server has at least 2 nodes.

| username: ealam_小羽 | Original post link

Oh, I misunderstood. I thought you were talking about the whole thing, but you were only referring to the TiDB Server. This indeed should be stateless and can be scaled freely.

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

Yes, so I think the minimum configuration for a production environment should be 2 TiDB, 3 PD, and 3 TiKV. The documentation mentions 3 TiDB, but I’m not sure what the reasoning behind that is.

| username: h5n1 | Original post link

Two for business use, the remaining one can be used for operations as needed.

| username: Billmay表妹 | Original post link

Are you trying to understand why TiDB requires at least 3 instances?

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

Yes, since it is the minimum topology, I think having 2 TiDB server nodes is sufficient for a production environment. I don’t understand why at least 3 are required.

| username: srstack | Original post link

The minimum production topology here seems to have an issue :hushed: If there is a TiFlash, it can be understood as a separate TiDB dedicated to running AP business.

| username: xingzhenxiang | Original post link

I feel that testing TiDB can be scaled down to a single stateless node.

| username: xingzhenxiang | Original post link

| username: Billmay表妹 | Original post link

It seems there is a conflict with the description above. I will consult your company’s development team on the intranet.

| username: Billmay表妹 | Original post link

The default value of tidb_gc_life_time is 10m, which means that the data deleted within 10 minutes can be recovered. If the data was deleted more than 10 minutes ago, it cannot be recovered.

| username: h5n1 | Original post link

The image is not visible. Please provide the text you need translated.

| username: Billmay表妹 | Original post link

Thanks to Chaochao for the feedback. There are indeed some descriptions here that are not very accurate. A related PR has been submitted for optimization. You can see the specific progress here: *: update tidb minimal topology from 3 to 2 by ran-huang · Pull Request #12953 · pingcap/docs-cn · GitHub

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

It should be possible to accept the deployment of 1tidb.

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

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.