Databases 7 min read

Which Database Wins IP Range Lookups? ClickHouse vs Doris vs Redis Benchmarks

This article presents a systematic benchmark comparing ClickHouse, Doris, and Redis for IP‑range dimension lookups using Flink‑Kafka pipelines, detailing test design, result table schema, query interfaces, and performance results across varying data rates, concluding that Redis offers the fastest and most stable query latency.

dbaplus Community
dbaplus Community
dbaplus Community
Which Database Wins IP Range Lookups? ClickHouse vs Doris vs Redis Benchmarks

Background and Goal

The previous article described a data‑ingestion design based on an IP‑range dimension table with more than 600,000 records, stored in both ClickHouse (CK) and Doris. To evaluate the feasibility of this dimensional table design, the same dataset is now compared against Redis using a range‑query approach.

Test Task Design

The evaluation uses a streaming workflow where Flink reads data from Kafka, performs the lookup in one of the three databases, and writes the result back to ClickHouse. Three identical tasks are defined:

Task 1: Flink reads Kafka, queries Doris, writes results to ClickHouse.

Task 2: Flink reads Kafka, queries ClickHouse, writes results to ClickHouse.

Task 3: Flink reads Kafka, queries Redis, writes results to ClickHouse.

All tasks share the same table engine, indexed fields, and column types to ensure a fair comparison.

Result Table Design in ClickHouse

A dedicated result table is created in ClickHouse to store the outcome of each lookup. The schema includes:

ip : the IPv4 string to query.

ip_and_address : concatenated geographic and ISP information.

hit_source : indicates which database (Doris, CK, or Redis) performed the lookup.

data_time : timestamp when Flink received the IP record.

insert_time : timestamp when the lookup result is inserted.

time_gap : difference between insert_time and data_time in milliseconds, representing the per‑record query latency.

Query Interface Design

ClickHouse query interface: JDBC, a proven method in many projects.

Doris query interface: MySQL‑compatible JDBC.

Redis query interface: A custom wrapper built on Jedis, already encapsulated for reuse.

All three interfaces are straightforward; the main consideration is managing database connections within Flink’s distributed environment.

Benchmark Execution

The tests run with four different Kafka input rates: 10, 100, 500, and 2000 records per second. For each rate, the three databases are queried, and the latency distribution is recorded. The following images show the latency curves and average time gaps for each database at each load level.

Similar charts are provided for the 100, 500, and 2000 records/s scenarios, showing the latency trends for Doris, ClickHouse, and Redis respectively.

Observations

Redis consistently delivers the lowest latency (≈1–2 ms) with the smallest variance, making it the fastest and most stable option.

ClickHouse follows, typically around 6–7 ms, but its latency is less stable than Redis.

Doris performs the worst, averaging about 10 ms and showing larger fluctuations; under high load (2k records/s) the Doris pipeline even stalled overnight.

Conclusion

For the specific use case of joining upstream Kafka data with an IP‑range dimensional table, Redis provides the best performance, ClickHouse is acceptable as a secondary choice, and Doris is not recommended due to higher latency and stability issues.

PerformanceFlinkRedisKafkaClickHousedorisDatabase Benchmark
dbaplus Community
Written by

dbaplus Community

Enterprise-level professional community for Database, BigData, and AIOps. Daily original articles, weekly online tech talks, monthly offline salons, and quarterly XCOPS&DAMS conferences—delivered by industry experts.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.