Bulk updates to database, most efficient method?

How can I most efficiently replace the entire database of a particular data type in bulk? I am using Bubble’s built in database, should I switch to another backend?

I have a database with a few different data types (common types like users, products, etc.) and the value proposition of my app relies on maintaining up-to-date pricing on the products in my database. This is problematic because I am hosting grocery products in my DB, of which there are going to be around 40 thousand products in my DB at a time (and many more in the future) and they will all need their prices updated on a weekly basis. How can I most efficiently bulk update large numbers of product prices?? My most efficient way I can think of at this time is to delete all of the products in my db and upload the new products with their pricing in a bulk upload event, however this seems inefficient especially given the speeds I’ve seen in trying to delete bulk data objects in the past.

Please keep in mind, I do not know how to code…

The database modify action should help. It lets you download the entire table as a CSV, you can make the changes to this CSV and then re-upload it with the ‘Modify’ button on the database section. Make sure to have the unique id field visible in the view while downloading the CSV since it only includes the view’s fields in the download.

Alternatively, Bulk backend workflows should work.

You first build a backend workflow that takes a thing you need to modify (product) and does the changes to the thing. Ideally also set a date field to mark when the last bulk modification was done on each of these things. Then in the database view on the bubble editor, expand your view (see more items) to show as many rows as you can, select all and click Bulk. Select the backend workflow you created and run.

This will run the selected workflow on all the selected rows.
The last bulk modification value will help you create batches of things to apply the bulk workflow to.

Hope this helps!

Cheers,
Ranjit / Atomic Fusion - Accelerate your Bubble development with the community’s assets

1 Like