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: 

Reduce downtime of Postgres table - JDBC overwrite job

siddharthk
New Contributor II

I want to overwrite a Postgresql table transactionStats which is used by the customer facing dashboards.

This table needs to be updated every 30 mins. I am writing a AWS Glue Spark job via JDBC connection to perform this operation.

Spark dataframe write snippet -

df.write.format("jdbc").option("url", "connection_params").option("dbtable","public.transactionStats"). mode("overwrite").save()

I am seeing a downtime on the dashboard while the table is being overwritten

how to avoid downtime? Any solutions? Staging table?

1 ACCEPTED SOLUTION

Accepted Solutions

-werners-
Esteemed Contributor III

can you use rename table? so load a temp table, rename target table to something else, rename temp table to target table.

View solution in original post

2 REPLIES 2

-werners-
Esteemed Contributor III

can you use rename table? so load a temp table, rename target table to something else, rename temp table to target table.

Anonymous
Not applicable

Hi @Siddharth Kanojiya​ 

We haven't heard from you since the last response from @werners (Customer)​ . Kindly share the information with us, and in return, we will provide you with the necessary solution.

Thanks and Regards

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