Apart from HTTP based query endpoint, Pinot also supports gRPC endpoint in broker.
Enable GRPC query entrypoint in broker
Add gRPC port config in pinot broker to enable the :
pinot.broker.grpc.port=8010
if you want to enable TLS, then use below configs:
pinot.broker.grpc.tls.enabled=true
pinot.broker.grpc.tls.port=8020
// Server side TLS is used. The client does not present a certificate.
// The server only verifies the client’s connection via its own certificate and doesn’t validate the client’s identity via TLS.
// Common in public APIs, where only the server needs to be trusted.
pinot.broker.grpctls.client.auth.enabled=false
// Config TLS keystore and truststore
pinot.broker.grpctls.keystore.path=/home/pinot/tls-store/keystore-internal.jks
pinot.broker.grpctls.keystore.password=changeit
pinot.broker.grpctls.keystore.type=JKS
pinot.broker.grpctls.truststore.path=/home/pinot/tls-store/truststore.jks
pinot.broker.grpctls.truststore.password=changeit
pinot.broker.grpctls.truststore.type=JKS
Broker GRPC Clients
Below are the examples of usage for pinot-java-client and pinot-jdbc-client .
Java Grpc Client
The main difference of the usage here is that ConnectionFactory will return a GrpcConnection instead of Connection.
If you want to use ARROW as the encoding type, you must start Java with
Below are the parameters to set per connection basis:
blockRowSize: the number of rows per block that grpc response will return, default is 10000.
compression: the compression algorithm over the wire, default is ZSTD, other options:
LZ4_FAST: fast than LZ4_HIGH but not as high compression rate
LZ4_HIGH
ZSTD (Default)
DEFLATE
GZIP
SNAPPY
PASS_THROUGH/NONE: no compression, fast but could be large data transfer over the wire.
encoding: how to do serialization and deserialization for ResultTable transport between BrokerGrpcServer and Grpc Client, default is JSON, other options:
JSON(Default)
ARROW
Benchmark
We did a simple benchmark of query:
SELECT * FROM airlineStats limit 1000
Will compress 97k (9.2MB) rows with block size 10K.
Compression
CompressionType
Compression Ratio
Response Latency(ms)
Latency Ratio
LZ4_FAST
42.19%
477.6
103.02%
LZ4_HIGH
30.04%
977.0
210.74%
ZSTD
26.10%
485.4
104.70%
DEFLATE
25.64%
810.0
174.72%
GZIP
25.64%
811.8
175.11%
SNAPPY
42.56%
461.2
99.48%
NONE
100%
463.6
100%
Block Size
We also tried for ZSTD the same data set with different block size:
BlockRowSize
Compression Ratio
Avg Latency(ms)
100
30.48%
539.6
1000
27.56%
478.3
10000
26.10%
485.4
100000
25.73%
561.2
Encoding
Tested with ZSTD compression for the same query but different encoding and block size: