Cost-predictable logging at scale with ClickHouse, Grafana & WarpStream

Dale McDiarmid & Ryadh Dahimene
25 min readintermediate
--
View Original

Overview

This article discusses the CGW Stack, which combines ClickHouse, Grafana, and WarpStream to provide a cost-effective and efficient logging solution at scale. It highlights the benefits of using this stack for centralized logging, including significant cost savings compared to traditional solutions like Elastic and Datadog, as well as impressive compression rates and query performance.

What You'll Learn

1

How to implement a cost-effective logging solution using ClickHouse, Grafana, and WarpStream

2

Why separating storage and compute can enhance logging performance and reduce costs

3

How to optimize log data ingestion and querying with ClickPipes

4

When to use WarpStream for buffering log data before insertion into ClickHouse

Prerequisites & Requirements

  • Basic understanding of logging and data storage concepts
  • Familiarity with ClickHouse and Grafana(optional)

Key Questions Answered

What are the cost savings of using the CGW Stack compared to Elastic and Datadog?
The CGW Stack is 23x more cost-efficient than Elastic Cloud and up to 42x less expensive than Datadog for the same volume of data. This significant cost reduction is achieved through efficient storage and querying mechanisms provided by ClickHouse and WarpStream.
How does WarpStream enhance log data processing?
WarpStream is an Apache Kafka-compatible data streaming platform that buffers log data efficiently, allowing for high throughput and low latency. Its stateless agents and use of object storage help manage large streams of machine-generated data cost-effectively.
What is the compression ratio achieved by ClickHouse for log data?
ClickHouse achieves compression rates of up to 14x for log data, allowing users to store significantly more data at a lower cost. This high compression efficiency is crucial for managing large volumes of log data while minimizing storage expenses.
What is the recommended architecture for using ClickHouse with Kafka?
The recommended architecture involves using WarpStream to buffer data in Kafka before inserting it into ClickHouse. This setup helps absorb traffic spikes and maintains a constant insertion load on ClickHouse, enhancing overall performance and reliability.

Key Statistics & Figures

Compression ratio
up to 14x
Achieved by ClickHouse for log data storage
Cost comparison
23x to 42x less expensive
Compared to Elastic Cloud and Datadog for the same data volume
Storage capacity
1.5TiB of log data
Can be compressed down to under 100GiB using ClickHouse

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Key Actionable Insights

1
Consider implementing the CGW Stack for your logging needs to achieve significant cost savings.
The CGW Stack can reduce logging costs dramatically compared to traditional solutions, making it an attractive option for organizations looking to manage large volumes of log data efficiently.
2
Utilize WarpStream to buffer log data before it reaches ClickHouse, enhancing data ingestion performance.
By buffering data with WarpStream, you can handle traffic spikes more effectively and ensure that your logging system remains responsive under load.
3
Leverage ClickHouse's compression capabilities to maximize storage efficiency for log data.
With compression rates of up to 14x, ClickHouse allows you to store more data at a lower cost, which is essential for organizations with high logging volumes.
4
Implement ClickPipes for seamless data loading into ClickHouse.
ClickPipes simplifies the process of ingesting log data into ClickHouse, allowing for quick and efficient data pipelines that can be set up in minutes.

Common Pitfalls

1
Failing to optimize the schema for ClickHouse can lead to suboptimal compression rates.
An unoptimized schema may not take full advantage of ClickHouse's compression capabilities, resulting in higher storage costs and reduced performance.
2
Neglecting to implement a buffering layer like WarpStream can overwhelm ClickHouse during traffic spikes.
Without a buffering mechanism, sudden increases in log data can lead to performance bottlenecks, impacting the overall reliability of the logging system.

Related Concepts

Centralized Logging
Data Compression Techniques
Real-time Analytics
Data Ingestion Strategies