---
title: "OpenMeter: Real-time usage-based billing powered by ClickHouse Cloud"
description: "OpenMeter, an open-source usage-based metering and billing platform, replaced a Kafka + ksqlDB + Postgres pipeline with Kafka feeding ClickHouse Cloud."
url: "https://swe.quest/articles/openmeter-real-time-usage-based-billing-powered-by-clickhouse-cloud-1ee88b3c82298546"
canonical: "https://clickhouse.com/blog/openmeter-real-time-usage-based-billing-powered-by-clickhouse-cloud"
source: "ClickHouse"
published: "2024-06-13"
difficulty: "easy"
kind: "Case study"
reading_minutes: 2
tags: ["analytics","messaging","stream-processing","payments"]
---

# OpenMeter: Real-time usage-based billing powered by ClickHouse Cloud

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2024-06-13, 2 min read, Case study. Original: [https://clickhouse.com/blog/openmeter-real-time-usage-based-billing-powered-by-clickhouse-cloud](https://clickhouse.com/blog/openmeter-real-time-usage-based-billing-powered-by-clickhouse-cloud)

## Summary

OpenMeter, an open-source usage-based metering and billing platform, replaced a Kafka + ksqlDB + Postgres pipeline with Kafka feeding ClickHouse Cloud. The old setup was costly and hard to operate because ksqlDB has no clustering, which forced manual sharding across many instances. The new design uses Kafka for buffering and back-pressure with per-customer topic partitioning, and a modified ClickHouse Kafka Connect Sink for deduplication. ClickHouse materialized views over AggregatingMergeTree tables roll raw events into one-minute tumbling windows and serve as long-term storage. Unlike observability metrics, billing data cannot be sampled or rolled up, so precise dedup and long retention are core requirements.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Queues & messaging](https://swe.quest/tags/messaging.md) (Backend & APIs)
- [Stream processing](https://swe.quest/tags/stream-processing.md) (Data & databases)
- [Payments & fintech](https://swe.quest/tags/payments.md) (Domains)

## Prerequisites

- Kafka basics ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))
- ClickHouse materialized views ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))

## Keywords

ClickHouse Cloud, OpenMeter, Kafka, ksqlDB, AggregatingMergeTree, ClickHouse Kafka Connect Sink, PostgreSQL

## Related posts

- [How the D. E. Shaw group powers high-cardinality observability at scale with ClickHouse](https://swe.quest/articles/how-the-d-e-shaw-group-powers-high-cardinality-observability-at-scale-with-b74a9887c2072ab0.md): ClickHouse · 2026-05-15 · Medium · 7 min read · Observability, Analytics & OLAP, Scaling, Capacity planning
  The D. E. Shaw group moved per-task resource metrics from its HPC grid, millions of high-cardinality time series keyed by unique task IDs, from an InfluxDB-protocol time-series platform to ClickHouse.
- [How Mercado Libre rebuilt its observability platform on ClickHouse Cloud with 75x faster trace queries](https://swe.quest/articles/how-mercado-libre-rebuilt-its-observability-platform-on-clickhouse-cloud-with-a3245c05609a41cc.md): ClickHouse · 2026-08-04 · Medium · 8 min read · Observability, Analytics & OLAP, Scaling, Performance engineering
  Mercado Libre moved the storage layer of its OpenTelemetry-based tracing platform, O11y events, to ClickHouse Cloud.
- [Goodbye limitations, hello data: How Qonto is rethinking observability with ClickHouse Cloud](https://swe.quest/articles/goodbye-limitations-hello-data-how-qonto-is-rethinking-observability-with-756d9cefa803d826.md): ClickHouse · 2026-05-01 · Easy · 8 min read · Observability, Analytics & OLAP, AI agents, Cost optimization
  Qonto, a European digital bank, moved trace storage from Grafana Tempo to ClickHouse Cloud, extending query windows from 2-3 hours to two weeks without sampling and adopting a wide-events model instead of the logs/metrics/traces pillars.
- [Why m3ter chose ClickHouse Cloud](https://swe.quest/articles/why-m3ter-chose-clickhouse-cloud-3bab684612a2e50e.md): ClickHouse · 2025-01-14 · Medium · 16 min read · Analytics & OLAP, Databases, Performance engineering, Cost optimization, Payments & fintech
  m3ter, a usage-based billing service, picked ClickHouse Cloud for its usage-data plane after proof-of-concept tests against Snowflake, Firebolt, Redshift and Aurora Postgres.
- [Scaling our Observability platform beyond 100 Petabytes by embracing wide events and replacing OTel](https://swe.quest/articles/scaling-our-observability-platform-beyond-100-petabytes-by-embracing-wide-c75d29b3bcaf1192.md): ClickHouse · 2025-06-19 · Medium · 26 min read · Observability, Scaling, Cost optimization, Analytics & OLAP, Go
  ClickHouse's internal LogHouse platform grew from 19 PiB to over 100 PB of uncompressed logs (about 500 trillion rows), mostly by replacing the OpenTelemetry pipeline for ClickHouse server telemetry with SysEx.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
