All Products
Search
Document Center

Hologres:Use Holo Client to read and write data

Last Updated:May 20, 2024

This topic describes how to use Holo Client.

Overview of Holo Client

As your business develops, the size of your business data may rapidly increase. To help with data management, the Hologres team develops Holo Client based on Java Database Connectivity (JDBC). Holo Client allows you to write large amounts of data to Hologres in batches or in real time. Holo Client also allows you to perform point queries based on association with dimension tables with high queries per second (QPS).

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 supports multiple programming languages such as Java, C, and Go to improve development convenience.

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.