# Replicating File Segments between Multi-Cloud Nodes in a Smart City: A Machine Learning Approach
## 4 Reference Models-Full Replication  
Replica management service is responsible for initiating data replication when needed, in addition to creating or deleting copies of files, or replicas, stored in a specific storage system. The design of the replica management service is modular, with several independent services, i.e., task scheduling, resource discovery, etc. and interacting via the Replica Manager (RM). The RM coordinates the interaction between all components of the replica management system i.e., if a new storage location offers better performance and availability for access to or from a particular location, then the replica manager will create a replica at the new location [43]. In addition, cloud, edge server and IoT environments are highly dynamic whereby the resource's availability and performance change constantly. Therefore the replica management service is responsible for discovering new replicas which may be added to or deleted from different locations.  
Replica creation and/or selection is the second representative of the high level services provided by a cloud storage. Cloud storage technology was developed to share data between different organisations across distributed geographical locations in an efficient way. Cloud storage uses a data replication technique to move data closer to users thereby improving data access performance [44]. The replica selection service is responsible for finding the best replica that will minimise the transfer time, i.e., finding the nearest copy to the user, so the selection process uses the absolute performance technique (e.g., speed, cost or security). Cloud Information Services (CIS) is a cloud service which provides information about network performance. The replica selection service uses this information and the information provided by metadata repository (i.e., file size, location, etc.) to determine which storage will yield the fastest data access [45].  
As previously mentioned, at present, the size of the data that need to be accessed daily on the cloud, edge servers and IoT is in the order of thousands of petabytes and by 2025 the amount of data generated globally will reach 175 ZB (zettabytes), the IoT applications and devices will be the main source of this amount [46; 47]. Ensuring efficient access to such vast and widely distributed data is a serious challenge to network and cloud designers. Replication is one such widely accepted technique in distributed environment by storing the data at more than one site. If a data site fails, the system can still continue to operate using replicated data, increasing availability and fault tolerance. At the same time, as the data are stored at multiple sites, the request can find the data close to the site where the request originated, thus increasing the efficiency of the system, lowering bandwidth consumption and improving scalability of the overall system [48; 49].  
In the following Figure 1 replicas environment is presented in a simple manner. Storage resource 1, storage resource 2, storage resource 3, storage resource n, are distributed resource locations and connected through a middleware infrastructure. A file, i.e., File X used to hold the data, is stored in storage resource 2 and all other resources replicates File X. In this example the benefits of replication are clear (as storage resource 1 and storage resource 3 are close to the user compared to storage resource 2, where the file was originally stored). The access cost of files can be decreased, thus improving the performance and availability even if three out of four storage resources are down.