Defining your analytics as a function
In order to get started with architecture, let's build an idea from the ground up using the different building blocks that are necessary to make this a minimal working product.
The first thing that you need to have for this is an understanding of the type of real-time analytics that you want to execute.
For now, let's go with the same example as in the previous chapter: a real-time business rule that prints an alert when the temperature or acidity of our production line is out of the acceptable limits.
In the previous chapter, this alert was coded as follows:
Code block 2-1
def super_simple_alert(datapoint):
if datapoint['temperature'] < 10:
print('this is a real time alert. temp too low')
if datapoint['pH'] > 5.5:
print('this...