Store and Forward Data Flow
Although the system offers settings that can affect the pipeline, by default the data flow occurs as follows:
- Data is generated in some system.
- Data is placed in a memory buffer.
- If not removed from memory buffer in some time (the Write Time), or if a certain amount of data accumulates (Write Size), it is placed in the local cache.
- The data sink, based on a database connection, pulls data in first from the local store, and then the memory buffer, based on the Write Time and Write Size settings under Forward Settings.
- If the data fails to forward, either due to an error in the connection or in the data itself, it is returned to the buffer or cache.
- If the data errors out too many times, it becomes quarantined.
- Quarantined data can be managed through the Gateway, and can be deleted or un-quarantined, once the error is resolved.
Understanding the Forward Triggers
Data is forwarded from one stage to the next based on the Write Time and Write Size triggers. These settings work as an either/or manner, meaning that if either of them is surpassed, the data is forwarded. One important point to note is that the Write Size setting influences the transaction size of similar data to be forwarded, and therefore can have a big impact on performance. As a result, the Write Time should normally be used as the controlling factor, with the Write Size set to something that will provide reasonable transactions, like 100.
Single Connection Policy
While database connections have a pool of multiple connection (8 by default), the Store and Forward engine only uses on one of those connections. The system heavily optimizes queries by grouping multiple queries into a single transaction before sending the data off.
Store and Forward for Reliability
The store-and-forward system settings, while seemingly limited, offer a good deal of flexibility in tuning. Different types of situations and goals will likely require different configurations.
When the safety of the data is a concern, the goal is to get the data stored to disk as quickly as possible in order to minimize risk of loss due to a power outage or system failure. The local cache plays a crucial role in this, allowing the system to store data locally for any amount of time until the remote database can accept it. This protects against network failures and database failures, as well.
By setting the write size and write time of both the local cache and forwarder to low values, the data spends less time in the memory buffer. While the memory buffer can be set to 0 to bypass it completely, this is not usually recommended, as the buffer is used to create a loose coupling between the history system and other parts of Ignition that report history. This disconnect improves performance and protects against temporary system slowdowns. In fact, it is recommended that for reliable logging, this value be set to a high value, to allow the maximum possible amount of data to enter the system in the case of a storage slowdown.