# Concerto: Dynamic Processor Scaling for Distributed Data Systems with Replication
## 2 Background
### Redis  
Redis is an in-memory data store based on the key-value data model [6]. It supports various sets of data structures, including a hash table and sorted sets so as to satisfy many different tastes of clients. Furthermore, as Redis provides high availability and scalability via the built-in replication feature, it is finding widespread use in data centers.  
Figure 1 shows the common architecture used when Redis is deployed. For good service robustness and availability, Redis uses data replication, which is realized by three types of instances: a master, a replica, and a sentinel. The master instance deals with all write requests of clients at the front end, maintaining an up-to-date dataset in distributed data systems. In contrast, replicas are asynchronously updated by the master, servicing read-only queries or simply providing backups for data safety. This asynchronous replication inevitably allows transient inconsistencies during certain time windows. Nevertheless, most distributed systems allow for such a defect, preferring high performance over strong consistency.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Freq.** & 2.2 GHz & 2.0 & 1.8 & 1.6 & 1.4 & 1.2 & 1.0 \\ \hline
**Vol.** & 1.10 V & 1.06 & 1.02 & 0.98 & 0.94 & 0.90 & 0.86 \\ \hline \hline \end{tabular}
\end{table}
Table 2: P-states in Intel(R) Xeon(R) Silver 4114.  
Figure 1 illustrates how a single master and two replicas cooperate in Redis. This example assumes that a client sends a set request with a key-value pair of Bar and 300 to the master. Upon the request, the master promptly updates its dataset structured in a hash table with new data and then transfers the request to the associated replicas. Subsequently, the master node immediately responds to the client without waiting for acknowledgement of data processing from replicas. The master node is notified asynchronously by the replicas regarding the amount of data processed in the replicas.  
If the replica loses its connection with the master for some reason, such as a network issue or some other fault, the replica may significantly lag behind the master. To avoid data losses and inconsistencies, the replica performs partial synchronization when re-connected, receiving data differences from the master to ensure that the replica dataset is up-to-date. For this purpose, the master maintains a backlog buffer that holds all updates transferred to the replica in a fixed size of the in-memory buffer. The backlog buffer maintains an offset for each replica, indicating the amount of data processed for each replica. This offset proceeds upon the occurrence of an asynchronous acknowledgement by replicas. When a partial synchronization request arrives, the master identifies data differences by consulting the associated offset and transfers it to the replica.  
The sentinel nodes are responsible for administration of the data system and are deployed to provide high availability without human intervention. As an example, the sentinel not only monitors the status of data service nodes and notifies the administrator if abnormalities are detected but also invokes the failover process to promote one of the replicas to the master whenever needed. By doing so, Redis is able to continue to offer their services even in the event of a failure.