Forum Discussion

HarrisonSmith's avatar
HarrisonSmith
Qrew Trainee
6 months ago

Pipeline Design for Bulk Record Updates

Hi all. I have a timecards table where users track all the things they're working on. Relatedly, we have a separate child timecard table, with a narrower field list but otherwise the exact same records. This was done a while ago to reduce volume on long term storage of these records because we hit the table limit of 500 MB. So anytime a timecard record gets created or edited in the parent table, there's a pipeline that checks to see if the record has any related child timecard records. If not, it creates a new child timecard record with all the relevant fields populated. If there is already a child timecard record, it updates that child record with all the newest field values. Then as the last step (only for new timecards), updates the newly created child timecard record with the Related Parent Timecard value so it's easy to verify all timecards have exactly 1 child record. Other than being resource-intensive, this pipeline works perfectly fine most of the time. 

However, twice/month, we export all our timecards to another system outside Quickbase, which is tracked with a date and checkbox field being updated via Find & Replace in a report to prove they were exported. The problem is, there are often around 5,000 records being updated simultaneously. When that update occurs, with so many timecards being updated all at once, a queue builds up that can take hours for the pipeline to process and update all of the underlying child records. Beyond general performance issues, users are often still creating new timecards, which don't show up for a while in the child timecard table because those new timecards are now in the back of the line to be created/updated. 

I want to redesign the pipeline using the On New Bulk Event step, so these records can be processed, created/edited all at once so a queue doesn't build up and take hours to finish running and cause confusion amongst end users. What's the best way to go about that? I tried replacing the trigger from an On New Event to an On New Bulk Event, while leaving everything else about the pipeline the same, but if anything, it's taking even longer than before.

6 Replies

  • The purpose of the On New Bulk event is to ensure that records are processed one by one and don't overwhelm the system and also in use cases where you really want the first record processed before you start processing the second. A small example of that would be where child records are being created in bulk and sometimes they need a corresponding parent record created.  If you do not use Bulk Trigger you will get multiple pipelines running simultaneously and both trying to create the same unique parent record. One will fail and generate errors.   

    But you are right, in terms of performance, Bulk Triggers is going to make the process run slower.

    If this is important to you and you can scrounge up some budget for outside consulting, I'm pretty sure that Sharon Faust (Quickbase Junkie) can help you.  

    A while back Sharon did a Qrew Demo where she used advanced techniques in Pipelines with Jinja which allowed her to achieve a 10x or maybe 100x speed up in processing speed.  

     

    • HarrisonSmith's avatar
      HarrisonSmith
      Qrew Trainee

      interesting, thanks Mark. Sounds like I misunderstood the purpose of the bulk event step. So for updating thousands of records all at once, it's still easiest/most performative to just have the pipeline loop through all the records one at a time (outside of leveraging Sharon's self-created methodology)?

      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend

        .... Yes, aside from Sharon, you should be using the Bulk Step and maybe you don't really care if it takes hours and hours to run because your app will still "Performative" (running nicely) for your regular users.

        A very nice design feature of the Bulk Trigger and the Regular Trigger is you can set the number of records for it to trigger on.

        So for example, you can set the Regular one to trigger when a maximum of 1 record is updated or created, and that will ensure that your manual entry users still get instant processing. And then you set the Bulk Trigger one to to trigger at 2 or more records being changed.  

        When I went looking for that setting on the regular trigger for On New Event, in an older Pipeline, the setting at the bottom of the box for the maximum number of records to trigger on, was not there. I was initially confused so I started to build a brand new pipeline and that same On New Event trigger did have the new setting at the bottom of the box. So you may have to go back to your existing regular On New Event trigger and replace it the same so that it will have that new feature.