All Products
Search
Document Center

Hologres:Use Holo Client to read and write data

Last Updated:Feb 19, 2024

Holo Client is a development interface developed for Hologres based on Java Database Connectivity (JDBC). Holo Client is applicable to writes of a large amount of data and point queries with high queries per second (QPS). For example, you can use Holo Client if you want to associate with dimension tables for queries or synchronize data to Hologres in batches or in real time. This topic describes how to use Holo Client.

Features of Holo Client

Holo Client provides the following features:

  • Holo Client automatically collects data in batches. This feature allows you to write large amounts of data in batches or in real time with high performance, and perform point queries, DELETE operations, and UPDATE operations with high QPS based on primary keys. However, we recommend that you still use JDBC to perform online analytical processing (OLAP) queries.

  • Holo Client automatically writes data to the corresponding partitions. This way, you do not need to create partitions in advance.

  • Holo Client supports the subscription to Hologres binary logs. This feature is also supported by JDBC and allows data to be consumed in real time.

Holo Client is not developed to replace JDBC. You can use Holo Client for new features that are not supported by JDBC. In scenarios in which JDBC is applicable, we recommend that you still use JDBC for data queries.

Use Holo Client

  • Holo Client is open sourced. For more information about how to use Holo Client, see holo-client on GitHub.

  • All Holo Client versions are published in a Maven repository that is accessible from the Internet. For more information about Holo Client versions, see holo-client.

FAQ

  • Problem description:

    The latency is high when I execute the SQL statement select hologres.hg_internal_refresh_meta(xxx);.

  • Cause:

    Holo Client uses the hg_internal_refresh_meta function to obtain the metadata of the tables in the instance. If frequent data definition language (DDL) operations are performed on the instance, this function does not return the result until the metadata version of the current node is updated. In this case, the execution of the SQL statement is time-consuming.

  • Solution:

    In most cases, you do not need to pay special attention to the execution duration of the SQL statement. If a large number of such SQL statements are recorded in the slow query logs and the latency is high, DDL operations are frequently performed on the instance. In this case, we recommend that you reduce the frequency of DDL operations to prevent version inconsistency among nodes.