Live data from Hacker News

How We Pushed CDC into Postgres

snowflake.com

31–38 of 38 posts

Re: How We Pushed CDC into Postgres

#32
post #3

This was basically Vertica's party trick for quite a long time to have a WOS and ROS formats for the same row and anti-caching between those two. You could've built a similar system with dezebium and delta lake for quite some time but it would fail compactions, if you run it fast enough. I've seen Oracle GoldenGate 12c do this trick in 2014 or so, using Mysql as the cheap replica. But they are all fragile to schema u…

Aurora zero etl was a nightmare for us. Almost any schema changes require a VACUUM FULL for it to continue functioning. On a few occasions, it just stopped running without an obvious explanation, requiring slow and lengthy back and forth threads with AWS support. If it worked as advertised, it would be great, but I can't recommend it for any serious production system.

[dead]

Re: How We Pushed CDC into Postgres

#33
post #20

Earlier quoted context omitted.

The challenge is converting primary key updates/deletes to row offsets in a columnar table. That requires maintaining an expensive mapping or doing expensive scans, and is not something you want Postgres itself to do. It's also this bursty, memory-intensive workload that you'd rather not have a lot of dedicated infrastructure for. At Snowflake we use Snowflake to do the apply work. Hence end-to-end mirroring has more…

Yes I’m not suggesting to do this inside Postgres. I’m hoping that a Postgres provider can provide this mirroring capability out of the box, similar to how they provide a connection-pooled endpoint out of the box so I don’t have to self-host pgBouncer. I just want to be able to check a box somewhere and have a table in Postgres automatically mirrored to Iceberg, with guarantee that no data is lost. They can charge mo…

Makes sense, we just shipped it https://www.linkedin.com/posts/craigkerstiens_barely-over-2-...

Re: How We Pushed CDC into Postgres

#35

It's interesting to watch how different companies that offer both Postgres and warehousing solution under 1 roof approach the same problem: - ClickHouse focuses on traditional CDC (ClickPipes) and just make it blazingly fast - Databricks leans on their unified storage architecture (LTAP) to avoid copying data (though you can argue there is still a copy in the cache) - Snowflake uses a data mirroring CDC as extension…

> I'm still waiting for a Postgres provider to just let me mirror data directly to Iceberg, so I can plug in my own stateless query engine. If you count AWS as Postgres provider, DMS into Kinesis into Firehose can do that. There was preview of just Firehose doing it directly, but AWS have pulled it because it was too unreliable. Maybe they rebuilt it since?

DMS is so unreliable though.

Re: How We Pushed CDC into Postgres

#36

It's interesting to watch how different companies that offer both Postgres and warehousing solution under 1 roof approach the same problem: - ClickHouse focuses on traditional CDC (ClickPipes) and just make it blazingly fast - Databricks leans on their unified storage architecture (LTAP) to avoid copying data (though you can argue there is still a copy in the cache) - Snowflake uses a data mirroring CDC as extension…

> I'm still waiting for a Postgres provider to just let me mirror data directly to Iceberg, so I can plug in my own stateless query engine. The issue that each of those providers above has recently adopted Postgres as a secondary product aimed at supporting their main product, an OLAP database or engine, so they don’t want you plugging in your own query engine. I’d bet you’re likely to see this from a Postgres-specif…

> mirror data directly to Iceberg

> I’d bet you’re likely to see this from a Postgres-specific provider first, like Supabase.

we deprecated this feature in our ETL tool[0]. The functionality is still in there but we can't support some of the production features we'd need for data/schema guarantees

Iceberg is still nascent - only supporting single-table transactions (at least when we tried). A lot of important CDC/transactional semantics were "a work in progress" upstream. We shifted our focus to ducklake, which stores the catalog in Postgres

[0] https://github.com/supabase/etl

Re: How We Pushed CDC into Postgres

#37

It's interesting to watch how different companies that offer both Postgres and warehousing solution under 1 roof approach the same problem: - ClickHouse focuses on traditional CDC (ClickPipes) and just make it blazingly fast - Databricks leans on their unified storage architecture (LTAP) to avoid copying data (though you can argue there is still a copy in the cache) - Snowflake uses a data mirroring CDC as extension…

> I'm still waiting for a Postgres provider to just let me mirror data directly to Iceberg, so I can plug in my own stateless query engine. The issue that each of those providers above has recently adopted Postgres as a secondary product aimed at supporting their main product, an OLAP database or engine, so they don’t want you plugging in your own query engine. I’d bet you’re likely to see this from a Postgres-specif…

> The issue that each of those providers above has recently adopted Postgres as a secondary product aimed at supporting their main product, an OLAP database or engine, so they don’t want you plugging in your own query engine. Disclosure: I work on Supermetal

You don't need to wait for a provider, and the provider is arguably the wrong place for this. They all have an incentive to make their own OLAP engine the happy path. A dedicated CDC tool that writes Iceberg to your own storage and catalog keeps the tables and the engine choice yours.

We built exactly that, a native Iceberg destination with Merge on Read. Since Snowflake and Databricks reject equality delete files, there's also a positional deletes only mode that writes deletion vectors instead, so the tables are readable from whatever engine you use.

https://docs.supermetal.io/docs/main/targets/iceberg/

Post reply on HN