Advice needed: IoT Streams with Elixir: Rules engines?

Hi there,

We are running an internal platform for IoT sensors. Elixir is perfect for this especially with projects like genstage/flow/broadway.

However, we would like to integrate a rules engine for our data streams that can trigger actions like alerts, notifications based on thresholds, change over time, etc.

I’m therefore looking for options and frameworks that already exist and that we could a) easily plug in (e.g. using queues) and b) allow for seamless integration in our Phoenix application.

It’s quite difficult to find out what to search for, so far Influx Capacitor (TICK stack) sounds very promising. Besides that we could probably also use something like white labeled Node-Red (WYSIWYG) or parts of the ELK stack.

Does anyone have experience here or can share some recommendations/suggestions?

Thank you very much,
Christoph

2 Likes

I have used a camunda rules modeler to create executable xml’s within a bpms. The interpreter for the rules I wrote in elixir (for one of the ruletypes). But camunda has it’s own interpreter written in java also. I never tried it, but here is a link https://camunda.com/products/dmn-engine/

1 Like

Are pipelines not enough?

event
|> rule_a()
|> rule_b()
|> rule_c()

Or like you want to have a file that defines rules dynamically?

2 Likes

I think you could even have your rule modules, then a list of rule names that mapped to those modules and then dynamically built that pipeline based on the input of rule names from somewhere (a file, a database record, etc).

2 Likes

Here is an intro to camunda dmn https://camunda.com/dmn/
The wysiwyg modeler is easy to integrate in your phoenix application.
There is drools also https://www.drools.org/ (eclipse ide plugin for development so no webfrontent I suspect), less lightweight (but mind you: “Drools Fusion (complex event processing features)”!), I do not know if it’s easy to integrate.
About different rules languages: https://stackoverflow.com/questions/52299097/drools-with-dmn-vs-drl