- Newest
- Most votes
- Most comments
To sync data from an RDS PostgreSQL database to Supabase using AWS Glue, you'll need to adjust your approach slightly. While AWS Glue supports various database connections, including PostgreSQL, it doesn't have native support for Supabase. However, since Supabase is built on top of PostgreSQL, you can treat it as a PostgreSQL database for this purpose.
Here's a step-by-step approach to achieve your goal:
-
RDS PostgreSQL Connection: You've already successfully created a connection to your RDS PostgreSQL database in AWS Glue. This is the correct first step.
-
Supabase Connection: For Supabase, you'll need to create another JDBC connection in AWS Glue. Treat it as a PostgreSQL database. Use the following details:
- Connection Type: JDBC
- JDBC URL: Use your Supabase PostgreSQL connection string (usually starts with postgresql://)
- Username and Password: Use your Supabase database credentials
- VPC, Subnet, and Security Group: Configure these to allow access to Supabase (if self-hosted on EC2, use the appropriate VPC settings; if cloud-hosted, you may need to configure network access)
-
Crawlers: Create a crawler for your RDS PostgreSQL database to catalog the tables you want to sync. This will add the table metadata to the AWS Glue Data Catalog.
-
ETL Job: Create an ETL job in AWS Glue Studio with the following configuration:
- Source: Use the RDS PostgreSQL connection and select the tables you want to sync
- Target: Use the Supabase JDBC connection you created
- Transformation: You can add any necessary transformations between the source and target
-
Job Scheduling: Set up a schedule for your ETL job to run periodically to keep the data in sync.
For bidirectional sync (Supabase to RDS), you'd need to create a separate ETL job with Supabase as the source and RDS as the target.
Regarding the connection error you encountered, it could be due to several reasons:
- Incorrect connection details (URL, username, password)
- Network connectivity issues (VPC configuration, security groups, firewalls)
- Supabase-specific configurations that may not be compatible with standard JDBC connections
To troubleshoot:
- Double-check all connection parameters
- Ensure your Glue job has network access to Supabase
- Try using a custom JDBC driver if the standard PostgreSQL driver doesn't work
- If using cloud-hosted Supabase, check if there are any specific connection requirements or limitations
If you continue to face issues, you might need to consider alternative approaches, such as using AWS Lambda or EC2 instances to run custom scripts for data synchronization between RDS and Supabase.
Sources
Using custom connectors and connections with AWS Glue Studio - AWS Glue
Copy and mask PII between Amazon RDS databases using visual ETL jobs in AWS Glue Studio | AWS Big Data Blog
Available connections - AWS Glue
JDBC connections - AWS Glue
answered 2 years ago
Relevant content
asked 5 years ago
- AWS OFFICIALUpdated a year ago
