# In TiDB Cloud TiProxy is Optional
![`smart`](TiDBCloudProviderRegionDataEncryption02_en_003_20230925.png)
------------------------------------------------------------------------------
TiProxy is a database proxy that is based on TiDB. It keeps client connections alive while the TiDB server upgrades, restarts, scales in, and scales out.

When conducting rolling upgrades or scale-in on `TiDB Serverless/Dedicated` with `TiProxy`, it will be carried out during a customer defined maintenance window. There is a possibility that the connections with long-running transactions may be interrupted by `TiProxy`.
- If a transaction completes within 30 seconds, the database client connections will not be aware of the scaling-in process of TiDB server instances.
- If a transaction exceeds a duration of 30 seconds, it will be automatically rolled back.

For more information about TiDB auto scaling-in, scaling out, and upgrade, you may refer to the following blogs and videos.
- Achieving Zero-Downtime Upgrades with TiDB `https://www.pingcap.com/blog/achieving-zero-downtime-upgrades-tidb/`
- Achieving Zero Downtime During Online Upgrade `https://www.youtube.com/watch?v=HLrIwbMgOhg`
- TiDB Auto Scaling: Why Distributed SQL for Cloud-Native Applications `https://www.pingcap.com/blog/tidb-auto-scaling-distributed-sql-cloud-native-apps/`
- TiDB Cluster Auto Scaling-in/out `https://www.youtube.com/watch?v=5W0Q72UB0Ks`

There are no missing pieces when it comes to encryption, even for communication between the TiDB server and TiKV server components, as it is already secured by encryption during transit by default.

The TiDB cluster is deployed across three availability zones (AZs), and the data on TiKV is replicated using the Raft consensus algorithm across these AZs, making it capable of disaster recovery. Additionally, ensuring availability is important for maintaining overall security.

The TiProxy component is optional; customers can request to have it enabled or disabled by submitting a support ticket. It is marked by a dotted box.