Strategies Configuration
In this document we guide you through the configuration of Strategies directly in the Console.
Write your strategy
The strategy functions can be executed either by:
- the Real-Time Updater, by the usage of the Projection Changes Schema configuration;
- the Single View Trigger Generator, by the usage of either the Projection Changes Schema configuration or the Kafka Projection Updates Configuration.
Technical limitation
In your custom files you can import only the node modules present in the following list:
Strategies type
This information are valid only when using a Real-Time Updater with Projection Changes.
Each strategy is associated with a type, which usually (and by default) corresponds to the name of the Single View for which it is configured. When using a Real-Time Updater with Projection Changes, this type should match the one declared in the TYPE
environment variable of the Single View Creator(s) associated with the Single View. The reason is that, behind the hood, the strategy type is written in the Projection Changes record by the Real-Time Updater and the Single View Creators will discern which records to process based on it.
There may be scenarios in which you want more than one Single View Creator associated with the same Single View, to process Projection Changes records with different types (as explained here): this may happen, for example, to isolate a critical flow in which one projection concurring in a Single View is updated much more often than the others, needing a dedicated set of services to ensure maximum efficiency.
To achieve this separation, one can use the Type field of the strategies table in the Single View details page to associate a specific type to a subset of strategies.
For the flow to work correctly, the types declared in the strategies table should match the type of at least one of the Single View Creators associated with the Single View, and viceversa.