cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to migrate the data from Postgres to Databricks?

jeremy98
New Contributor III

Hello Community,

I have a question about migrating data from PostgreSQL to Databricks. My PostgreSQL database receives new data every hour, and I want to synchronize these hourly inserts with the bronze layer in my Databricks catalog.

Currently, Iโ€™m using JDBC to schedule a workflow that syncs the data from PostgreSQL to Databricks. However, each hourly batch contains around 10 million records, making this process challenging. Is there a simpler or more efficient solution to achieve this synchronization?

2 REPLIES 2

Walter_C
Databricks Employee
Databricks Employee

You can either use the JDBC connection you are using as of now or you can use the Databricks connector designed for PostgreSQL https://docs.databricks.com/en/connect/external-systems/postgresql.html#query-postgresql-with-databr... 

jeremy98
New Contributor III

Hello Walter,
Thank you for your help - you're amazing. I wanted to explain my current challenge in more detail:
We have a platform that stores data in PostgreSQL, with a pipeline ingesting millions of rows every hour. We're trying to migrate this data to Databricks, but we're encountering concurrency issues. While the pipeline can write and update the same table in PostgreSQL, we're getting METADATA_CHANGED exceptions in Databricks. Is there a way to sync this data directly? Our goal is to store the data in blob storage rather than PostgreSQL.

Looking forward to your guidance.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group