Join us
@vmihailenco ・ Jun 29,2023 ・ 2 min read ・ 1281 views
Learn how to use go-redis client to get started with Apache Kvrocks, a distributed key-value NoSQL database.
Learn how to use go-redis client to get started with Apache Kvrocks, a distributed key-value NoSQL database.
Apache Kvrocks is a distributed key-value NoSQL database that uses RocksDB as a storage engine and is compatible with Redis protocol.
You can use Kvrocks as a drop-in replacement for Redis to store data on SSD, reducing storage costs and increasing capacity. For example, imagine taking one of the many existing Redis-based job queues and using them with Kvrocks and SSD storage.
Kvrocks supports most Redis commands including the watch
command starting from v2.4.0. Kvrocks Cluster and replication are available as well.
You can launch Kvrocks using Docker:
And start using it right away:
You can also build Kvrocks with GCC yourself.
Since Kvrocks uses Redis-compatible protocol, you can use your favorite Redis client to work with Kvrocks, for example, Go Redis client:
Pipelines, pub/sub, and even Lua scripts are working as well:
You can then run the script like this:
Monitoring Kvrocks performance is crucial to ensure optimal operation and identify any potential bottlenecks or issues.
OpenTelemetry provides instrumentation libraries and integrations for monitoring Kvrocks using its unified observability framework.
OpenTelemetry is an open-source observability framework designed to standardize and simplify the collection, analysis, and export of telemetry data
OpenTelemetry allows developers to collect and export telemetry data in a vendor agnostic way. With OpenTelemetry, you can instrument your application once and then add or change vendors without changing the instrumentation, for example, here is a list DataDog competitors that support OpenTelemetry.
Uptrace is an OpenTelemetry APM that supports distributed tracing, metrics, and logs. You can use it to monitor applications and set up automatic alerts to receive notifications via email, Slack, Telegram, and more.
Uptrace stores telemetry data in ClickHouse database. ClickHouse is an open source column-oriented database management system that is designed to process large volumes of data in real-time and to provide fast analytics and reporting capabilities.
You can use OpenTelemetry and Uptrace together to monitor Kvrocks performance using the go-redis instrumentation:
Once the data reaches Uptrace, it will generate the following dashboard for you:
Because OpenTelemetry provides a vendor-agnostic approach, it allows you to choose an OpenTelemetry backend that best suits your requirements, for example, Jaeger or Zipkin.
You can also configure OpenTelemetry Redis receiver to monitor Kvrocks:
The receiver works by parsing the output of INFO
command and produces a number of useful metrics:
See GitHub example for details.
You can also export the collected metrics to Prometheus using OpenTelemetry Prometheus bridge
Using OpenTelemetry Metrics API, you can even create custom Kvrocks metrics. For example, the following function parses used_disk_percent
to create kvrocks.used_disk_percent
metric:
The metric looks like this in Uptrace:
Join other developers and claim your FAUN account now!
Influence
Total Hits
Posts
Only registered users can post comments. Please, login or signup.