In recent years, the Internet of Things (IoT) has led to the spread of cloud computing devices in all commercial, industrial and agricultural sectors. The use of cloud computing environment services is increasing exponentially with all technology applications based on IoT. Fog computing has led to addressing issues in cloud computing environments. Fog computing reduces load balancing, processing, bandwidth, and storage as data file replication from the cloud to the network closest to sensors in different geographic locations. Traditional cloud computing leads to an increase in response time and processing time, and processing in the performance of data replication. We need replication strategies to meet users' requirements across different geographic locations while effectively harnessing fog computing capabilities to optimally select and place data replication of IoT services on cloud resources. In this strategy, the identification and mode of the data replication problem are designed as a multi-objective optimization problem that considers the heterogeneity of resources, least cost path, distance, and applications based on replication requirements. Firstly, a new hybrid metaheuristic method, using the Arithmetic Optimization Algorithm (AOA) and the salp swarm algorithm (SSA), is proposed to handle the problem of selection and placement data replication in fog computing. This strategy, called AOASSA, depends on using fog computing to optimally select and place data replication of IoT services on cloud resources. Secondly, the Floyd algorithm is used to strategy the least cost path, distance, and data transmission in different geographic locations. To validate the AOASSA strategy a set of experiments was carried out to validate the proposed strategy AOASSA. The performance of AOASSA is tested and compared with other swarm intelligence. Experiment results show the superiority of AOASSA over its competitors in terms of performance measures, such as least cost path, distance, and bandwidth.