Building a Web App in Bubble with a PostgreSQL Database – Should I Connect Directly or Sync the Data?

Hey everyone! :waving_hand:

I’m working on a web application using Bubble, and I already have an existing PostgreSQL database that powers some other internal tools.

Now I’m trying to figure out the best approach to integrate this PostgreSQL data with my Bubble app, and I’d love to get some advice from the community.

Two options I’m considering:

  1. Connect PostgreSQL directly to Bubble using the Bubble API Connector or external database plugin.
  2. Sync my PostgreSQL database to Bubble’s internal database so that Bubble has its own copy of the data.

My goals:

  • Smooth user experience inside Bubble (filters, searches, fast loads)
  • Keep data updated if I go with syncing
  • Avoid overcomplicating setup or maintenance

My questions:

  • Has anyone here connected Bubble directly to a PostgreSQL database? How well does it perform?
  • If I sync the data, what’s the best way to import data from PostgreSQL into Bubble and keep it updated regularly?
  • Any tools or workflows you recommend for syncing (like Zapier, Xano, custom scripts, etc.)?

Would love to hear what others have done in similar situations. Pros and cons of both methods, lessons learned, or anything I should watch out for would be super helpful !!

Thanks in advance!

Hey @joel.louzado :waving_hand:

I am sure there are many different thoughts on the matter, some may disagree with me. I personally would rather keep one source of truth than trying to keep something in sync with each other. It will probably cost a bit of workload if you don’t set it up properly.

So if it were me, I would try to keep everything in PostgreSQL. If you understand how to do queries with it then there shouldn’t be much that you would be missing out on.

If you don’t understand SQL then it might be worth it to you to sync with Bubble and use the native features to do searches and filters.

It’s really up to you, just my two cents. :blush:

Hope that helps a bit. I am sure others will chime in as well.

To answer your questions:

I feel like it almost performs better, at least cheaper.

You would have to set up a webhook to update from PostgreSQL to Bubble somehow and then you can set up a database trigger to run on Bubble to update PostgreSQL or schedule a backend workflow to run each time something changes.

Normally, I do everything in Bubble if possible. Sometimes it makes sense to use Xano or another tool if it saves you money.

1 Like

The Bubble database is PostgresSQL

Continually syncing the Bubble DB to an external DB will be a pain to set up and maintain, and will be workload intensive.
Adding external connections adds complexity and thus dev time to every DB interaction you build (think CRUD create, read [search, sort, filter, paginate], update, delete). It will also be a little bit slower.
Using Bubble’s front end and back end together fully leverages the benefits of the Bubble platform, namely faster development time and ease of changes/less maintenance.

Why not try migrating everything to Bubble? The only real downside is the lack of true direct database access, which may or may not be an issue depending on your use case.

we have rds, postgresql and nodejs that provides APIs to call from Bubble.

so I’d suggest the same approach.

trying to maintain sql connector in bubble is a horrible exp and ofc not fast