https://netsuiteprofessionals.com logo
d

darrenhillconsulting

04/12/2022, 3:30 PM
Is it true that if I set the Concurrency Limit to 1 in a Map/Reduce, its effectively processing the results sequentially ... 1 at a time?
s

Seth Duda

04/12/2022, 3:33 PM
As far as I've seen, yes
c

creece

04/12/2022, 3:42 PM
get input data is always single threaded but once you hit the reduce, its gonna try to parallel what it can but if there's only 1 its gonna run sequentially... so yeah like 1 big sequential script that just manages governance for you.
s

Shawn Talbert

04/12/2022, 3:44 PM
concurrency = 1 means you have only built an overly complex scheduled script :)
m

mattdahse

04/12/2022, 3:50 PM
… with unlimited governance.
s

Shawn Talbert

04/12/2022, 3:56 PM
yes, good point
(though I do get the feeling that aspect actually leads devs to not think much about governance efficiency. )
n

NickSuite

04/12/2022, 4:48 PM
I don't agree with "unlimited governance". Map function have 1000 units. Reduce have 5000 units. If you consume these units, the script throws an error.
m

mattdahse

04/12/2022, 5:10 PM
Map/reduce offers a lot more than just parallel processing over scheduled scripts. Even with concurrency set to 1, you get the two-stage processing, automatic yielding, the sort/shuffle logic, and unlimited governance to do what needs doing. Yes, each map has an allowance of usage, but you get as many map instances as you need, so you can process a million transactions without worrying about governance.
s

Shawn Talbert

04/12/2022, 5:12 PM
the multi-stage processing and sort/shuffling are not improvements over scheduled scripts, especially if concurrency = 1
💯 1
n

NickSuite

04/12/2022, 5:47 PM
If you put it that way @mattdahse, then yes, I agree with the word of "unlimited governance"
d

darrenhillconsulting

04/12/2022, 8:10 PM
Woah! Great feedback.
So, my default async bulk processor is Map/Reduce. I mean, it forces proper code decoupling, and offers 'unlimited governance' ... so, I'm not apposed to Scheduled Scripts. The real reason I asked was I found a bug in a customers' API ... where concurrent calls were causing major problems. So, I was hoping (and validating with you folk) that moving my concurrency to 1 might allow me to keep my solution (rather than port to a schedule script)
c

creece

04/13/2022, 1:11 AM
Setting it to 1 should solve that issue