InterSystems IRIS Business Intelligence: Building vs Synchronizing
Tags: analytics, tutorial, beginners, productivity
Published: 2022-04-27 17:17:57

InterSystems IRIS Business Intelligence allows you to keep your cubes up to date in multiple ways. This article will cover building vs synchronizing. There are also ways to manually keep cubes up to date, but these are very special cases and almost always cubes are kept current by building or synchronizing.

### What is Building?

The build starts by removing all data in the cube. This ensures that the build is starting in a clean state. The build then goes through all records specified by the source class. This may take all records from the source class or it may take a restricted set of records from the source class. As the build goes through the specific records, the data required by the cube is inserted into the cube. Finally, once all of the data has been inserted into the cube, the indices are built. During this process, the cube is not available to be queried. The build can be executed single-threaded or multi-threaded. It can be initiated by both the UI or Terminal. The UI will be multi-threaded by default. Running a build from terminal will default to multi-threaded unless a parameter is passed in. In most cases multi-threaded builds are possible. There are specific cases where it is not possible to perform a multi-threaded build and it must be done single-threaded.

### What is Synchronizing?

If a cube's source class is DSTIME Enabled ([see documentation](https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=D2IMP_ch_current#D2IMP_current_dstime_enabling)), it is able to be synchronized. DSTime allows modifications to the source class to be tracked. When synchronization is called, only the records that have been modified will be inserted, updated, or deleted as needed within the cube. While a synchronize is running, the cube is available to be queried. A Synchronize can only be initiated from Terminal. It can be scheduled in the Cube Manager through the UI, but it can't be directly executed from the UI. By default, synchronize is executed single-threaded, but there is a parameter to initiate the synchronize multi-threaded.

 

**It is always a good idea to initially build your cube and then it can be kept up to date with synchronize if desired.**

### Recap of differences

<table>
  <tr>
    <th>
       
    </th>
    
    <th>
      Build
    </th>
    
    <th>
      Synchronize
    </th>
  </tr>
  
  <tr>
    <th>
      Which records are modified?
    </th>
    
    <td>
      All
    </td>
    
    <td>
      Only records that have changed
    </td>
  </tr>
  
  <tr>
    <th>
      Available in UI?
    </th>
    
    <td>
      Yes
    </td>
    
    <td>
      No
    </td>
  </tr>
  
  <tr>
    <th>
      Multi-Threaded
    </th>
    
    <td>
      Yes, by default
    </td>
    
    <td>
      Yes, not the default
    </td>
  </tr>
  
  <tr>
    <th>
      Cube available for query
    </th>
    
    <td>
      No(*1)
    </td>
    
    <td>
      Yes
    </td>
  </tr>
  
  <tr>
    <th>
      Requires source class modification
    </th>
    
    <td>
      No
    </td>
    
    <td>
      Yes, DSTIME must be enabled
    </td>
  </tr>
  
  <tr>
  </tr>
</table>

 

## Build Updates

(*1) Starting with InterSystems IRIS 2020.1, Selective Build is now an available option while building your cube. This allows the cube to be available for querying while being built selectively. For additional information see [Getting Started with Selective Build](https://community.intersystems.com/post/intersystems-bi-getting-started-selective-build)

## Synchronize Updates

Starting with InterSystems IRIS 2021.2, DSTIME has a new "CONDITIONAL" option. This allows implementations to conditionally enable DSTIME for specific sites/installations.