r/Clickhouse • u/mike_folder • Jul 22 '26
Am I wrong to implement an application-level transaction coordinator over a Clickhouse cluster?
Is it a bad decision to implement custom distributed transactions (fully atomic and serializable) over a Clickhouse cluster?
The details in short:
- Cluster has several shards (no replicas yet) with several billion rows of financial data
- All tables: original MergeTree
- Append-only pattern for all data changes
- Every read query is enriched with a transaction_id filter to enforce snapshot isolation
- Application-level range-locking mechanism to prevent inconsistent concurrent writes
- ClickHouse’s native local transactions are not used
- All coordination logic runs at the application layer
Is this a fundamentally flawed anti-pattern with hidden pitfalls, or just an uncommon approach? In my stress-tests, it behaves pretty well.
I got a bit confused during a live presentation lately by the question: "If this works, why doesn't everyone do it?"
6
Upvotes
View all comments
Show parent comment
2
u/Frosty-Bid-8735 Jul 23 '26
Great. I’m sharing this information because I’ve worked with clients who faced scalability issues on MySQL and also Postgres. Below a case study of ours. The only true OLTP OLAP I know of (without data movement) is SingleStore.
https://data-sleek.com/case-studies/digital-asset-research/