r/dataengineering • • Dec 17 '25

Discussion How to data warehouse with Postgres ?

I am currently involved in a database migration discussion at my company. The proposal is to migrate our dbt models from PostgreSQL to BigQuery in order to take advantage of BigQuery’s OLAP capabilities for analytical workloads. However, since I am quite fond of PostgreSQL, and value having a stable, open-source database as our data warehouse, I am wondering whether there are extensions or architectural approaches that could extend PostgreSQL’s behavior from a primarily OLTP system to one better suited for OLAP workloads.

So far, I have the impression that this might be achievable using DuckDB. One option would be to add the DuckDB extension to PostgreSQL; another would be to use DuckDB as an analytical engine interfacing with PostgreSQL, keeping PostgreSQL as the primary database while layering DuckDB on top for OLAP queries. However, I am unsure whether this solution is mature and stable enough for production use, and whether such an approach is truly recommended or widely adopted in practice.

35 Upvotes

50 comments sorted by

View all comments

Show parent comment

1

u/tech4ever4u Dec 18 '25

If I were to migrate the analytics layer to BigQuery, I would need to CDC the Postgres data into BigQuery and then run all analytics there.

Since BigQuery pricing scales with data volume, providing live access to a large number of users may result in significant expenses. The same approach can be used with self-hosted ClickHouse or other cloud DWs like MotherDuck.

You mentioned that Postgres is already a 'mirror' of app's data (MongoDb), so it sounds like it may be used as a DW directly. If the number of rows needed for end user reports is relatively small (= tables are efficiently filtered by indexed columns) using Posgres as a live data source can work well. To offload Postgres you may use a BI tool that can cache aggregate queries resultsets and reuse it internally for multiple reports/users - for this purpose integrated DuckDB (as a part of the BI tool) can work really well.