# tidb-cloud-manager

TiDB Cloud Manager works with TiDB Operator. It provides a RESTful API for easy integration with public/private cloud to provide DBaaS (Database as a Service).

## Work flow

When integrated with cloud console, users create TiDB cluster by filling some forms. And tidb-cloud-manager will create a `TidbInstance` CRD (Custom Resource Definition).

tidb instance controller will periodically synchronize `TidbInstance` to `TidbCluster` CRD. After the tidb cluster is created by tidb-operator, tidb instance controller will create a job to set TiDB root password. After password is set successfully, tidb instance controller will set `TidbInstance` CRD status to `initialized`. And then cloud console will show TiDB service load balancer endpoint. User can access TiDB service using load balancer endpoint with password.

The main management of tidb cluster is handled by tidb-operator. But tidb-cloud-manager also provides some other useful RESTful APIs:

* password management: set and reset password.
* volume management: query PV status, safely remove PVs.
* cluster member management: safely remove members.
* TiDB cluster backup: logic backup using [mydumper](https://github.com/maxbube/mydumper).
* restore cluster when cluster is accidentally deleted within a given time.

## Use cases

We've cooperated with [Tencent Cloud](https://cloud.tencent.com/product/tidb), [UCloud](https://www.ucloud.cn/site/product/cloudtidb.html), [JD Cloud](https://www.jdcloud.com/products/tidb). They use tidb-cloud-manager RESTful APIs to integrate with their cloud console.
