Functions
Streamdal functions are high-performance routines that can be written in various languages, including JavaScript, TypeScript, Rust, and Golang. These functions are executed using WebAssembly (Wasm), ensuring maximum speed and efficiency.
Streamdal functions serve to correct, modify, or alert, either in real-time or as part of a batch job, depending on the specific use case. Functions in Streamdal are designed to be versatile, handling a variety of tasks and working in conjunction with other components to ensure smooth operation and data integrity.
There are four main types of functions in Streamdal:
Collection Functions
These functions operate on collections, allowing you to perform actions on events as they are ingested. This can be used to clean or modify incoming data in real-time before it is stored. Such as correcting a bad schema value.
Dead Letter Functions
Dead Letter functions are primarily used to correct events that have been sent to the Dead Letter due to schema issues. These functions can correct the schema issues, allowing the events to be replayed back into the system.
Replay Functions
Replay functions are used when events are being replayed from the Dead Letter or a Collection back into the system. These functions ensure that the replayed events are correctly reintegrated into the original collection or directed to the appropriate destination.
Monitor Functions
Monitor functions are used to alert in real-time when certain conditions are met. These functions can be configured to alert on various conditions such as schema changes, data flow rate changes, or when an event field matches certain criteria.
Each function type serves a crucial role within the Streamdal ecosystem, ensuring the smooth ingestion and processing of events, the correction of schema issues, and the effective monitoring of your data. By leveraging these functions, you can take full advantage of Streamdal’s robust and flexible capabilities.