# Improving Incident Response in Big Data Ecosystems by Using Blockchain Technologies
## 5 Integration of Blockchain Systems into a Big Data Ecosystem: A Case Study
Regarding the technologies used to implement both the big data ecosystem and the blockchain systems, a summary scheme is shown in Figure 7. The big data ecosystem is implemented mainly on an Apache Hadoop environment. Sensor data is thus stored in the Hadoop HDFS (Hadoop Distributed File System), which is used by HBase, to make for easier access and to perform the different queries. As far as data analysis is concerned, this is performed using Apache Spark, since it must be executed in near real-time. The results obtained from the execution of the analysis algorithms are displayed on a dashboard implemented using the Dash by Plotly tool. The Apache Hadoop YARN tool is used to coordinate the jobs and manage the resources of the different nodes of the big data ecosystem. It is important to highlight the fact that the implementation of the Blockchain System should not place an extra computational burden on the CPS system since it is separated from it. On the other hand, when executing the machine learning algorithms there are two possibilities: that they are executed within the same big data ecosystem that supports the CPS system or that they are executed in a new  
Figure 7: Technological instantiation. system. Checking the performance that these two possibilities could have is out of the scope of the main objective of the paper, and therefore, it is considered as a future work task. It should also be mentioned that to implement blockchain systems it was decided to make use of Hyperledger Fabric technology. This technology allows us to create a private blockchain network composed of a set of nodes authorized for the introduction of events and incidents that happen in the CPS environment. When establishing a consensus mechanism, we decided in our case to make use of proof of authority, since only authorized network nodes can introduce new blocks and transactions in the chain. In Hyperledger, the data transactions that are added to the blocks are entered in JSON format. By way of example, Figure 8 shows a simplified example of the Smart Contract used to create events when there is any action performed by an actuator of the hydroponic crop: (a) automatically, due to a decision of the big data environment, or (b) by a user registered in the system through the dashboard. Figure 8 shows how a new event is created in the system by including its main characteristics, such as the type of action, or what triggered the event. In addition, methods are included for obtaining a specific event through its ID, the events that happened in a time interval (if no interval is introduced, all the stored events will be obtained), the events that happened of a specific type, and the events stored according to the type of trigger that originated them (big data or user). These functions allow the incident response team to perform analytical studies and apply the machine learning process to detect incidents that are later stored in the incident blockchain following a similar Smart Contract format. Figure 8: Smart contract to handle events.