hn.today

OLTP is expensive, you can ClickHouse it

clickhouse.com13 points1 comments
Screenshot of OLTP is expensive, you can ClickHouse it

The piece argues that keeping large volumes of settled transactional data in an ACID OLTP system like PostgreSQL is unnecessarily expensive and that moving those read-mostly records into ClickHouse yields much better economics. PostgreSQL enforces ACID on every write - flushing WAL to disk at commit, using MVCC which writes new physical row copies and leaves dead tuples for VACUUM, and updating all affected indexes - so small logical changes amplify into many kilobytes of I/O and multiple 8 KB page modifications. On reads, uncompressed 8 KB tuples, index lookups, and cache churn drive further cost as datasets exceed RAM. Sharding or shared-storage Postgres helps scale but adds coordination and redundancy costs that produce diminishing returns. Many real-world domains (financial history, closed retail returns, old social activity, deactivated tenant metadata) transition into settled, rarely mutated state where full transactional guarantees are no longer required.

The recommended pattern is hybrid: keep fresh writes and single-row transactional access in Postgres, and offload settled data and analytical queries to ClickHouse. ClickHouse’s columnar storage delivers roughly 10-30× compression, much lower infrastructure cost (quoted ~5×), background indexing and batch-oriented ingestion, and analytics that run ~100× cheaper. Trade-offs are slower single-row reconstruction and near-real-time (≈1s) consistency, which are acceptable for settled data. ClickHouse Cloud provides integration primitives - local NVMe for Postgres, WalShadow CDC, and pg_clickhouse FDW - to sync data and simplify the two-database architecture, claiming order-of-magnitude savings and reduced Postgres maintenance.

Read on clickhouse.com1 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Other

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.