# FODIT: A Filter-Based Module for Optimizing Data Storage in B5G IoT Environments
## 2 Background
### Filters
* _Transaction confirmation is not received within the defined time window._ In this case, the data is discarded from the temporary structure and is not inserted into the filter. It is possible that redundant data may be sent for storage in the DLT. In such cases, the hash of the data is stored as a key in the data structure, and a queue of duplicate entries is maintained under that key. If the first entry in the queue is successfully written to the DLT, the remaining duplicates are discarded. However, if the first transaction fails because \begin{table}
\begin{tabular}{l l l} \hline \hline
**Storage** & **Pros** & **Cons** \\ \hline \multirow{3}{*}{Local DB} & Low latency & Limited scalability \\  & High security & Sync complexity \\  & Network independence & Limited remote access \\ \hline \multirow{3}{*}{Cloud storage} & Scalable & Latency \\  & Cost-efficient & Privacy concerns \\  & Remote access & Network reliance \\  & B5G-enhanced bandwidth & Subscription cost \\ \hline \multirow{3}{*}{DLT} & Immutable & High overhead \\  & Decentralized trust & Scalability issues \\ \cline{1-1}  & Transparent & Transaction latency \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of storage scenarios in B5G IoT environments. the confirmation is not received within the defined time window, the system attempts to submit the second entry, and so on, until a transaction is confirmed or the queue is exhausted without any entry being successfully stored in the DLT. In the query phase, data is retrieved from the server provider. To do this, the system first checks whether the data exists in the cuckoo filter. If the filter confirms its presence, a search is performed in the server provider, which then returns the requested information. If the data is not found in the filter, it is assumed not to exist in the server provider, thus avoiding unnecessary queries and optimizing the retrieval process. ### Workflow

The FODIT model can be represented as a tuple \((D,SP,I_{a},Q_{a})\), where \(D\) is a set of IoT devices, \(SP\) is the server provider, \(I_{a}\) is the insertion algorithm, and \(Q_{a}\) is the search (query) algorithm. In the following paragraphs, each component of the tuple is explained in detail. IoT devices \((D=d_{1},d_{2},d_{3},\ldots,d_{n})\): This represents a set of \(n\) electronic devices. Through these devices, a data collection denoted by \(Dc\) is generated and subsequently stored in the server provider \(SP\). Server provider (\(SP\)): The server provider is an entity responsible for storing and managing the data collection \(Dc\). In this paper, \(SP\) may refer to a local database, cloud storage, or a DLT. Insertion algorithm (\(I_{a}\)): This is the algorithm used to perform data insertion in the FODIT module. It takes the data collection \(Dc\), acquired from the IoT devices \(D\), as input. Let \(x\in Dc\); then \(x\) is inserted into the cuckoo filter \(CF[b]\) using Algorithm 1. It is important to note that the cuckoo filter does not store the data \(x\) directly; instead, it stores a fingerprint \(f_{x}\), computed as shown in Equation (2), to optimize storage. Once the fingerprint is inserted into the filter, the data \(x\) is stored in the server provider \(SP\), completing the insertion process. For the particular case where \(SP\) is the DLT, the insertion algorithm first stores the data in the structure \(AuxS\). If the data \(x\) is correctly recorded in the DLT, then the data is inserted into the filter \(CF[b]\) and is deleted from the structure \(AuxS\). If there is another data item \(y\in Dc\) to be inserted into \(SP\), the algorithm first checks whether \(y\) is already in the filter \(CF[b]\) using the search function \(SF\), as described in Algorithm 2. If \(y\) is found in the filter, it is not inserted into \(SP\), ensuring that duplicate

Figure 3: The figure displays the phases for the FODIT module. data is not stored. This process is repeated for every element to be inserted into \(SP\). The complete process is summarized in Algorithm 4.