Do graph calculations via SQL Queries to DB or within Bubble?

Hi,

Is it better to run calculations on database data via sql queries or by importing the specific part of the db and then running calculations within bubble? I imagine there are multiple variables that go into this; however, are their more general rule of thumbs here?

Furthermore, when requesting images from our database, we plan to store photos in s3 bucket and request the file from there within our workflows. Is there best practices on how to do this? I assume we really want to store large files like that within our system to avoid loading from another system each time.

Thanks

bumppp

bump!

Is it better to run calculations on database data via sql queries or by importing the specific part of the db and then running calculations within bubble?

Many considerations however the main ones I’d suggest are;

  • it is very quick and easy to set up simple databases and processing logic in Bubble and then you can quickly and easily create powerful UIs on top of that Database.
  • If your processing logic is long-running or relies on some SQL features like “having”, “or”, complex joins … then duplicating that functionality in Bubble will be fiddly and hacky.
  • There is a high cost to Bubble compute - and modelling that cost is currently not well understood.

If you already have your database setup, and calculations set up on an external DB it is easy to integrate and bring that information into Bubble.

Furthermore, when requesting images from our database, we plan to store photos in s3 bucket and request the file from there within our workflows. Is there best practices on how to do this? I assume we really want to store large files like that within our system to avoid loading from another system each time.

If your photos are public - then it absolutely makes sense to store large amounts of bytes outside of Bubble. Look at the built-in storage limits of the Bubble pricing tiers to gauge whether you have a lot of data storage requirements or not.

If your requirements are around file (photo) management and privacy of those files, there are plugins to help you with the upload and do and load of secure S3 files. If your file storage requirements are low - it is very easy to setup up secure files in Bubble.

Many other factors to consider - if MVP and getting something live quickly is your key driver - do it all in Bubble. If costs and scaling of those costs are your biggest driver - do some cost modelling, and consider development costs and ongoing complexity, vs hosting & compute costs. :slight_smile:

You are awesome !