Postgres-Compatible Query Layer for BigQuery and Snowflake
You can use PeerDB’s Postgres-compatible SQL layer to query tables in BigQuery or Snowflake. You can leverage Postgres’ hundreds of integrations, including client tools like pgadmin and psql, BI tools like Grafana and Power BI, and languages such as Python and Ruby to query data in BigQuery or Snowflake. PeerDB parses and translates the incoming SQL query to make it compatible with the appropriate Peer. It pushes down most SQL constructs, including filters, JOINs, aggregates, sorts, limits etc., to the attached Peer. This enables blazing fast performance. You can also query tables in BigQuery or Snowflake from your existing Postgres database by connecting PeerDB as apostgres_fdw
FOREIGN SERVER.
You can utilize postgres_fdw’s advance push-down capabilities to maximize the performance of your queries involving BigQuery and Snowflake tables. For queries where push-down is important, you can expect 100x performance gains compared to other foreign data wrappers.Let’s go through steps to query BigQuery and Snowflake using PeerDB.
Step 1: Add BigQuery and Snowflake Peers
Run the following commands to let PeerDB know about the existing Postgres and Snowflake Peers:(…)
with the appropriate connection details for both the Postgres and Snowflake instances. More details on adding PEERs are available here.
Step 2: Query Tables in BigQuery and Snowflake
Query BigQuery and Snowflake using postgres_fdw
PeerDB enables you to query BigQuery or Snowflake from your existing Postgres database using postgres_fdw
. As PeerDB is Postgres wire-compatible, you can connect to PeerDB as a postgres_fdw FOREIGN SERVER from your Postgres database and start querying tables in Peers that have been created on PeerDB.
Let’s walk through the steps to query tables in BigQuery from your existing Postgres database using PeerDB.