|
Search Solutions & Best Practices
Browse Solutions & Best Practices
|
Summary: Using the calculation offload pattern.
OverviewIn this pattern, all Excel functions and calculations are performed by the space (on the server side) asynchronously. This allows you to use Excel regularly, where calculations are performed on the space side simultaneously, until the calculation is finished; then, Excel is notified and the data is displayed in the spreadsheet. This pattern is based on the GigaSpaces master-worker pattern, and allows you to offload complex logic from Excel spreadsheets to run in parallel on the GigaSpaces cluster collocated with the data. A typical use-case for this pattern is a Value at Risk (VAR) calculation. The Excel user initiates a command to start a VAR calculation with specific parameters. This command is updated in the space using UDF. Once the command arrives, multiple Processing Units (PU) or spaces workers "pick up" the VAR task, execute it in parallel, and return the completed calculation result to the space (for example, with the status done). The completed results are then pushed to the Excel spreadsheet using RTD, which "listens" for a specific notification (for example, objects with status done); thus completing the workflow. Using this pattern is divided into 4 main steps:
1 – Loading DataAs a first step, you need to load your data from its current source to the space. GigaSpaces provides OpenSpaces as its main API. However, it is also possible to load data from different types of applications transparently, using different connectors implemented by GigaSpaces:
2 – Implementing AlgorithmAfter you've loaded your data to the space, you need to implement the algorithm which performs the calculation in the space, thus removing the load from Excel. To do this, you need to write a set of Processing Units into the space, which perform the calculation. 3 – Implementing Start Trigger and Passing ParametersAfter you've implemented Processing Units to perform the calculation, you need to tell them to begin calculating. You also need to pass the Excel function parameters to the space. Using Microsoft Excel UDF (User-Defined Functions), Excel writes an Entry to the space instructing the Processing Units to begin working.
4 – Implementing Finish TriggerIn the last step, you need to implement a finish trigger in the space, which tells Excel that the space has finished calculating; and finally, displaying your results in the spreadsheet. The space writes a notification to the Microsoft Excel RTD (Real-Time Data) server, which in turn notifies Excel that the space has finished calculating.
What's Next? |


Learn how to do this:
Add Comment