Chopping the Monolith

If you attend conferences or read technical articles, you could think that microservices are the correct and only way to build a system at the moment.

Despite some pushback from cooler heads, the default architecture is microservices. In this post, I'd like to argue why it's wrong. I'll first get back to the origin of microservices and the fundamental reason to use them. Then, I'll describe why microservices don't fit most organizations' structures. Afterward, I'll move to detail the root problem to solve. I'll conclude by proposing an alternative, less-risky approach.

Why Time Dimension Is Vital in IoT and How a Rules Engine Can Reduce Complexity

The time dimension increases the complexity of application development for software developers that are building logic with conditional statements (rules) that need to change over time.

“Time is an observed phenomenon, by means of which human beings sense and record changes in the environment and in the universe. Time has been called an illusion, a dimension, a smooth-flowing continuum, and an expression of separation among events that occur in the same physical location.” — whatis.techtarget.com

A Complete Tutorial on the Drools Business Rule Engine

Business rules work very well to represent the logic for certain domains. They work well because they result intuitive and close to the way of thinking of many types of domain experts. The reason for that it is that they permit to decompose a large problem in single components. In this way, the user does not deal with the orchestration of all the single rules: this is the added value provided by the business rule engine.

In this article, we will discuss one specific example of an application written by using business rules. We will write the rules to decide, which email to send to the subscribers to a newsletter. We will see different types of rules and how we could express them using the Drools Rule Language. We will also see how to configure Drools (spoiler: it will be easy) and have the system elaborate on the rules to produce a result we can use.

A Guide to Rules Engines for IoT: CEP Engines

What Are CEP Engines?

Although part (and predecessors) of stream processing engines, Complex Event Processing engines deal with events in a slightly different (and better) way than their bigger and younger siblings.

We see CEP engines being deployed in edge computing nowadays, where locality, low latency, and low hardware footprint are important. CEPs are a good fit whenever a low footprint is required but don’t scale well since all event processing happens in-memory.

A Guide to Rules Engines for IoT: Forward-Chaining Engines

What Is a Forward-Chaining Rules Engine?

An inference engine using forward chaining applies a set of rules and facts to deduce conclusions, searching the rules until it finds one where the IF clause is known to be true. The process of matching new or existing facts against rules is called pattern matching, which forward chaining inference engines perform through various algorithms, such as Linear, Rete, Treat, Leaps, etc.

When a condition is found to be TRUE, the engine executes the THEN clause, which results in new information being added to its dataset. In other words, the engine starts with a number of facts and applies rules to derive all possible conclusions from those facts. This is where the name "forward chaining" comes from — the fact that the inference engine starts with the data and reasons its way forward to the answer, as opposed to backward chaining, which works the other way around.

Should You Use a Rules Engine to Manage Business Logic in IoT Applications?

It's not obvious to non-developers just how different computer-expressed logic is from human-expressed logic. It's one of the reasons why developers have a difficult time translating user requirements into conditional statements (rules) when designing software.

Knowing a language means being able to produce an infinite number of sentences never spoken before and to understand sentences never heard before. For us humans, it's natural to say things like Tom likes football and pancakes. For non-developers, the mental effort required to translate such statements into a computer language might not be that obvious. If we were to literally write the same statement into a computer program, it would mean (for the machine) that Tom is happy only when watching football while eating pancakes.