Repository navigation
Optional ClickHouse analytics sink for Ponder #2307
Unanswered
neuroborus
asked this question in
Idea / Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
We use Ponder in production for its intended purpose. With millions of rows we hit Postgres limits quickly. Even with indexes, analytical queries became slow and resource heavy.
This is expected. General purpose relational databases are not optimized for high volume timeseries workloads, especially on very large tables. Postgres stays the right choice for Ponder's canonical state, but it is not the best tool for wide, append heavy analytical reads.
Proposal
Add ClickHouse as an optional analytics database. Postgres remains canonical for application data, checkpoints, migrations, reorg recovery, and the query APIs. ClickHouse receives an append only projection of indexed events for analytical queries.
Properties:
@ponder/clickhouse. Core exposes only a vendor neutral sink contract.How it is split
I opened six pull requests that build on each other and preserve backward compatibility at every step.
The first four are a minimal integration: only finalized events are written to ClickHouse, so there is no reorg handling and no provisional data.
The last two are the next level: opt in live delivery with append only reorg revocations, on a separate v2 table.
feat/ch1-finalized-sink-deliveryfeat/ch2-clickhouse-analytics-sink@ponder/clickhousepackage for finalized events.test/ch3-clickhouse-acceptancedocs/ch4-clickhouse-sinkfeat/ch5a-core-live-sinkfeat/ch5b-clickhouse-live-reorgPRs 1 to 4 are finalized only. PRs 5 and 6 add live and reorg delivery. Each PR builds and tests independently and can be reviewed on its own.
All reactions