Using Data-Aware Stored Procedures

A stored procedure is an application function call or subroutine that is managed in the database server. Because multiple SQLFire members operate together in a distributed system, procedure execution in SQLFire can also be parallelized to run on multiple members, concurrently. A procedure that executes concurrently on multiple SQLFire members is called a data-aware procedure.

Data-aware procedures use an extended CALL syntax with an ON clause to designate the SQLFire members on which the procedure executes. When you invoke a procedure, the SQLFire syntax provides the option to parallelize the procedure execution on:

SQLFire executes the user code in-process to where the data resides, which provides very low-latency access to colocated data. (This is in contrast to map-reduce job execution frameworks like Hadoop, where data has to be streamed from processes into a Task process.) Procedures often return one or more result sets. SQLFire streams a result set to one coordinating member that can perform the reduction step on the results (typically this involves aggregation, as in map-reduce). In SQLFire, the reduction step is carried out by a result processor. SQLFire provides a default result processor, and you can also develop your own result processor implementations to customize the reduction step.

The sections that follow describe how to configure, invoke, and develop stored procedure and result processor implementations in SQLFire.