# Fuzzy-Based Multi-Modal Query-Forwarding in Mini-Datacenters
## 1 Introduction
To dynamically manage the granularity of the query flow, the framework is integrated with fuzzy logic intelligence, enabling it to select between two query-forwarding strategies based on the following:  
* The ratio of fitted gateways to the deployed gateways, and
* The ratio of overloaded gateways to fitted gateways. The coarse-grain approach is preferred in a high-frequency query flow and/or low-resource scenarios for efficient data flow management, while the fine-grain strategy is more suitable for a low-frequency or resource-rich situation, where enhanced reliability is essential. Our contributions in this paper are fourfold:  
1. Modeling IoT-WSN as a mini-datacenter,2. Modeling the query-response task-flow within the proposed mini-datacenter,
3. Deriving a relationship between redundancy, reliability, backlog, and buffer occupancy to account for the influence of these factors on query forwarding, and
4. Defining fuzzy membership functions to select the granular forwarding strategies to manage the query flow. In this paper, we have proposed a mini-datacenter in the form of a wireless sensor network for IIoT data collection, integrated with an intelligence query forwarding framework. The framework uses an objective function to determine the most effective number of redundant gateways that maximize the reliability while minimizing buffer overload. We have proposed and developed two forwarding strategies, such as coarse-grain and fine-grain, where the granularity is defined by the system's adaptability and reliability needs. To support dynamic forward decision-making, we have defined fuzzy-logic membership functions that describe the relationship between fitted gateways and buffer occupancies, and help to select the level of granularity at the time of forwarding. We have found the effectiveness of the proposed mechanism from three aspects: (i) locating gateways with saturated buffer spaces that may lead to data drop, (ii) real-time inclusion or exclusion of gateways based on buffer status, and (iii) introducing controlled redundancy to maintain the reliability of the responses while avoiding buffer saturation. We have implemented the framework prototype in a Python 3.12.7 programming environment and carried out a set of experiments with gateway counts ranging from 10 to 100 to analyze the scalability and robustness in complex environments. The experiments were repeated multiple times under varying environmental conditions, and the results were analyzed using several statistical evaluation methods, such as confidence intervals and error bars. The confidence interval analysis across varying gateway counts shows increasing reliability with narrower uncertainty bounds, highlighting the consistency and precision of the framework's performance. The experimental results in network environments with heavily loaded buffers demonstrate that the developed framework managed the query traffic in mini-datacenters, maintaining over 95% reliability in most transmissions. The rest of the paper is organized into six sections. Section 2 details the related work, and Section 3 discusses the architecture of the mini-datacenter. Section 4 details the modeling of query flow within the proposed mini-datacenter and the modeling of input and output fuzzy membership functions. Section 5 presents the computational flow of the proposed method, and Section 6 presents and discusses the outcomes of the experiments. Finally, Section 7 concludes the paper.