I. Introduction
A transition from centralized cloud architectures to a distributed model encompassing cloud, fog and edge computing has led to a profound paradigm shift in the landscape of computing. This shift has been driven by the escalating demand for real-time processing, lower latency, and enhanced system performance [1]. Although this integration offers extensive connectivity, it originates new challenges in data processing, management and security. In order to mitigate those issues, Fog and Edge Computing have emerged as strategic responses, which extend the capabilities of Cloud Computing to the lower layers of a network, thereby facilitating real-time data processing, and reducing latency [2], [3]. Alongside this paradigm shift, the cloud-to-edge continuum [4] has become a key concept, representing a spectrum of computing resources and network latency that vary across the different layers. In the upper layer, there is cloud computing, characterized by high computing resources and high latency. On the opposite side of the spectrum, the collection of Gateways (GWs) forms the edge layer, characterized by low latency and processing resources. The fog layer is constituted by the network nodes in between the cloud and GW nodes. As one descends through the layers, from the cloud towards the edge, the computing resources of the nodes frequently decrease, but with the counter benefit of a reduction in latency. This reduction occurs from the increasing proximity to the GWs, which serves as an interface between the end-users and the continuum. While the differences in resources and latency between two consecutive layers in this continuum might be subtle, the contrast becomes stark when comparing the extremes: a cloud and an edge node. In parallel with these developments, there has been a shift in application architecture and development from monolithic to microservices-based applications. In contrast to monolithic architectures, where applications are single indivisible units, microservices architecture breaks applications down into smaller, functionally independent services, which offers enhanced scalability and flexibility as well as easier updates and maintenance, in benefit of cloud-to-edge environments [5]. Furthermore, it provides increased resilience by allowing partial failures instead of the entire application failing. Within this evolving paradigm, fog and edge computing and microservices, the strategic placement of applications services across the cloudto-edge continuum emerges as a critical factor in optimizing system performance. As addressed in this paper, the dare lies in the determination of the most effective placement of application microservices to optimize latency, a crucial aspect in real-time data processing in the continuum. The investigation that has been carried on delves into this challenge, exploring different placement algorithms and their impact on latency and network load balance. Bearing this goal in perspective, two primary approaches have been taken into focus: app-based and service-based placements. In app-based placement, all the services of one app are placed, preferably, on the same node, before proceeding with the following application. On the other hand, service-based placement performs the allocation of one service of each application at a time as a Round Robin (RR) through the services of each application. This research aims to evaluate the performance of these two approaches continuum environment context. By conducting simulations and analyses, the intention is to provide insights into which approach, appbased or service-based, effectively minimizes latency. The thesis hypothesizes that, in the context of high-load scenarios, service-based placement will demonstrate a superior capacity in reducing overall latency, thereby ensuring a more consistent application performance across the scenario and an overall lower response time for the end-users. The rationale behind this hypothesis lies in the limitation of node resources inherent in fog and edge computing networks. App-based placement, while optimizing latency for individual applications by attempting to allocate all its services in the same node, as node capacity exhausts, significant challenges arise, leading to the subsequent applications being pushed to nodes farther away from the edge, increasing the latency of that application. On the contrary, service-based placement, which sequentially allocates one service of each application before moving to the next, provides a more distributed spread of services over the topology. As the network load intensifies, this method is postulated to maintain a more uniform performance across all applications, avoiding the scenario where a few applications benefit from optimized performance at the expense of lower performance for others. The subsequent sections of this article delve into related work, exploring fog and edge computing, microservices, and their strategic placements. The methodology outlines simulation steps, parameters and algorithms. Following, the findings are presented in the results section, offering a comparative analysis of app-based and service-based placements in the cloud-to-edge continuum, interpreted in the discussion for system performance optimization. Finally, the conclusion encapsulates the key findings, affirming the hypothesis and suggesting future exploration.