# Recent Advances in Internet of Things Solutions for Early Warning Systems: A Review
## 3 IoT Architectures for EW Systems
### Reference Architecture
#### 3.1.3 Application Layer  
The application layer is at the top of the IoT layered architecture. It uses the data received from the communication layer to provide services or operations [24], possibly combining collected data with historical data, and satellite or weather forecasting data from other sources. The application layer implements algorithms to generate and propagate warnings if a disastrous event is imminent; it can provide databases to store old data and current data in real time; it can make predictions and forecasts, and so on. User interfaces can be created on top of the application layer and, in service-oriented-architectures, service management and middleware layers can be interposed between the Application Layer and the Communication layer to act as a bridge between the devices and the applications, and to ensure interoperability [39]. Cloud-based IoT platforms provide almost limitless storage and computational capabilities. There are many existing Cloud platforms that provide different services useful for IoT solutions [40]. Data analytics is an essential part of IoT EW systems, that might have to deal with large amounts of data from different sources, geographic locations and points in time that need to be processed and analyzed. Data analysis can become the bottleneck of an EW system [27], and therefore cloud platforms should be associated with modern EW systems [19]. Cloud computing also comes with problems such as latency when the amount of data to process is too big, but Fog/Edge computing can reduce the weight on the application layer. When dealing with a great number of heterogeneous devices, sensors and data sources, like in EWSs, a semantic approach can also be used to enhance queries and data processing [11].  
Fog or, more generally, Edge computing can be implemented between the Communication layer and the Application layer to provide a faster response and better quality than solutions based solely on Cloud computing [24]. While Cloud services provide essential storage and processing capabilities, transmitting big amounts of data from many sensors or data sources can be costly, and processing a lot of raw data in dedicated servers will add a latency that can affect the performance of the EW system. In fog and edge computing, the data from the perception layer is first processed at the network edge (on gateways or even end devices) before transmitting it to higher layers, for example to a cloud service, so that latency and the amount of data to send to the cloud can be reduced. This can also help overcome bandwidth instability [19] (since processing data at the edge can lower the bandwidth consumption [39]) and intermittent network conditions when environmental hazards occur or during the disaster response phase [41]. Moreover, Edge Computing is also suitable for devices with limited battery life [42]. Fog nodes can also implement algorithms to make predictions based on the data collected from the perception layer [26]. It is also possible to embed ML models in Edge devices, but complexity and memory constraints could make it more challenging [39].