# A Novel Global Key-Value Storage System Based on Kinetic Drives +
## 5 Design and Architecture
### Future Data Access  
There are three drive copies in the system, after a drive has been backed up to two other regions. When a user tries to access a key-value pair, it is best for the user to get these data from the region closest to his/her location. In order to support that, each metadata server for all regions maintains a table, recording the mapping between _key_ ranges and the IP addresses of all three drive copies, as shown in Table 2, which is an advanced version based on Table 1.  
In Table 2, \(M\) is the number of drives for storing the _original data (primary copies)_. Each _key_ range is covered by three drives, including _original drive_ in this metadata server's region and two additional backup drives in two other regions. The IP addresses of these three drives are stored in three columns respectively. For the example in Figure 7, the _key_ range of drive D3 in Region 4 and the IP addresses of drives D3 (Region 4), D18 (Region 5), and D21 (Region 2) are stored (drive D3 is the _original drive_ in Region 4) in metadata server MS4's table. In addition to these \(M\) rows, Table 2 also stores the mapping between _key_ ranges and IP addresses of those drives as additional backup copies for other regions. For example, in metadata server MS2's table, the _key_ range of drive D21 in Region 2 and the IP addresses of drives D3, D18, and D21 are also stored, because drive D21 is one backup copy of drive D3 in Region 4. When a user reads/retrieves a key-value pair, he/she first sends the _key_ to the metadata server in its region. After the metadata server receives the _key_, it checks the first \(\lceil log_{2}N\rceil\) bits to see in which region this key-value pair is supposedly stored, based on our indexing scheme described in Section 5.2. * If the _key_ falls into the same region as the user and is covered by the _key_ ranges of _original drives_ in this region, then the metadata server directly looks up its mapping table, finds out which drive covers the _key_, and returns the drive's IP address to the user. Finally, the user directly contacts this drive for data retrieval. For example, in Figure 7, if a user in Region 4 reads a key-value pair whose _key_ is covered by the _key_ range of the Drive 3 in Region 4, this scenario is applied. * If the _key_ is not covered by the _original drives' key_ ranges of the metadata server, but it is covered by the _key_ range of an additional drive as the backup copy of another region, a similar process happens. For example, in Figure 7, a user in Region 2 initiates a read request for data whose _key_ is covered by drive D21's _key_ range of Region 2. This _key_ is not covered by the _original drives_ in Region 2, because drive D21 is the additional backup copy of drive D3 in Region 4. The metadata server MS2 still returns the IP address of drive D21 of Region 2 to the user, since drive D21 is the closest one to the user (i.e., in the same region). * If the _key_ is neither covered by the _original drives' key_ ranges of the metadata server, nor the _key_ ranges of the additional drives as backup copies of other regions, the metadata server then \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Key Range** & **Original** & **1 st Backup** & **2 nd Backup** \\  & **Drive’s IP** & **Drive’s IP** & **Drive’s IP** \\ \hline Key Range 1 & & & \\ Key Range 2 & & & \\... & & & \\ Key Range \(M\) & & & \\ Additional Backup & & & \\ Drives’ Key Ranges & & & \\... & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Mapping table maintained in each metadata server. involves another metadata server in a different region for data retrieval. For example, in Figure 7, a user in Region 2 retrieves data whose _key_ is covered by drive D155 in Region 5. However, in Region 2, both _original drives_ and additional drives as backup copies of other regions do not cover this _key_. In that case, the metadata server MS2 checks the _key_ and finds that it is covered by _original drives_ in Region 5. Hence, it returns the IP address of metadata server MS5 to the user.