Stores

Set store defaults, or choose a log store or memory store to specify how data from a window is saved.

If you do not set a default store using the CREATE DEFAULT STORE statement, each window is assigned to a default memory store. You can use default store settings for store types and locations if you do not assign new windows to specific store types.

Memory Stores

A memory store holds all data in memory. Memory stores retain the state of queries for a project from the most recent server start-up for as long as the project is running. Because query state is retained in memory rather than on disk, access to a memory store is faster than to a log store.

Use the CREATE MEMORY STORE statement to create memory stores. If no default store is defined, new windows are automatically assigned to a memory store.

Log Stores

The log store holds all data in memory, but also logs all data to the disk, meaning it guarantees data state recovery in the event of a failure. Use a log store to be able to recover the state of a window after a restart.

Use the CREATE LOG STORE statement to create a log store. You can also set a log store as a default store using the CREATE DEFAULT STORE statement, which overrides the default memory store.

Log store dependency loops are a concern when using log stores, as they cause compilation errors. Log store loops can be created when you use multiple log stores in a project, and assign windows to these stores. The recommended way to use a log store is to either assign log stores to source windows only or to assign all windows in a stream path to the same store. If you use logstore1 for n of those windows, then use logstore2 for a different window, you should never use logstore1 again further down the chain. Put differently, if Window Y assigned to Logstore B gets its data from Window X assigned to Logstore A, no window that (directly or indirectly) gets its data from Window Y should be assigned to Logstore A.