| title | Connect to Your {{{ .starter }}} or Essential Cluster |
|---|---|
| summary | Learn how to connect to your {{{ .starter }}} or {{{ .essential }}} cluster via different methods. |
This document describes how to connect to your {{{ .starter }}} or {{{ .essential }}} cluster.
Tip:
- To learn how to connect to a TiDB Cloud Dedicated cluster, see Connect to Your TiDB Cloud Dedicated Cluster.
- This document focuses on the network connection methods for {{{ .starter }}} and {{{ .essential }}}. To connect to TiDB via a specific tool, driver, or ORM, see Connect to TiDB.
After your {{{ .starter }}} or {{{ .essential }}} cluster is created on TiDB Cloud, you can connect to it via one of the following methods:
-
Direct connections
Direct connections mean the MySQL native connection system over TCP. You can connect to your cluster using any tool that supports MySQL connection, such as MySQL client.
-
TiDB Cloud provides a Data Service feature that enables you to connect to your {{{ .starter }}} cluster hosted on AWS via an HTTPS request using a custom API endpoint. Unlike direct connections, Data Service accesses your cluster data via a RESTful API rather than raw SQL.
-
TiDB Cloud provides a serverless driver for JavaScript, which allows you to connect to your {{{ .starter }}} or {{{ .essential }}} cluster in edge environments with the same experience as direct connections.
In the preceding connection methods, you can choose your desired one based on your needs:
| Connection method | User interface | Scenario |
|---|---|---|
| Direct connections | SQL/ORM | Long-running environment, such as Java, Node.js, and Python. |
| Data Service | RESTful API | All browser and application interactions. |
| Serverless Driver | SQL/ORM | Serverless and edge environments such as Vercel Edge Functions and Cloudflare Workers. |
There are two network connection types for {{{ .starter }}} and {{{ .essential }}}:
-
Private endpoint (recommended)
Private endpoint connection provides a private endpoint to allow SQL clients in your VPC to securely access services over AWS PrivateLink, which provides highly secure and one-way access to database services with simplified network management.
-
The standard connection exposes a public endpoint, so you can connect to your TiDB cluster via a SQL client from your laptop.
{{{ .starter }}} and {{{ .essential }}} require TLS connections, which ensures the security of data transmission from your applications to TiDB clusters.
The following table shows the network you can use in different connection methods:
| Connection method | Network | Description |
|---|---|---|
| Direct connections | Public or private endpoint | Direct connections can be made via both public and private endpoints. |
| Data Service (beta) | / | Accessing {{{ .starter }}} hosted on AWS via Data Service (beta) does not need to specify the network type. |
| Serverless Driver (beta) | Public endpoint | Serverless Driver only supports connections via public endpoint. |
After you have successfully connected to your TiDB cluster, you can explore SQL statements with TiDB.