Live data from Hacker News

Show HN: Peerdb Streams – Simple, native Postgres change data capture

news.ycombinator.com

21–30 of 42 posts

Re: Show HN: Peerdb Streams – Simple, native Postgres change data capture

#21

Noob question: What is the advantage of replicating data into a warehouse vs. just querying it in place on a postgres database?

If the postgres database is recording business transactions, you don't want to cause your business to stop being able to take credit cards because you generated a report.

What about using a read-only replica for reporting. Are there any downsides to that? Seems to be easier to manage

Re: Show HN: Peerdb Streams – Simple, native Postgres change data capture

#22

Noob question: What is the advantage of replicating data into a warehouse vs. just querying it in place on a postgres database?

Typically data warehouses are OLAP databases that have much better performance than OLTP databases for large queries.

There might also be several applications in a company, each with their own database, and a need to produce reports based on combinations of data from multiple applications.

I think that in many cases your question is based on an idea that is completely right. engineers are too eager to split out applications into multiple databases and tacking on separate data warehouses. The costs of maintaining separate databases is often higher than initially thought. Especially when some of the data in the warehouse needs to go back into the application database, for example for customer facing analytics. I think many companies would be better served by considering traditional data warehousing needs directly in their main application databases and abstain from splitting out databases. Having one single ACID source of truth and paying a bit more for a single beefy database server makes a lot more sense than is commonly thought. Especially now when many customer facing products, like recommendation systems, are “data driven”. At least that’s my impression after working in the space for a while.

Re: Show HN: Peerdb Streams – Simple, native Postgres change data capture

#23
Are BigQuery's clustered and partitioned supported (both as a source and sink).

Plus how is the deduplication process handled? Fivetran for example creates staging tables and scans the target table. Since it does support BigQuery's integer based partitioning. A table partitioned by Primary key helps in cost optimizations.

Re: Show HN: Peerdb Streams – Simple, native Postgres change data capture

#24

Are BigQuery's clustered and partitioned supported (both as a source and sink). Plus how is the deduplication process handled? Fivetran for example creates staging tables and scans the target table. Since it does support BigQuery's integer based partitioning. A table partitioned by Primary key helps in cost optimizations.

Yep, the target tables on BQ are automatically clustered on the primary key, and there is an option to further partition them on the peerdb_synced_at column. We've seen this reduce replication costs by 50% and also help reduce costs for off-stream transformations. Sharing a customer case study that you might find interesting: :) https://www.peerdb.io/customers/harmonic-customer-story

Regarding the deduplication process, we stage raw CDC data into a staging table and run periodic MERGE operations. The raw table is also auto-clustered and partitioned similar to final table. This helps save costs.

Re: Show HN: Peerdb Streams – Simple, native Postgres change data capture

#25

Are BigQuery's clustered and partitioned supported (both as a source and sink). Plus how is the deduplication process handled? Fivetran for example creates staging tables and scans the target table. Since it does support BigQuery's integer based partitioning. A table partitioned by Primary key helps in cost optimizations.

You can partition your BigQuery table however you like and Fivetran will leave it in place. I don’t think there’s any benefit to partitioning the staging table.

Re: Show HN: Peerdb Streams – Simple, native Postgres change data capture

#27

Noob question: What is the advantage of replicating data into a warehouse vs. just querying it in place on a postgres database?

When you need to do large/medium-scale analytical queries. Postgres is fairly slow for aggregate/group queries needed for analytics. Think if you're building Google Analytics type functionality.

Re: Show HN: Peerdb Streams – Simple, native Postgres change data capture

#28

Earlier quoted context omitted.

If the postgres database is recording business transactions, you don't want to cause your business to stop being able to take credit cards because you generated a report.

What about using a read-only replica for reporting. Are there any downsides to that? Seems to be easier to manage

That’s the use case for cdc, to make it equally easy to use a DW. As always the complexity is just air you move in the balloon. The oltp db can spit out the events and forget them, how you load them efficiently is now a data engineer’s problem to solve ( if it was easy to write event grain on an olap you would not need an oltp). Kafka usually enters the room at this stage and the simplification promise is becoming tenuous.

Re: Show HN: Peerdb Streams – Simple, native Postgres change data capture

#30

How do you handle Postgres cluster failover? Does PeerDB automatically restore logical replication slot on a new primary?

Great question! We have retry logic in place to handle Postgres restarts. If the failure occurs in-place, you should be fine as the slot will persist. If Postgres fails over to the standby, PeerDB will wait until the slot is created. We did consider automatically creating the slot if it doesn't exist on retries, but ensuring data reliability (creating the slot right after failover without data being ingested) is tric…

Thanks! I'd say, this is a very complicated problem left to be solved by user. Debezium also does not solve the problem it, and from DBA point of view it is a blocker for adoption. Would be nice to have some solution that would ensure that logical replication slot persists through failover.
Post reply on HN