# Moving towards Smart Cities: A Selection of Middleware for Fog-to-Cloud Services +
## 1 Introduction  
Internet of Things (IoT) paradigm is a noticeable emerging concept that has succeeded in becoming an integral part of our daily life by enabling any object around us to produce, connect, and transfer data via network technologies (i.e., 4G). The smart city is one of the concepts that use the ability of IoT technologies to build an immediate bridge between intelligent services and citizens [1]. Consequently, the smart city paradigm is currently gaining enormous popularity by giving birth to new efficient development of societies and industries. To support this approach further and improve the urban citizens quality of living, many critical infrastructures related to IoT data services are being considered to enhance and realize the vision of smart cities, such as smart healthcare [2], smart grid [3], smart transportation [4], management of energy [5], surveillance systems [6], or smart building [7]. Thus, the IoT technologies have supported various domains with specific needs to perform daily tasks, enhancing the quality of living, as well as the governance of smart cities. Meanwhile, most available IoT services have become data-driven, which allows them to achieve better recommendations and predictions of future trends of events in smart cities, such as the recommendation of the best available car parking lot. For that reason, the IoT technologies need theincorporation of several techniques to meet the requirements of data, which include seamless real-time access, sharing, storing, processing, and analyzing data anywhere at any time. Cloud computing is one of the technologies that has been proposed to enrich the features of IoT applications by providing unlimited services represented by X as a service [8; 9] (i.e., storage as a service) and designing suitable programming models for smart city IoT applications. Consequently, it is possible for IoT data to pave the way for sustainable development in smart cities and their related technologies. Despite the ability of cloud platforms to provide sophisticated services, many IoT applications prefer to process data and make decisions locally rather than managing and treating IoT data remotely. Further, the access network to cloud platforms requires efficient and stable use of the bandwidth, which is not applicable to IoT-cloud connectivity which might be unreliable or poor in performance (throughput, latency). Consequently, it is beneficial to use the edge services (i.e., fog services) that are closer to IoT devices to improve the availability and scalability of data at the edge of computing [10]. Due to the advantages of edge computing (i.e., mobility support), IoT devices could access the proximate edge resources directly, adapt their request according to location awareness, process their computing tasks, and get results with minimum latency. However, cloud computing with its unlimited resources remains the best central platform to handle IoT tasks while edge computing is targeted to offer distributed local processing with minimized and predictable latency. That pushes us to ask what helps us to determine the best criteria that are driving the decision between a closer or a remote platform for processing IoT data. In this paper, we address this challenge with the help of multi-criteria decision analysis (MCDA) [11; 12] applied to the context of the edge/cloud paradigm. To this end, we first provide a summary of the most common technologies related to edge computing. Notably, we focus on the coordinated fog-to-cloud platforms since this kind of collaborative system integrates the required preferences for making the IoT devices self-contained and autonomous in real time. Then, we review the utilization of the MCDA methods in edge computing, since the MCDA approaches are very well known as a collection of techniques that offer comparison and comprehension of complex problems, enriching them with different forms of information. Next, we propose a middleware architecture to choose an adequate service that is recommended for processing IoT data.