Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a system that must output decisions and alerts based on input read from a messaging queue. This system will hold state about all objects in memory and update this state based on input from the messaging queue.

Logic must be applied to data flowing into the system and as the data updates the system's working memory.

Example:

I have 50 quad-rotor drones that report their current state to a RabbitMQ queue. This includes a (latitude,longitude) location property, a 'time left on battery' property, and an integer battery charge percentage property. The rules run on each drone message would look like:

if (drone.charge_left < time_to_home_from(drone.location)) {
  drone.state = EMERGENCY; // land immediately
  send_alert("Drone must be recovered!"); // put an alert on another messaging queue
} else if (drone.charge_percentage < some_threshold) {
  drone.state = RETURN_HOME;
  send_alert("Drone is coming back for recharging");
}

... and so on

Drools seems like a decent candidate for this task but only because few rules engines seem to be still under development, and it has the biggest name so to speak.

On the flip side, the architecture of Drools seems heavyweight and outdated. I've seen a lot of use cases in the financial domain, which is fairly far from my use case. I'm leaning towards using a graph db based solution (ex. Neo4j), where each of the rules is a node containing an MVEL predicate and some type of Alert that is sent out when the rule's predicate evaluates true.

How would you architect a system like this in 2014?

EDIT: I forgot to add that only the engineering team would ever look at or modify these rules, but it would be desirable for values like some_threshold to be tunable by non-technical teammates through some web interface.

share|improve this question

1 Answer 1

Drools inference engine is not that heavy. There are a bunch of use cases around rules engines that adds a lot of weight, but the foundation engine is supposed to be relatively speedy. Personally, I would go with the Drools Fusion system (for temporal processing) to learn the ropes of rules processing and how it is done. At a minimum, use it for a prototype.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.