SQL Def Engine

Time-based workflows are a convenient way to run arbitrary SQL queries and SqlDefs according to schedule. The approach doesn’t scale. The workflow is a single thread on a single node. The advantage of multiple nodes or a DB server that could afford to run many concurrent queries is lost.

SqlDefExecution addresses these concerns. It provides a tool SqlDef query with params (like ItemId, DcId), corresponding to the engine task subnet. Then the engine spawns grid tasks for all subnets (i.e., for each item-DC combination in our example) and executes them on the grid.

Common Subnets


  • ITEM

    • Defined SqlDef uses only ITEM as a parameter

    • Grid tasks are generated by Item table

    • Engine parameters:

      • AggregationLevelName = ITEM

      • ItemEnterpriseName – required

      • ItemName – optional


  • ITEM-SITEGROUP

    • Defined SqlDef uses ITEM & SiteGroupLevel as parameters

    • Grid tasks are generated by SCC_Subnet table

    • Engine parameters:

      • AggregationLevelName = ITEM-SITEGROUP

      • ItemEnterpriseName – required

      • ItemName – optional

      • SiteGroupType – required

      • SiteGroupLevelName - optional


  • ITEM-DC

    • Defined SqlDef uses ITEM & DC as parameters

    • Grid tasks are generated by Buffer table

    • Engine parameters:

      • AggregationLevelName = ITEM-DC

      • ItemEnterpriseName – required

      • ItemName – optional

      • DCEnterpriseName – required

      • DCOrganizationName – required

      • DCName - optional

UI

Only supported via the JMX Console (or through Chain Engine). Does not support UI because users do not know about SQL Defs.

images/download/attachments/144836376/image2021-7-29_9-50-15-version-1-modificationdate-1645138907000-api-v2.png