Creating a connection to YDB from DataLens On-premises

Note

To write subqueries in datasets and queries in QL charts, use the YQL syntax.

To create a YDB connection:

  1. Go to the workbook page or create a new one.

  2. In the top-right corner, click CreateConnection.

  3. Select the YDB connection.

  4. Select the authentication type:

    • Host name: Specify the path to the YDB host.
    • Port: Specify the YDB connection port. The default port is 2135.
    • Path to database: Specify the database name.
    • Host name: Specify the path to the YDB host.
    • Port: Specify the YDB connection port. The default port is 2135.
    • Path to database: Specify the database name.
    • Username: Specify a username for the YDB connection.
    • Password: Specify a password for the user.
    • OAuth token: Specify an OAuth token to use with YDB.
    • Host name: Specify the path to the YDB host.
    • Port: Specify the YDB connection port. The default port is 2135.
    • Path to database: Specify the database name.
    • Cache TTL in seconds: Specify cache TTL or leave the default value. The recommended value is 300 seconds (5 minutes).
    • Raw SQL level: Enables you to use an ad-hoc SQL query to generate a dataset.
  5. Click Create connection.

  6. Enter a name for the connection and click Create.

Additional settings

You can specify additional connection settings under Advanced connection settings:

  • TLS: Indicates whether TLS is required. When this option is enabled, the connection requires using SSL.
  • CA Certificate: To upload a certificate, click Attach file and select the certificate file. When the certificate is uploaded, the field shows the file name.
RESOURCE_EXHAUSTED error

If the Managed Service for YDB quotas and limits are exceeded, you may get the RESOURCE_EXHAUSTED error message. To avoid the error, follow these recommendations:

  • Reduce the query rate. To achieve this, you can use filters or specify only the required chart fields to limit the amount of data you get.
  • Follow the recommendations for database query optimization.
  • Use the DataLens chart inspector to assess the data amount and upload time.
  • Check the Managed Service for YDB monitoring charts for exceeded quotas and limits. If you need to, you may slightly increase the throughput capacity (request units) limit under Limits.