Map Reduce Script

Map/Reduce script is an alternative to a scheduled script which can handle/process a large amount of data. It is best suited for scenarios where data can be divided into small and independent parts. When the script is executed, a structured framework automatically created enough jobs to process all of these parts. No need to manage process, all jobs can be worked in parallel. Same way as a scheduled script, a map/reduce script can be triggered/invoked manually or on a predefined schedule.

Advantage Over Schedule Script:
Automatically create yield if the script terminates or violates Netsuite governance, the script automatically cause
the job to yield and its work to be rescheduled for later.

Disadvantage:
Map/reduce script is not well suited to situations where you want to write a long, complex function for each part of your data set. A complex series of steps might be one that includes the loading and saving of multiple records.

Map/Reduce Use Case:
 Map/reduce is ideal for scenarios where you want to apply the same logic repeatedly.
Example:
1. From list/array , transform each requisition into a purchase order.
2. Search transaction record and apply discount on each one
3.Search for customer record that appears to be duplicates ad then process each as per business rules.
4. search for cases and assigned to sales rep.
5. for each new order, create supporting document and upload it to external server.

Map/Reduce Script Execution Stages:
This script executed in five stages.Every stage occurs in a specific sequence.
User can control script’s behaviors in stages.

1. getInputData stage
2. map Stage
3. Reduce Stage
4. Summarize Stage

Leave a comment

Your email address will not be published. Required fields are marked *