ALTER PLACEMENT clause (#19065)
* ddl: check count here * ddl: drop all rules that will be overrided * ddl: change ID format * ddl: local placement deifinition * ddl: support `ALTER PLACEMENT` clause * ddl: add test cases * ddl: fix ID format * ddl: copy comments too * ddl: allow ignore replicas with dict constraints * ddl: rename COUNT to REPLICAS * ddl: clone method for RuleOp * ddl: checkPlacementSpec => buildPlacementSpec * ddl: remove TODO It is possible to incrementally add replicas. Consider drop later. Let us support it correctly first. * ddl: ID format Datbase/schema ID is added back. A common prefix will improve the efficience of PD batch operation. Drop a whole db/table will only need one loop for rules. * ddl: move const/util to placement package * ddl: fix test * ddl: fix format error * ddl: error check fix * ddl: use an explicit condition flag * ddl: adapt parser changes * ddl: fix go.mod/simplify code path * ddl: go mod tidy * ddl: improve tests * ddl: return new rules instead of appending * ddl: return constraints instead of appending * ddl: fix test * ddl: one more test * ddl: remove rules rollback, meaningless * ddl: fix slice * ddl: add period to comments * Update ddl/ddl_api.go Co-authored-by: tangenta <tangenta@126.com> * ddl: remove unused arguments * infosync: do not request PD if no ruleOperations * ddl: a new test suite Co-authored-by: tangenta <tangenta@126.com> Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
- Slack Channel
- Twitter: @PingCAP
- Mailing list: Google Group
- Blog
- For support, please contact PingCAP
What is TiDB?
TiDB ("Ti" stands for Titanium) is an open-source NewSQL database that supports Hybrid Transactional and Analytical Processing (HTAP) workloads. It is MySQL compatible and features horizontal scalability, strong consistency, and high availability.
-
Horizontal Scalability
TiDB expands both SQL processing and storage by simply adding new nodes. This makes infrastructure capacity planning both easier and more cost-effective than traditional relational databases which only scale vertically.
-
MySQL Compatible Syntax
TiDB acts like it is a MySQL 5.7 server to your applications. You can continue to use all of the existing MySQL client libraries, and in many cases, you will not need to change a single line of code in your application. Because TiDB is built from scratch, not a MySQL fork, please check out the list of known compatibility differences.
-
Distributed Transactions with Strong Consistency
TiDB internally shards table into small range-based chunks that we refer to as "regions". Each region defaults to approximately 100MiB in size, and TiDB uses a Two-phase commit internally to ensure that regions are maintained in a transactionally consistent way.
-
Cloud Native
TiDB is designed to work in the cloud -- public, private, or hybrid -- making deployment, provisioning, operations, and maintenance simple.
The storage layer of TiDB, called TiKV, became a Cloud Native Computing Foundation member project in 2018. The architecture of the TiDB platform also allows SQL processing and storage to be scaled independently of each other in a very cloud-friendly manner.
-
Minimize ETL
TiDB is designed to support both transaction processing (OLTP) and analytical processing (OLAP) workloads. This means that while you may have traditionally transacted on MySQL and then Extracted, Transformed and Loaded (ETL) data into a column store for analytical processing, this step is no longer required.
-
High Availability
TiDB uses the Raft consensus algorithm to ensure that data is highly available and safely replicated throughout storage in Raft groups. In the event of failure, a Raft group will automatically elect a new leader for the failed member, and self-heal the TiDB cluster without any required manual intervention. Failure and self-healing operations are also transparent to applications.
For more details and latest updates, see official TiDB blog.
Quick start
See Quick Start Guide, which includes deployment methods using TiUP, Ansible, Docker, and Kubernetes.
To start developing TiDB
The community repository hosts all information about the TiDB community, including how to contribute to TiDB, how TiDB community is governed, how special interest groups are organized, etc.
Contributions are welcomed and greatly appreciated. See CONTRIBUTING.md for details on submitting patches and the contribution workflow. For more contributing information, click on the contributor icon above.
Adopters
View the current list of in-production TiDB adopters here.
Roadmap
Read the Roadmap.
Getting Help
Documentation
Architecture
License
TiDB is under the Apache 2.0 license. See the LICENSE file for details.


