Before moving on to write analytics for your device, let's get an understanding of the basic architecture behind IoTS analytics.
The WSO2 IoT Analytics Framework combines real-time, batch, interactive, and predictive (via machine learning) analysis of data into one integrated platform to support the multiple demands of the Internet of Things (IoT) solutions, as well as mobile and Web apps as illustrated by the image shown below:
As a part of the WSO2 IoTS analytics platform, WSO2 Data Analytics Server (WSO2 DAS) and WSO2 Complex Event Processor (WSO2 CEP) introduces a single solution with the ability to build systems and applications that collect and analyze both real-time and historical data and communicate the results. It is designed to treat millions of events per second and is capable of handling Big Data volumes and Internet of Things projects.
WSO2 DAS/CEP not only process data as events but also interact with external systems using events. An event is a unit of data, and an event stream is a sequence of events of a particular type. WSO2 IoTS Analytics Framework compromises of aggregating, analyzing and presenting a given IoT related use case in a proper way. This definition is paramount when designing a solution to address a data analysis use case. Aggregation refers to the collection of data, analysis refers to the manipulation of data to extract information, and presentation refers to representing this data visually or in other ways such as alerts. Data which you need to be monitor or process sequentially go through these modules.
Before going forward, get yourself familiar with these buzzwords (Event receivers, Event streams, Event processors, Event publishers, Data Store, Analytics Spark, Data Indexing, Analytics Dashboard, Event Sinks). For more information, see the WSO2 DAS architecture.