Stream Manager - Before we go and describe the stream and how do define things and process, let's just look at the APIs that's required to do most of the stuff. Now let's get into the concept of BangDB Stream Manager.

Stream Manager is defined as set of attributes that together form a particular stream event and then operations that can be done on these events. Let's take an example of very simple case where we have few attributes are coming from different streams. For ex; temp, pressure data stream, etc. for any IOT case. Then we can define the stream as following:

{
   "schema":"myschema",
   "streams":[
      {
         "name":"temp_stream",
         "type":1,
         "swsz":81600,
         "inpt":[
            
         ],
         "attr":[
            {
               "name":"temp",
               "type":11,
               "stat":3
            },
            {
               "name":"point",
               "type":9
            },
            {
               "name":"sensor_name",
               "type":5,
               "kysz":18,
               "sidx":1,
               "stat":2
            }
         ]
      },
      {
         "name":"pressure_stream",
         "type":1,
         "inpt":[
            
         ],
         "attr":[
            {
               "name":"pressure",
               "type":11,
               "stat":3
            },
            {
               "name":"point",
               "type":9
            },
            {
               "name":"sensor_name",
               "type":5,
               "kysz":18,
               "sidx":1,
               "stat":2
            }
         ]
      }
   ]
}

This is basic structure to define the streams. Let's discuss more on this.

Schema

Since for any real use case, we will have to deal with more than single stream. Then we need to define the operations that would be done on these streams. Hence we will need to put all these streams and the operations on the stream data in some wrapper.

We use "schema" as a container for the streams and operations on them. This also allows us to isolate two different schemas within the system. You could also think of schema to segregate based on the different solutions or apps or users within the system, thereby kind of namespace which will ensure sanity across different structures

Stream

This is a collection of attributes for a particular data source. For ex: temperature sensor, payment transaction events, telecom cdr data, pizza order-delivery data etc. This is how we will define a stream in simple way: