Difference Between Scheduled script and Map/Reduce script in 2.0

Hello every one

Using map/reduce script we can have parallel data processing  both scheduled and map/reduce  script are used for huge data handling  is that only difference  if any one have points please answer

Rookie Asked on April 27, 2020 in SuiteScript.
Add Comment
2 Answer(s)

Map/reduce handles large data sets more easily. You can utilise a search input in the getInputData stage and pass the data straight to a following stage without the need to paginate result sets. Returning a search ID also apparently allows for an extended search execution timeout.

The SS2.0 documentation states that Script.percentComplete is only useable with scheduled searches. This may prevent map/reduce scripts being able to report progress – but I’m not sure whether this is an oversight with the documentation. I’ve planned on testing a map/reduce to see if Script.percentComplete works, but not had the chance as yet.

Beginner Answered on April 27, 2020.

Additionally You’ll also have to handle the Script Governance yourself for Scheduled Script (Reschedule/Yield if running out of Points) whereas the M/R will yield automatically.

on April 27, 2020.

Thanks But Can u  please specify any specific use cases where we will use map/reduce script  I havent used it much most of the time I used scheduled,suitlet and restlet and other scripts

on April 29, 2020.
Add Comment

The map/reduce script type is designed for scripts that need to handle large amounts of data. It is best suited for situations where the data can be divided into small, independent parts. When the script is executed, a structured framework automatically creates enough jobs to process all of these parts. You as the user do not have to manage this process. Another advantage of map/reduce is that these jobs can work in parallel. You choose the level of parallelism when you deploy the script.

Like a scheduled script, a map/reduce script can be invoked manually or on a predefined schedule. However, map/reduce scripts offer several advantages over scheduled scripts. One advantage is that, if a map/reduce job violates certain aspects of NetSuite governance, the map/reduce framework automatically causes the job to yield and its work to be rescheduled for later, without disruption to the script. However, be aware that some aspects of map/reduce governance cannot be handled through automatic yielding. For that reason, if you use this script type, you should familiarize yourself with the SuiteScript 2.0 Map/Reduce Governance guidelines.

In general, you should use map/reduce for any scenario where you want to process multiple records, and where your logic can be separated into relatively lightweight segments. In contrast, map/reduce is not as well suited to situations where you want to enact 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.

All map/reduce scripts are powered by SuiteCloud Processors, which handle work through a series of jobs. Each job is executed by a processor, which is a virtual unit of processing power. SuiteCloud Processors are also used to process scheduled scripts. However, these two script types are handled differently. For example, the system always creates only one job to handle a scheduled script. In contrast, the system creates multiple jobs to process a single map/reduce script. Specifically, the system creates at least one job to execute each stage. Additionally, multiple jobs can be created to handle the work of the map stage, and multiple jobs can be created for the reduce stage. When the system creates multiple map and reduce jobs, these jobs work independently of each other and may work in parallel across multiple processors. For this reason, the map and reduce stages are considered parallel stages.

SuiteScript 2.0 Scheduled scripts, you cannot set recovery points and you do not have the ability to yield. There is no SuiteScript 2.0 equivalent to the SuiteScript 1.0 nlapiYieldScript() and nlapiSetRecoveryPoint() APIs. If you need to process a large amount of data or a large number of records, use the SuiteScript 2.0 Map/Reduce Script Type instead. The map/reduce script type has built in yielding and can be submitted for processing in the same ways as scheduled scripts.

 

 

Source: Netsuite help

Rookie Answered on April 28, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors: Tipalti