text:
\section{Introduction}%
\label{sec:intro}

Distributed hash table (DHT)~\cite{dht} is a storage infrastructure providing a lookup service similar to a hash table. It is the foundation  underlying modern large-scale key-value stores, e.g., Dynamo~\cite{dynamo} and Cassandra~\cite{cassandra}, which are basic building blocks for large-scale production systems in the cloud. DHT-based systems can easily scale out to a larger size when the application workload increases. Composed of networked nodes, DHT-based systems can balance application workloads across different nodes, guaranteeing assured experiences for applications.

DHT provides measures for guaranteeing the two key features of scalability and load balancing for cloud-based systems. It distributes keys to a set of system nodes through consistent hashing~\cite{consistentHashing}. Values are stored along with their keys at the corresponding system nodes. As for load balancing, the hashing can distribute the keys almost uniformly across system nodes, given the assumption that the number of keys is large. With regard to scalability, data access can be handled by any system node without any centralized bottleneck; and, the system can scale out by adding more nodes.

\emph{\bf Load rebalancing} of DHTs happens on system stabilization, which is a process for preserving desirable properties after system changes, e.g., system scaling out by adding more nodes. On system scaling out, key ranges and values are moved across system nodes to preserve the mapping relations between keys and nodes. By such, system load gets rebalanced. In general cases, the system scale-out events are not often and can be planned by system administrators.

Previous works~\cite{p2pevolv,chord} on DHT only consider how key routing and node membership are affected during system stabilization. The impacts of data movement for load rebalancing has hardly been studied. When the write workload for the system is relatively low as in the past, the number of nodes is the main factor affecting system stabilization and the routing complexity is the major concern. However, the impact of load rebalancing on the system cannot be ignored when the write workload of incoming data is heavy.

With the advent of Internet-of-Things (IoT), there emerges a need for supporting the workload of unprecedentedly frequent yet steady writes. Previously, a system will handle millions of requests a day~\cite{dynamo}. Or, for the biggest Cassandra cluster in the world~\cite{biggestCCluster}, a system can handle millions of reads and writes per second, using tens of thousands of nodes. As for the IoT applications, DHT-based systems remain a popular choice~\cite{kairosdb,opentsdb}, but now the system has to handle millions of writes per second over only tens of nodes. A write workload that is too heavy can cause the breakdown of a DHT-based system. The following is a related use case for storing IoT data in the DHT-based system Cassandra.

\noindent\textbf{Example - Metro IoTs.} \emph{A city has 20 metro lines. Each line is served by about 10 trains. Each train is equipped with 3200 sensors to monitor its operating status. Each sensor is sending back a value larger than 16 bytes at a 2Hz frequency. Besides monitoring the train status on the recent data, the metro company wants to keep all the data for future analytics tasks. To fulfill the task, the storage system must handle a workload of {\small $20\times10\times3200\times2=1,200,000$} writes per second.}\\
\emph{A Cassandra-based system named KairosDB~\cite{kairosdb} is exploited for the purpose. The storage system is composed of 14 nodes initially, with each node serving about $85,000$ writes per second. Afterwards, the sampling frequency of each sensor is raised from 2Hz to 5Hz. Besides, the number of trains for each lines is increased to 15 to enable a better public transport service. Therefore, the storage system must now handle {\small $20\times15\times3200\times5=4,800,000$} writes per second. The storage system exhibits incompetency in the process, which makes the system administrators decide to scale out the system to increase the system capacity.}\\
\emph{The planned scale-out process is composed of a sequence of node addition procedures. Each procedure adds one node to the system. The next procedure will not begin until the system gets stabilized in the previous procedure. Writes continue to arrive at the system during the scale-out process. Unfortunately, the Cassandra storage system breaks down at the beginning of the planned scale-out event, when the first node is added and when the system rebalances loads. After a careful analysis, we find out that the breakdown does not happen due to any bug of the Cassandra system. Rather, it is an inherent problem of DHT that lies at the core of Cassandra. This problem only exposes its traits when the write workload exceeds a certain level and during load rebalancing.}

Regarding IoT application scenarios and workload changes as in the above example, we formulate the load rebalancing problem of DHTs and address the problem from a theoretical perspective in this paper. We investigate how the intensity of writes affects system load rebalancing. We study the conditions when load rebalancing is feasible for DHT. \emph{Not until the recent wide adoptions of IoTs does the design assumptions of DHT change.} Therefore, we analyze the changes of assumptions in practice and the factors that determine the feasibility of the load rebalancing process. Our results show that \emph{DHT cannot guarantee load rebalancing and scalability with its original design, while simultaneously supporting application scenarios where writes are extremely intensive}, e.g., storing IoT data. We make the following contributions in this paper:
\begin{itemize}
  \item We formulate the load rebalancing problem of DHT by considering the impacts of write workloads and data movement in the course (\emph{Section~\ref{sec:problem}}), targeting at application scenarios emerging recently (e.g., IoT).
  \item We show that, the average network bandwidth of each node and the intensity of the average write workload are the two key factors that determine the feasibility of DHT load rebalancing. For four varied application scenarios (\emph{Section~\ref{sec:liwrite}-\ref{sec:noswrite}}), we prove theoretical bounds on the maximum rates of writes that a DHT-based system can handle, if the system is to rebalance loads in a node-by-node scale-out process.
  \item We apply the theoretical results on load rebalancing for analyzing the real case of IoT (\emph{Section~\ref{sec:app}}).
\end{itemize}

\section{Background and Related Work}

In this section, we first describe the concept and a typical design of a distributed hash table (DHT). Then, we explain the load distribution mechanisms commonly applied to DHT-based systems in practice. Finally, we position our work in the background of related works.

\subsection{Distributed Hash Table}

Distributed hash table (DHT) designs emerge along with peer-to-peer (P2P) systems such as Gnutella~\cite{gnutella} and Freenet~\cite{freenet} at the beginning of this century. DHT designs feature a structured key-based routing, enabling a decentralized organization of nodes and a guaranteed key-matching time. Typical DHT designs include Chord~\cite{chord}, CAN~\cite{can}, and Pastry~\cite{pastry}. The Chord design has been adopted in two widely deployed systems, i.e., Amazon's Dynamo~\cite{dynamo} and Apache Cassandra~\cite{cassandra}, which have supported a variety of production systems in the cloud. In the following, we assume the Chord design for DHT, but the results in this paper can be easily extend to other DHT designs with minor changes.

DHT uses consistent hashing~\cite{consistentHashing} to spread $K$ keys uniformly over $N$ connected nodes. Each node is assigned $T$ tokens. The tokens are mapped to the wrapped one-dimensional key space such that each token corresponds with a key range. Each node keeps routing information about $O(\log N)$ other nodes and resolves the mapping by communicating with $O(\log N)$ nodes. Each node only needs to coordinate with only a few other nodes in the system such that only a limited amount of work needs to be done for each change in node membership. Therefore, DHT-based system should function efficiently even with more than thousands of nodes.

To meet the requirement of cloud applications, the cloud key-value (KV) store~\cite{dynamo} makes slight modifications to the design of DHT. The modifications are to achieve better load balance, which is highly desirable for a cloud-based system. First, a system node does not only keep the routing table for its responsible keys, but also the data objects corresponding to the keys. With a balanced distribution of keys, the data will also be distributed evenly across nodes. Second, on system changes, e.g., node joining or leaving, data objects must move along with the corresponding keys, the responsibility of which changes hands. This will preserve the previous balanced load after the system changes. Third, the mapping between keys and tokens is adapted to ensure uniform load distribution on load rebalancing.

\subsection{Load Rebalancing and Uniform Distribution}

Load rebalancing can happen when the system scales out by adding nodes or scales in by removing nodes. We focus our discussions in this paper on the system scale-out event. The results can be applied to the scale-in process with slight adaptations as well, since the two processes are the reverse of each other. We consider the system scale-out event triggered on the condition that the data volume at each node has reached a threshold. Once the system starts to scale out, it faces an unstable time when nodes must migrate data and exchange routing information across the system. We denote this process as a \emph{stabilization} process, as the system seeks to stabilize for preserving the desirable system properties. System stabilization begins when the node set changes and the data migrate. It ends when the routing information and the data on each node match the system design. Then, the system can have uniform load distribution.

Three common strategies for load distribution exist~\cite{dynamo}. They vary mainly on how tokens are assigned to nodes and how key ranges are partitioned. According the different choices on the two aspects, we denote the three strategies as \emph{limited-token-random-part}, \emph{limited-token-equal-part}, and \emph{many-token-equal-part}. The \emph{limited-token-random-part} strategy assigns $T$ random tokens per node and partitions key ranges by token values. The \emph{limited-token-equal-part} strategy assigns $T$ random tokens per node and split the key ranges into a large number of equal partitions. The \emph{many-token-equal-part} strategy splits the key ranges into $Q$ equal partitions and assign $Q/N$ random tokens to each of the $N$ nodes. The first strategy is the original key-token mapping strategy of DHT, thus it can enable an extremely high scalability. But among the three strategies, the third performs the best with regard to load balance and the size of metadata~\cite{dynamo}, thus it is widely used in the cloud.

For the \emph{many-token-equal-part} strategy, the identifier circle is divided into $Q$ equal sized partitions/ranges. The right bound of each partition is taken as a token. Each node is then randomly assigned with $Q/N$  tokens, i.e., $Q=TN$. Thus, $Q$ need not be large and the metadata size is smaller than for the second strategy. With a replication factor $r$, a partition is mapped to the first $r$ unique nodes that are encountered when walking the circle clockwise from the wrapping position. On joining, a node picks one token from the other $N$ nodes. On departure, a node hands its tokens randomly to the remaining nodes. Our discussion assumes this strategy in this paper.

\subsection{Related Work}

Chord~\cite{chord}, CAN~\cite{can} and Pastry~\cite{pastry} are among the best known distributed hash table (DHT) systems. They are efficient for exact key matches, guaranteeing a $O(\log N)$ search length. Their mapping between keys and nodes enables a localized computation of routing tables and an effective adaptation under system churns, i.e., changes in node membership~\cite{churn}. Therefore, systems based on such DHTs can scale to an extremely large size.

DHT has been used as the basis for a variety of systems, e.g., key-value stores~\cite{hyperdex} and file systems~\cite{chordfs}. Amazon Dynamo~\cite{dynamo} and Apache Cassandra~\cite{cassandra} are among the best known systems that are based on DHTs. These two systems are key-value (KV) stores. They work as the foundations of many cloud systems, thanks to their prominent property of scalability and load balancing. While DHT enables the KV stores to scale easily, these systems adapt the key-node mapping strategies to achieve load balance. In this paper, our discussions of DHT assumes the load balancing property.

Extensive research efforts have been devoted to analyze different aspects of DHT designs, e.g., load balancing~\cite{dhtloadbalance}, the routing cost~\cite{routing}, churn handling~\cite{chrunAndRnumber}, and malicious attacks~\cite{attacks}. Load \emph{rebalancing} has also been studied~\cite{dhtreloadbalance}. However, previous works mainly study these topics with regard to \emph{churns} and key-search workloads. \textbf{The impact of write workload on the system has rarely been taken into account.} Similarly, while works exist on analyzing load balance of services composed of distributed KV stores~\cite{kvloadbalance}, the write workloads are not considered in the studies. The reasons are that, DHTs are mainly used for indexing objects previously, while key-value stores have yet to meet a heavy write workload that can actually make an impact, until the emergence of IoT data.

Our work differs from previous works in that we analyze the load rebalancing property of DHT with regard to a potential heavy workload of writes, which come from the new application scenario of IoT. The results of our work should apply to the wide application scenarios of IoT and offer implications on the scalable storage system design for IoT data.
\begin{table}[t]
\caption{Symbols used throughout the paper.}\vspace{-6pt}
\begin{center}
\begin{tabular}{|l|l|}
\hline
\multicolumn{1}{|c|}{\textbf{Symbols}} &\multicolumn{1}{|c|}{\textbf{Uses}} \\
\hlin
$N$ & Node number\\
\hline
$T$ & Token number per node\\
\hline
$Q$ & Key space partition number\\
\hline
$K$ & Key number\\
\hline
$v$ & Mean size of a key-value pair\\
\hline
$r$ & Replication factor\\
\hline
$\lambda$ & Arrival rate of writes per second per node\\
\hline
$b$ & Bandwidth of a node\\
\hline
\end{tabular}\vspace{-12pt}
\label{tbl:symbol}
\end{center}
\end{table}
\section{Problem Formulation}
\label{sec:problem}

We first introduce the DHT system model along with some important early results. We then specify the load rebalancing problem with regard to the system expansion process and the stabilization procedure. The symbols used throughout the paper are summarized in Table~\ref{tbl:symbol}.

\subsection{System Model}

A DHT-based system consisted of $N$ nodes is initially in a stable state, storing $K$ keys and the corresponding values. After the node join process, the system will remain balanced. The process between balanced states is called stabilization. According to the paper introducing consistent hashing~\cite{consistentHashing}, the following results exist for the system.
\begin{theorem}
With $K$ keys hashed to $N$ nodes, the following is true with high probability.
\begin{enumerate}
  \item Each node is responsible for at most $(1+\epsilon)\frac{K}{N}$ keys.
  \item When an $(N+1)$th node joins or leaves the system, the responsibility for $O(\frac{K}{N})$ key changes hands (and only to or from this joining/leaving node).
\end{enumerate}
\end{theorem}

The consistent hashing paper also shows that $\epsilon$ can be reduced to arbitrarily small by having each node run $\Omega(logN)$ virtual nodes, each of which has also a token. As a result, the $K$ keys in the system can be distributed across $N$ nodes almost evenly, if each physical node is to host multiple virtual nodes.

Based on the above theorem, when adopting the many-token-equal-part load distribution strategy, each node serves $\frac{K}{N}$ keys along with the corresponding $\frac{K}{N}$ data values. Assuming the mean size of each value is $v$, data take up about $v\frac{K}{N}$ space at each node. With a replication factor $r$, each node serves $r\frac{K}{N}$ keys and has at least $rv\frac{K}{N}$ storage space.

\subsection{System Expansion and Stabilization}
\label{sec:expansion}

The system initiates an expansion procedure on a certain condition. An example condition can be when the ingestion workload is too heavy to be supported by the current number of nodes. Each system expansion procedure involves only the join process of a single node. To add more nodes, we can break it down to multiple one-node join process. Assuming the system has steady write workloads before expansion. The average write rate for each node is $\lambda$. At the time $T_{N+1}$ when node $N+1$ joins, there are $K$ keys and values in the system. We have:
\begin{equation}
K=\lambda NT_{N+1}\label{eq:keywrite0}
\end{equation}

\emph{Migrated keys.} The system stabilization procedure occurs during the system expansion process to guarantee the load rebalancing. On system stabilization, data must be moved from the original $N$ nodes to the joining node. With the \emph{many-token-equal-part} strategy, the joining node will receive $k^{N+1}$ keys from the other $N$ nodes. Assuming homogeneous structure, i.e., that the $N$ nodes are symmetric, each node will hand $k_i^{N+1}$ keys over to the new node. Based on the system model, we have the following equations.
\begin{align}
k^{N+1}=\mathop{\Sigma}_i^N k_i^{N+1}&=\frac{rK}{N+1}\label{eq:key0}\\
k_i^{N+1}&=\frac{rK}{N(N+1)}\label{eq:key1}
\end{align}

\emph{Data movement.} The joining node will receive $d^{N+1}$ from the other $N$ nodes, each of which sends $d_i^{N+1}$ data. Based on Eq.~\eqref{eq:key0} and \eqref{eq:key1}, we have the following relations.
\begin{align}
d^{N+1}=\mathop{\Sigma}_i^N d_i^{N+1}&=\frac{rvK}{N+1}\label{eq:data0}\\
d_i^{N+1}&=\frac{rvK}{N(N+1)}\label{eq:data1}
\end{align}

\emph{Storage space and data volume.} Assuming each node has storage space $S$. On the $N+1$ node joining, each node has used $\mu S$ storage space. Thus, each node will move $d_i^{N+1}$ data to the joining node, and the joining node receives from other nodes the following amount of data in the process:
\begin{align}
d^{N+1}=Nd_i^{N+1}=\frac{\mu SN}{N+1}\label{eq:data5}\\
d_i^{N+1}=\frac{\mu S}{N+1}\label{eq:data4}
\end{align}
Along with Eq.~\eqref{eq:data0} and \eqref{eq:data5}, we can deduce the relations between the system storage space and the number of keys as follows.
\begin{equation}
{\bf K}{\bf =\frac{\mu SN}{rv}}\label{eq:data7}
\end{equation}

\subsection{Problem Specification}

We address the load rebalancing problem of DHT-based systems. As for the example use case in Section~\ref{sec:intro}, it is obviously the load rebalancing procedure that has caused the system to break down during its expansion. However, it is unknown which factors have caused the breakdown. Two possible reasons for the system breakdown are:
\begin{enumerate}
  \item The system workload has increased during the expansion process, thus overloading and breaking down the system.
  \item The system stabilization process is receiving writes during load rebalancing, thus overloading and breaking down the system.
\end{enumerate}

With regard to the above two reasons, we need to address two aspects for the load rebalancing problem. The first aspect is about write workloads. We consider two kinds of write workloads, i.e., one with writes linearly increasing along with the system size and one with writes remaining stable during the system expansion. The second aspect is about the stabilization process. We consider both system stabilization that receives writes in the course and that does not. A stabilization that does not receive writes simultaneously is denoted as \emph{clear stabilization} in the following. For clear stabilization, writes will accumulate in the course. They are then processed after the stabilization. In the following, we investigate the load rebalancing problem with regard to four different application scenarios, which are the combinations of the above two aspects. We aim to answer the following questions:
\begin{itemize}
  \item Which factors play a key role in the load rebalancing process of a DHT-based system?
  \item What constraints exist for these factors?
\end{itemize}

Our study mainly considers the write workloads. We have simplified the problem and disregarded the impacts of the read workloads on load rebalancing. However, as we are analyzing the constraints of storage, bandwidth and time on load rebalancing, our results of bounds still hold even with the read workloads. Adding the impacts of the read workloads would only lead to tighter bounds in the results.

\section{Stabilization with Linearly Increasing Writes}%
\label{sec:liwrite}

\emph{Target application scenario:} A system can expand as the write workload increases. A node is added to the system when the write workload increases from $N\lambda$ to $(N+1)\lambda$. During the stabilization process, the system rebalances loads by migrating data across nodes. Writes continue to arrive and get processed in the process.

\emph{Results:} We can deduce two bounds for the load rebalancing process, with regard to storage constraint and bandwidth constraint respectively.

\begin{theorem}[A Storage-Oriented Bound for Rebalancing with Increasing Writes]
For a DHT-based symmetric system with $N$ nodes, each node has bandwidth $b$. The system adds one node, when each original system node has stored data up to a ratio $\mu$ of its total storage space. Assuming each write is about $v$ bytes on average. To guarantee a successful load rebalancing process, the following inequation must be satisfied for the average rate $\lambda$ of writes per node:
\begin{equation}
\lambda<(1-\frac{N}{N+1}\mu)\frac{b}{v}\label{eq:lbound6}\vspace{-6pt}
\end{equation}
\label{thm:ww:sob}
\end{theorem}

\begin{theorem}[A Bandwidth-Oriented Bound for Rebalancing with Increasing Writes]
For a DHT-based symmetric system with $N$ nodes, each node has bandwidth $b$. The system adds one node for expansion. Assuming each write is about $v$ bytes on average.  To guarantee a successful load rebalancing process, the following inequation must be satisfied for the average rate $\lambda$ of writes per node:
\begin{equation}
\lambda<\frac{1}{(N+1)}\frac{b}{v}\label{eq:tbound3}\vspace{-6pt}
\end{equation}
\label{thm:ww:bob}
\end{theorem}

Though with different degrees of bounds, the above two theorems indicate the same fact. That is, \textbf{the rate of writes that a DHT-based system can handle stays the same as the system size increases}, if the system accepts an increased workload of writes during load rebalancing.

The results seem to contradict with our previous conception of distributed key-value stores, which have high scalability disregard of the system size. The major difference lies in the assumption. Under the IoT application scenario, the workload of the system can increase as the new node is added to the system. In comparison, previous applications scenarios apply a light and relatively stable workload to the system. The workload on the system generally does not increase obviously during the expansion process.

\subsection{Preliminary}

To prove the above theorems, we first assume the joining process take time $t^{N+1}$. The joining node has to process $\lambda t^{N+1}$ writes during the joining process. The total volume of data flushing to the joining node in the course consists of two parts, i.e., the incoming writes and data moved from the other $N$ nodes. Therefore, considering Eq.~\eqref{eq:key0}, the joining node has to handle the following volume of data:
\begin{equation}
D^{N+1}=\frac{rvK}{N+1}+v\lambda t^{N+1}\label{eq:data2}
\end{equation}

Assuming that each node has enough bandwidth to transfer data to the joining node. Let $b_{N+1}$ be the part of network bandwidth that the joining node uses for the joining process.  Except for the bandwidth used for receiving writes, the joining node is assumed to use all the rest bandwidth for the data movement from other nodes. Along with Eq.~\eqref{eq:data2}, we have:
\begin{align}
b-b_{N+1}&=v\lambda\label{eq:bandwidth0}\\
t^{N+1}&=\frac{rvK}{(N+1)b_{N+1}}\label{eq:jtime1}
\end{align}

\subsection{Proof Sketch: A Storage-Oriented Bound}

To prove Theorem~\ref{thm:ww:sob}, we start from the following storage constraint on the system:
\begin{claim}
Writes should not fill the remaining storage space up at any node during the joining time for the new node.
\label{claim:storage}
\end{claim}
In other words, the time to fill up the rest $(1-\mu)S$ space at each node should be larger than the joining time $t^{N+1}$. Considering Eq.~\eqref{eq:jtime1}, the following relation between processing times is required:
\begin{equation}
\frac{(1-\mu)S}{v\lambda}>t^{N+1}\label{eq:lbound0}
\end{equation}

Filling Eq.~\eqref{eq:data7} into Eq.~\eqref{eq:lbound0}, we have the following:
\begin{equation}
(\mu^{-1}-1)(1+\frac{1}{N})b_{N+1}>v\lambda\label{eq:lbound2}
\end{equation}
Replacing $v\lambda$ in the above equation based on Eq.~\eqref{eq:bandwidth0}, we get the required relation between $b_{N+1}$ and $b$ as follows:
\begin{align}
\frac{b_{N+1}}{b}&>\frac{\mu N}{N+1-\mu}\label{eq:lbound3}\\
\Rightarrow b_{N+1}>\frac{N}{N+1-\mu}\mu b&>\frac{N}{N+1}\mu b\label{eq:lbound4}
\end{align}

We can also replace $b_{N+1}$ of Eq.~\eqref{eq:lbound3} based on Eq.~\eqref{eq:bandwidth0}. Thus, the following inequation between the rate of writes at each node $\lambda$ and the bandwidth per node exists:
\begin{equation}
\lambda<\frac{(N+1)}{N}\frac{(1-\mu)b}{v}\label{eq:lbound5}
\end{equation}
And, by replacing $b_{N+1}$ of Eq.~\eqref{eq:lbound4} based on Eq.~\eqref{eq:bandwidth0}, we can further deduce Eq.~\eqref{eq:lbound6}, and thus prove Theorem~\ref{thm:ww:sob}.

\subsection{Proof Sketch: A Bandwidth-Oriented Bound}

Assuming the system will add a new node automatically when the triggering condition is met. The condition is defined such that \emph{the system must expand when the system node has $\mu S$ data locally}. To prove Theorem~\ref{thm:ww:bob}, we start from the following bandwidth constraint on the system:
\begin{claim}
The rate for data migration at any of the $N$ node is higher than the rate of its data arrival in the course.
\label{claim:bandwidth}
\end{claim}

If the above claim is not met, a new system expansion will be triggered before the previous expansion finishes. With consecutive expansion overlapping, the system will never get stabilized or be able to serve according to its design. As each node is still having the write workload of $v\lambda$, the following inequation must be satisfied to guarantee the claim:
\begin{equation}
\frac{\mu S}{N+1}\frac{1}{t^{N+1}}>v\lambda\label{eq:tbound0}
\end{equation}

Replacing $t^{N+1}$ and $S$ in Eq~\eqref{eq:tbound0} based on Eq.~\eqref{eq:data7}, \eqref{eq:bandwidth0} and \eqref{eq:jtime1}, we can deduce the following inequations:
\begin{equation}
b>(N+1)v\lambda\label{eq:tbound2}
\end{equation}
With Eq.~\eqref{eq:tbound2}, we have thus proved Theorem~\ref{thm:ww:bob}.

\section{Clear Stabilization\\with Linearly Increasing Writes}%
\label{sec:noliwrite}

\emph{Target application scenario:} The application scenario is similar to that in Section~\ref{sec:liwrite}, except for the following difference. The system stops receiving any write until the stabilization finishes, though writes will accumulate and must be processed by the system after the stabilization process.

\emph{Results:} We can deduce a bound for the load rebalancing process based on the condition whether the accumulated writes can be processed completely between two expansion processes.

\begin{theorem}[A Time-Oriented Bound for Clear Rebalancing with Increasing Writes]
For a DHT-based symmetric system with $N$ nodes, each node has bandwidth $b$. The system adds one node, when each original system node has stored data up to a ratio $\mu$ of its total storage space. Assuming each write is about $v$ bytes on average. To guarantee a successful load rebalancing process without the interference from a write workload, the following inequation must be satisfied for the average rate $\lambda$ of writes per node:
\begin{equation}
\lambda<\frac{\sqrt{4N+1}-1}{2N}\frac{b}{v}\label{eq:nowrite14}
\end{equation}
\label{thm:nww:tob}
\end{theorem}

According to the above theorem, the write workload should not be too heavy. The indication is two fold. First, if the write workload is too heavy, e.g., as heavy as taking up almost the total bandwidth of each node, a system should not adopt the clear stabilization. Otherwise, the stabilization process would be too long to be practical. Second, if clear stabilization is adopted and the write workload is almost proportional to the system size, the system size cannot be too large. Otherwise, either the system expansion cannot complete, or the incoming writes cannot be completely received and processed.

\subsection{Preliminary}

Let the joining node process a total amount $D^{N+1}$ of data in the course of system stabilization. As writes are stopped on system expansion, we can deduce the following equalities:
\begin{align}
D^{N+1}=d^{N+1}\label{eq:nowrite1}\\
b=b_{N+1}\label{eq:nowrite2}
\end{align}

Now, the time for the stabilization process is solely determined by how fast data migration finishes. Based on Eq.~\eqref{eq:data5}, Eq.~\eqref{eq:nowrite1} and \eqref{eq:nowrite2}, we can compute the time for stabilization as follows.
\begin{equation}
t^{N+1}=\frac{d^{N+1}}{b}=\frac{\mu SN}{(N+1)b}\label{eq:nowrite3}
\end{equation}

Assuming that $N$ is sufficiently large at the beginning, we have $\frac{N}{N+1}\rightarrow 1$. $\mu S$ is the volume of data that a node stores before the system expansion. According to the above equation, \textbf{if the write workload is as heavy as to take up almost the total bandwidth $b$ of each node, when adding one more node to the system, it would take the same time to stabilize as to fill the system up before the stabilization}. In other words, Eq.~\eqref{eq:nowrite3} actually refuses the feasibility of scaling out a large system under an extremely heavy workload.

Now, we assume that the average write workload only takes up about $\alpha b$ bandwidth of each node. At the end of the system stabilization period, the accumulated data can be computed based on the stabilization time and the used bandwidth:
\begin{equation}
d_{acc}=t^{N+1}\times(N+1)\alpha b=\mu SN\alpha\label{eq:nowrite4}
\end{equation}

After the stabilization process, the bandwidth to be used for catching up the data storage would be $(1-\alpha)b$, since the rest $\alpha b$ is used for accepting new writes. Therefore, it will take the following time to catch up:
\begin{equation}
t_{catchup}=\frac{d_{acc}}{(N+1)(1-\alpha)b}=\frac{\mu SN \alpha}{(N+1)(1-\alpha)b}\label{eq:nowrite5}
\end{equation}
According to the above equation, we can observe that, \textbf{as the system size increases, the time taken for catching up is also increasing}.

After a clear stabilization, the system has $\mu SN$ data and $(N+1)S$ storage space. Before the next expansion, the system can store $\mu S$ more data. $T_{N+1}$ is the time from the system's initial status till the first expansion is initiated with one node added. And, $T_{N+2}$ is the time when the next expansion happens. We can compute $T_{N+1}$, as well as the time between this first expansion and the next one in the following:
\begin{align}
T_{N+1}&=\frac{\mu S}{\alpha b}\label{eq:nowrite7}\\
T_{N+2}-T_{N+1}&=\frac{\mu S}{(N+1)\alpha b}\label{eq:nowrite6}
\end{align}

\subsection{Proof Sketch: A Time-Oriented Bound}

To prove Theorem~\ref{thm:nww:tob}, we start from the following time constraint on the stabilization process:
\begin{claim}
The time for catching up must finish before the next system expansion event happens.
\label{claim:time}
\end{claim}
According to the above claim, with Eq.~\eqref{eq:nowrite6} and \eqref{eq:nowrite5}, the following inequality exists:
\begin{align}
T_{N+2}-T_{N+1}&>t_{catchup}\label{eq:nowrite8}\\
\Rightarrow\frac{1}{N}&>\frac{\alpha^2}{1-\alpha}\label{eq:nowrite10}
\end{align}

According to the result of Eq.~\eqref{eq:nowrite10}, if clear stabilization is adopted under a workload with linearly increasing writes, \textbf{there exist a moment when $N$ grows so large that the system expansion cannot catch up with the write workload}.

Consider the relation between the incoming write workload and the corresponding bandwidth taken up at each node, we have $v\lambda=\alpha b$. Replacing all terms of $\alpha$ in Eq.~\eqref{eq:nowrite10} accordingly, we have the following result:
\begin{align}
\lambda^2+\frac{b}{Nv}\lambda&<\frac{b^2}{Nv^2}\label{eq:nowrite12}\\
\Rightarrow (\lambda+\frac{b}{2Nv})^2&<\frac{4Nb^2+b^2}{4N^2v^2}\label{eq:nowrite13}\\
\Rightarrow \lambda&<\frac{\sqrt{4N+1}-1}{2N}\frac{b}{v}\label{eq:nowrite15}
\end{align}
Solving the inequation~\eqref{eq:nowrite13} with regard to $\lambda$, we reach the result of Eq.\eqref{eq:nowrite15} and thus Theorem~\ref{thm:nww:tob}.

\section{Stabilization with Stable Writes}%
\label{sec:swrite}

\emph{Target application scenario:} A system can expand when the write workload increases. A node is added to the system for an expansion. The write workload on the system is kept stable before and after the expansion process. On system stabilization, the system rebalances loads by migrating data across nodes. Writes continue to arrive and get processed in the process.

\emph{Results:} We can deduce two bounds for the load rebalancing process, with regard to storage constraint and bandwidth constraint respectively.

\begin{theorem}[A Storage-Oriented Bound for Rebalancing with Stable Writes]
For a DHT-based symmetric system with $N$ nodes, each node has bandwidth $b$. The system adds one node, when each original system node has stored data up to a ratio $\mu$ of its total storage space. Assuming each write is about $v$ bytes on average. To guarantee a successful load rebalancing process, the following inequation must be satisfied for the stable write workload $\lambda N$ on the system:
\begin{equation}
\lambda<(1+\frac{1}{N}-\mu)\frac{b}{v}\label{eq:slbound7}\vspace{-6pt}
\end{equation}
\label{thm:wsw:sob}
\end{theorem}

\begin{theorem}[A Bandwidth-Oriented Bound for Rebalancing with Stable Writes]
For a DHT-based symmetric system with $N$ nodes, each node has bandwidth $b$. The system adds one node for expansion. Assuming each write is about $v$ bytes on average.  To guarantee a successful load rebalancing process, the following inequation must be satisfied for the stable write workload $\lambda N$ on the system:
\begin{equation}
\lambda<\frac{1}{N}\frac{b}{v}\label{eq:stbound3}\vspace{-6pt}
\end{equation}
\label{thm:wsw:bob}
\end{theorem}

Comparing the results of Theorem~\ref{thm:ww:sob} and \ref{thm:wsw:sob}, we find that, for the two application scenarios, the bounds of $\lambda$ differ at a value of $\delta=\frac{1}{N}-\frac{\mu}{N+1}$. As $\delta>0$, the bound in Eq.~\eqref{eq:slbound7} is larger than that in Eq.~\eqref{eq:lbound6}. Thus, for the application scenario of this section, the system allows a higher rate $\lambda$ of writes per node. Theorem~\ref{thm:ww:bob} and \ref{thm:wsw:bob} also indicate the same result.

Furthermore, according to Theorem~\ref{thm:ww:bob} and \ref{thm:wsw:bob}, the bound for the write workload is related not only to the bandwidth, but also with the system size. \textbf{This correlation between $\lambda$ and $N$ explains the cause of scalability problems in the DHT-based systems that have load rebalancing processes}. When $\lambda$ is small as for previous application scenarios, the bound is too far to reach and the problem would not exist. However, for the IoT application scenarios where continuous and highly frequent writes come from machines, the bound can be reached easily. Hence, scalability problems occur in DHT-based storage systems in practice, as in the use case of Section~\ref{sec:intro}.

Finally, based on Theorem~\ref{thm:wsw:bob}, it is required that \textbf{the global write workload $N\lambda$ for the system must be smaller than the maximum writes that a single node can receive, i.e., $\frac{b}{v}$}. Otherwise, the system will have scalability problems, if its expansion process involves load reblancing.

\subsection{Preliminary}

To prove the above theorems, we first assume the joining process take time $t^{N+1}$. Writes arrive at the rate of $N\lambda$ per second at the system. As the system load is assumed to be balanced, the joining node needs to process $\frac{N}{N+1}\lambda t^{N+1}$ writes on joining. Along with the rebalanced data as in Eq.~\eqref{eq:key0}, the joining node must process the following amount of data the course of system stabilization:
\begin{equation}
D^{N+1}=\frac{rvK}{N+1}+\frac{N}{N+1}\lambda vt^{N+1}\label{eq:sdata1}
\end{equation}

Assuming that each node has enough bandwidth to transfer data to the joining node. Let $b_{N+1}$ be the part of network bandwidth that the joining node uses for the joining process. Except for the bandwidth $b_{N+1}$ used for load rebalancing, the joining node uses all the rest bandwidth for receiving writes, which are about $\frac{1}{N+1}$ of the $\lambda N$ workload. Considering Eq.~\eqref{eq:sdata1}, we can deduce the following relations:
\begin{align}
b-b_{N+1}&=\frac{N}{N+1}\lambda v\label{eq:sdata2}\\
t^{N+1}&=\frac{rvK}{(N+1)b_{N+1}}\label{eq:sdata3}
\end{align}

\subsection{Proof Sketch: A Storage-Oriented Bound}

Again, we start from the storage constraint on the system, i.e., Claim~\ref{claim:storage}, for proving Theorem~\ref{thm:wsw:sob}. Considering Eq.~\eqref{eq:sdata3}, the following relation between processing times is required:
\begin{equation}
\frac{(N+1)(1-\mu)S}{N\lambda v}>t^{N+1}\label{eq:slbound0}
\end{equation}

To replace $t^{N+1}$ and $S$, we fill in Eq.~\eqref{eq:slbound0} with Eq.~\eqref{eq:data7} and \eqref{eq:sdata3}. Hence, the following inequality is deduced:
\begin{align}
(\mu^{-1}-1)(1+\frac{1}{N})b_{N+1}&>\frac{N}{N+1}\lambda v\label{eq:slbound2}
\end{align}

We first deduce the relation between $b_{N+1}$ and $b$. We remove the terms of $\lambda$ exploiting Eq.~\eqref{eq:sdata2}. The following results exist:
\begin{align}
b_{N+1}&>\frac{N}{N+1-\mu}\mu b\label{eq:slbound3}\\
\Rightarrow b_{N+1}&>\frac{N}{N+1}\mu b\label{eq:slbound4}
\end{align}

Now, we fill in Eq.~\eqref{eq:slbound4} with Eq.~\eqref{eq:sdata2} to replace the terms of $b_{N+1}$. By such, we obtain the result of Eq.~\eqref{eq:slbound7}, proving Theorem~\ref{thm:wsw:sob}.

\subsection{Proof Sketch: A Bandwidth-Oriented Bound}

Again, we assume the system will expand and add a new node when each node of the system has $\mu S$ data on average. The system has stable writes. Hence, while each node has a write workload of $\lambda$ before expansion, its workload is reduced to $\frac{N}{N+1}\lambda$ after the new node joins.

To prove Theorem~\ref{thm:wsw:bob}, we start from Claim~\ref{claim:bandwidth}, which must be guaranteed by the system. Considering Eq.~\eqref{eq:data4}, we can deduce the following relation:
\begin{equation}
\frac{\mu S}{N+1}\frac{1}{t^{N+1}}>\frac{N}{N+1}\lambda v\label{eq:stbound0}
\end{equation}
According to Eq.~\eqref{eq:stbound0}, the rate of writes at any node must be smaller than the data transfer rate during the system stabilization process. Otherwise, the storage limit $\mu S$ will be exceeded and Claim~\ref{claim:bandwidth} cannot be guaranteed.

Replacing $t^{N+1}$ and $S$ in Eq~\eqref{eq:stbound0} based on Eq.~\eqref{eq:data7}, \eqref{eq:sdata2}, and \eqref{eq:sdata3}, we can deduce the following inequalities:
\begin{align}
b_{N+1}&>\frac{N^2}{N+1}\lambda v\label{eq:stbound1}\\
\Rightarrow b&>N\lambda v\label{eq:stbound2}
\end{align}
With Eq.~\eqref{eq:stbound2}, we have thus proved Theorem~\ref{thm:wsw:bob}.

\section{Clear Stabilization on Stable Writes}%
\label{sec:noswrite}

\emph{Target application scenario:} The application scenario is similar to that in Section~\ref{sec:swrite}, except for the following difference. The system stops receiving any write until the stabilization finishes, though writes will accumulate and must be processed by the system after the stabilization process.

\emph{Results:} We can deduce a bound for the load rebalancing process based on the condition whether the accumulated writes can be processed completely between two expansion processes.

\begin{theorem}[A Time-Oriented Bound for Clear Rebalancing with Stable Writes]
For a DHT-based symmetric system with $N$ nodes, each node has bandwidth $b$. The system adds one node, when each original system node has stored data up to a ratio $\mu$ of its total storage space. Assuming each write is about $v$ bytes on average. To guarantee a successful load rebalancing process without the interference from a write workload, the following inequation must be satisfied for the stable write workload $\lambda N$ on the system:
\begin{equation}
\lambda<\frac{(N+1)(\sqrt{4N+1}-1)}{2N^2}\frac{b}{v}\label{eq:noswrite16}
\end{equation}
\label{thm:nwsw:tob}
\end{theorem}

\vspace{-12pt}With the above theorem, we can make a similar observation as in Section~\ref{sec:noliwrite} that the system size cannot grow too large for a heavy write workload. This observation is valid regardless of whether the write workload increases or remains stable after system expansion. In other words, \textbf{when the write workload is heavy enough, a DHT-based system will come into the scalability problem such that the load cannot be rebalanced on system stabilization}.\vspace{-6pt}

\subsection{Preliminary}

Let the joining node process a total amount $D^{N+1}$ of data in the course of system stabilization. As writes are stopped on system expansion, we can deduce the following equalities:
\begin{align}
D^{N+1}=d^{N+1}\label{eq:noswrite1}\\
b=b_{N+1}\label{eq:noswrite2}
\end{align}

Filling Eq.~\eqref{eq:data5} in Eq.~\eqref{eq:noswrite1}, we can deduce the time for stabilization based on Eq.~\eqref{eq:noswrite2} as follows:
\begin{equation}
t^{N+1}=\frac{d^{N+1}}{b}=\frac{\mu SN}{(N+1)b}\label{eq:noswrite3}
\end{equation}
Notice that, Eq~\eqref{eq:noswrite3} is the same as Eq.~\eqref{eq:nowrite3}. Hence, \textbf{a large system under an extremely heavy workload cannot scale out by adding one node by a clear stabilization process}, no matter the write workload has increased or keeps stable in the course. Here, a large system means a system with a large size $N$.

Under a clear stabilization, writes will accumulate to be processed later, thus requiring a catching-up process afterwards. Assuming that the average write workload takes up about $\alpha b$ bandwidth of each node before system expansion. When the stabilization process completes, the accumulated data can be computed based on Eq.~\eqref{eq:noswrite3}:
\begin{equation}
d_{acc}=t^{N+1}\times N\alpha b=\frac{N^2}{N+1}\mu S\alpha\label{eq:noswrite4}
\end{equation}

After the stabilization process, the bandwidth to be used for catching up the data storage would be $b'_{N+1}$ at each node. As the pre-expansion workload of writes is $N\alpha b$ and the workload is stable, each node will need to spend $\frac{N}{N+1}\alpha$ of its bandwidth for processing writes. Thus, we have the following relation between $b'_{N+1}$ and $b$:
 \begin{equation}
b'_{N+1}=(1-\frac{N}{N+1}\alpha)b\label{eq:noswrite5}
\end{equation}

Combining Eq.~\eqref{eq:noswrite4} with \eqref{eq:noswrite5}, we can deduce the catching-up time as follows:
\begin{equation}
\footnotesize
t_{catchup}=\frac{d_{acc}}{(N+1)b'_{N+1}}=\frac{N^2}{(N+1)(N+1-N\alpha)b}\mu S\alpha\label{eq:noswrite6}
\end{equation}

As described in Section~\ref{sec:expansion}, the system has $\mu SN$ data before expansion. After a clear stabilization, the volume of data does not change, but the total storage space increases from $NS$ to $(N+1)S$. Assuming that an expansion is initiated only when the data volume has reached the limit. On the next expansion, each system node will have $\mu S$ data. Hence, the system can store $\mu S$ more data before the next expansion.

$T_{N+1}$ is the time from the system's initial status till the first expansion is initiated with one node added. And, $T_{N+2}$ is the time when the next expansion happens. Since the write workload remain stable, the system will have a write workload of $N\alpha b$ before and after the expansion. Now, we can compute $T_{N+1}$, as well as the time between this first expansion and the next one as follows:
\begin{align}
T_{N+2}-T_{N+1}=\frac{\mu S}{N\alpha b}\label{eq:noswrite8}\\
T_{N+1}=\frac{\mu S}{\alpha b}\label{eq:noswrite9}
\end{align}

Assuming that the write workload remain unchanged for a sufficiently long time. Based on Eq.~\eqref{eq:noswrite8}, we can accordingly deduce the time between any two consecutive expansion, which is the same as $T_{N+2}-T_{N+1}$. Therefore, if a DHT-based system can scale out and rebalance loads in the course, with a stable write workload, the system must expand at a stable speed, disregarding the size $N$ of the system.
\begin{figure*}[t]
    \begin{subfigure}{0.33\textwidth}%
    \centering%
        \includegraphics[width=\textwidth]{storageBound.eps}%
        \caption{Storage-Oriented Bounds}
        \label{fig:result:sob}
    \end{subfigure}
    \begin{subfigure}{0.33\textwidth}%
    \centering%
        \includegraphics[width=\textwidth]{bandwidthBound.eps}%
        \caption{Bandwidth-Oriented Bounds}
        \label{fig:result:bob}
    \end{subfigure}
    \begin{subfigure}{0.33\textwidth}%
    \centering%
        \includegraphics[width=\textwidth]{timeBound47.eps}%
        \caption{Time-Oriented Bounds}
        \label{fig:result:tob}
    \end{subfigure}
    \caption{The relation curves between the rate of writes and the system size $N$, according to Theorem[\ref{thm:ww:sob},\ref{thm:wsw:sob}], Theorem[\ref{thm:ww:bob},\ref{thm:wsw:bob}], and Theorem[\ref{thm:nww:tob},\ref{thm:nwsw:tob}].}
    \label{fig:result}
\end{figure*}
\subsection{Proof Sketch: A Time-Oriented Bound}

We now sketch the proof for Theorem~\ref{thm:nwsw:tob}. Starting from Claim~\ref{claim:time}, we obtain the following relations:
\begin{equation}
T_{N+2}-T_{N+1}>t_{catchup}\label{eq:noswrite10}
\end{equation}
Filling in Eq.~\eqref{eq:noswrite10} with Eq.~\eqref{eq:noswrite6} and \eqref{eq:noswrite8}, we can deduce the following result:
\begin{equation}
\alpha^2+\frac{N+1}{N^2}\alpha<\frac{(N+1)^2}{N^3}\label{eq:noswrite12}
\end{equation}

According to the result of Eq.~\eqref{eq:noswrite12}, we have $N(\frac{N^2}{N+1}\alpha^2+\alpha-1)<1$. Since $1-\alpha$ is smaller than 1, one can notice that $N$ cannot be too large with regard to a specific $\alpha\in(0,1)$. Thus, if clear stabilization is adopted under a workload with stable writes, \textbf{the system size $N$ cannot grow too large, if load rebalancing is demanded during system stabilization}.

For each node, the arrived writes and the consumed bandwidth are equal before the system expansion, i.e., $v\lambda=\alpha b$. Along with \eqref{eq:noswrite12}, we deduce the following inequation:
\begin{align}
(\lambda+\frac{(N+1)b}{2N^2v})^2&<\frac{b^2(N+1)^2(4N+1)}{4N^4v^2}\label{eq:noswrite15}\\
\Rightarrow \lambda&<\frac{(N+1)(\sqrt{4N+1}-1)}{2N^2}\frac{b}{v}\label{eq:noswrite17}
\end{align}
Solving the above inequation~\eqref{eq:noswrite15} with regard to $\lambda$, we obtain the result of Eq.~\eqref{eq:noswrite17} and thus \eqref{eq:noswrite16}, getting Theorem~\ref{thm:nwsw:tob} proved.

\section{Applications}
\label{sec:app}%
In this section, we demonstrate the practical value of our theoretical results by first examining the corresponding numerical results in real-world settings. Then, we apply these results for analyzing an IoT application scenario.\vspace{-6pt}

\subsection{Numerical Results}
\label{sec:numerical}

\textbf{Storage-Oriented Bounds.} We start with the storage-oriented bounds for stabilization with linearly increasing writes and with stable writes. The related theoretical results are Theorem~\ref{thm:ww:sob} and Theorem~\ref{thm:wsw:sob}. They state the required relations between the rate of writes $\lambda$ and the system size $N$. The relations can be affected by the ratio $\mu$ of used storage space, at which the system expansion is triggered. Setting $\mu$ to different values and assuming $b=1Gbps,v=16B$, we plot the relation curves for $\lambda$ and $N$ in Figure~\ref{fig:result:sob}. As expected, a smaller $\mu$ enables a system to process a heavier write workload. When its size is small, a system with a stable write workload can process writes in higher frequency than that with increasing writes. However, as the system size increases to a large number, e.g., 50, the influence of stable write workloads and that of linearly increasing writes do not differ much for the system.

\textbf{Bandwidth-Oriented Bounds.} We then consider the bandwidth-oriented bounds for stabilization with linearly increasing writes and with stable writes. The related theoretical results are Theorem~\ref{thm:ww:bob} and Theorem~\ref{thm:wsw:bob}. We plot the relation curves for the rate of writes $\lambda$ and the system size $N$ in Figure~\ref{fig:result:bob}. As compared to the results of storage-oriented bounds, the curves for the two write workloads are closer to each other, even when $N$ is small. For the same system size, one can obtain a higher upper bound on the rate of writes when the bandwidth-oriented bounds are employed. However, since a system must simultaneously satisfy both the storage and the bandwidth bounds, we must refer to the results of storage-oriented bounds in practice.

\textbf{Time-Oriented Bounds.} Now, we examine the results of the time-oriented bounds for clear stabilization with linearly increasing writes and with stable writes. The related theoretical results are Theorem~\ref{thm:nww:tob} and Theorem~\ref{thm:nwsw:tob}.  The relation curves for the rate of writes $\lambda$ and the system size $N$ are plotted in Figure~\ref{fig:result:tob}. Comparing the results of Figure~\ref{fig:result:tob} to the previous two figures, we can observe that the time-oriented bounds are much tighter. Therefore, a system employing clear stabilization can process a lower rate of writes than one that receives writes during its expansion process, although to stop receiving writes on stabilization can simplify the system design and implementation.

\subsection{Application Analysis}

Now, we examine the IoT use case presented in Section~\ref{sec:intro}. Before the administrator initiates a system expansion by one node, the rate of writes to the system is $4,800,000$. The average size of a written key-value is about $15*16=240$ bytes for the use case. Each node in the cluster has a network bandwidth of $1Gbps$. Based on the theoretical results of the paper, if we transform the relations between $\lambda$ and $N$ in the use case to the settings of Section~\ref{sec:numerical}, we have that $\lambda$ must be larger than \emph{approximately} $4,800,000$ for Figure~\ref{fig:result}. Accordingly, we can compute the corresponding $N$ for different stabilization choices. Note that the use case has stable writes on system expansion. Hence, if the data has taken up $\mu=0.5$ storage space of each node on average, the system can grow to about $13$ nodes (Figure~\ref{fig:result:sob}). If clear stabilization is used, the system can grow at most to about $17$ nodes (Figure~\ref{fig:result:tob}). These numbers are about the system size that the DHT-based Cassandra broke down at for the IoT use case.

To save the cluster from breaking down, two measures can be taken. First, based on the theoretical results, increasing the network bandwidth will raise the upper bounds for $\lambda$. Second, the system breaks down because of load rebalancing. Hence, if the system does not rebalance loads, the constraints will not take effect, although there would then occur the problem of partial overloading at some system nodes. A better choice is to update the DHT design for the IoT application scenarios. Since there is little room for improving the network bandwidth, the IoT data storage is in fact demanding a redesign of the scalable storage system architecture.

\section{Conclusion}

With regard to the new application scenarios of IoT, we study the scalability and the load balancing properties of DHT systems in this paper. Specifically, we address the load rebalancing problem of DHT, analyzing two factors that are rarely considered before. The two factors are the write workload on the system and the data movement during load rebalancing. It is the advent of IoT data, which come along with extremely heavy writes, that have changed the assumptions underlying the theoretical analysis of DHT systems. We formulate the load rebalancing problem for DHT, considering the impacts of write workloads and data movement during system expansion. For four application scenarios, we show that, the average network bandwidth of each node and the intensity of the average write workload are the two key factors that determine the feasibility of DHT load rebalancing. We prove theoretical bounds on the maximum rates of writes that a DHT-based system can handle, if the system is to rebalance loads in a node-by-node scale-out process. These results indicate that a redesign of the scalable storage system architecture is demanded for applications with heavy write workloads, e.g., IoT.

\balance

\bibliographystyle{IEEEtran}

redpajama_set_name: RedPajamaArXiv


text:
Q: Ruby on Rails active record syntax to query status updates in a twitter style application I have a twitter style application whereby a user follows many people.
This is achieved using a self-referential association.
This all works very nice but my brain has just gone dead while trying to figure out the active record syntax needed to list status updates (posts) from people the user follows ordered by time in a single query.
My user model looks like this
class User < ActiveRecord::Base
    has_many :posts
    has_many :friendships
    has_many :friends, :through => :friendships
end

And the post model is
class Post < ActiveRecord::Base
    belongs_to :user
end

For completeness the Friendship model
class Friendship < ActiveRecord::Base
    belongs_to :user
    belongs_to :friend, :class_name => "User"
 end

Ultimately what I want to do is
@user.friends.reviews.all

A: I'm assuming that a friend is also a User object, so that Friend also has_many :posts:
@user.friends.posts.find(:all, :order => "created_at DESC"

A: I think your problem is stemming from the fact that @user.friends is returning an array and so .posts doesn't exist on an array (even if it's an array of AR objects).
I would probably define something like User#friend_posts which builds up an array of friends posts that you can return.
Something like:
def friend_posts
  posts = []
  friends.each { |friend| posts << friend.posts }
  posts
end

redpajama_set_name: RedPajamaStackExchange


This is a placeholder page for Pamela Shannon, which means this person is not currently on this site. We do suggest using the tools below to find Pamela Shannon.
You are visiting the placeholder page for Pamela Shannon. This page is here because someone used our placeholder utility to look for Pamela Shannon. We created this page automatically in hopes Pamela Shannon would find it. If you are not Pamela Shannon, but are an alumni of Evansville High School, register on this site for free now.


The Republic of Lithuania is a country in northern European with an estimated population of 2.9 million inhabitants. The Lithuanian president is elected directly for a five-year term and is active principally in foreign and security policy. The uni-cameral Lithuanian Parliament, the Seimas, has 141 members. Lithuania declared independence in 1990 and joined the EU in 2004. Pprior to the economic crisis of 2007 – 2010 had one of the fastest growing economies in the European Union. Lithuania has a with a nominal per capita GDP of $34,596 (2018 est.).
Life expectancy in Lithuania is the lowest in the EU, six years below the EU average. Life expectancy for men is nearly 11 years lower than for women, the largest gender gap in the EU. Lithuanians consume more alcohol than any other people in the EU. Excessive alcohol consumption is especially common among men and adolescents. Alcohol-related deaths are more than two times greater than the EU average. Health expenditure per capita in Lithuania is half the EU average. One-third of health spending comes from private sources – largely out-of-pocket payments.
Health inequalities are on the political agenda in Lithuania, with awareness and understanding of the issue among politicians increasing. This is mainly due to European policies and directives that have been put in place, together with WHO advocacy and guidance. Whilst there is no single action plan in place to address the issue of health inequalities there are several cross-sectoral action plans addressing the issue either directly or indirectly which were initiated by either the Ministry of Health or the Ministry of Labour and Social Affairs. Since 2014 a range of different measures have been adopted to reduce health inequalities.
The Action Plan for Reducing Health Inequalities in Lithuania for 2014-2023 (approved by the Health Minister's Order No. V-815 dated of 16 July, 2014). The main purpose of this plan is to reduce heath inequalities among certain Lithuanian regions and different population groups of various socioeconomic status. The Plan consist of 7 Annexes, each of which describes set of activities in a priority field of actions: to improve TB prevention, diagnosis and treatment efficiency; to improve prevention, treatment and accessibility of social integration services for those, addicted to alcohol and other psychoactive substances users; to improve injury and accident prevention and to reduce disability and mortality from external causes; to reduce the morbidity and premature mortality from cardiovascular diseases; to reduce the morbidity and premature mortality from cerebrovascular diseases; to improve access to effective health care for disabled; to improve Children's health promotion, disease prevention and effective treatment.
The Lithuanian Health Strategy for 2014-2025 (approved by the Parliament Resolution No XII-964 dated of 26 June 2014). The main objective of the strategy – to improve the country's population health, increase average life expectancy and reduce health disparities by 2025. The Program sets four objectives: to create a safer social environment, to reduce health inequalities and social exclusion; to develop healthy working and living environment; to create a culture of healthy living; to ensure quality and effectiveness of healthcare system, oriented towards the population needs.
Ministry of Health. The website of the Ministry of Health publishes relevant and useful information about the health system of Lithuania, the organisation of health care in the country and the key decisions of health policy makers.
Please find below an overview of relevant documents addressing health inequality issues in Lithuania. Further publications can be found in our Publications Database.


A group show ofwork by three gallery artists: Jesse Burke's portraits of the homeless, Marc Dombrosky's embroidered found signs, and Patte Loper's graphite drawing of vacant interiors.
For this exhibition of over 20 works on paper, Kelly Mark utilized the now-outdated graphic design tool of dry transferable lettering and patterns known as "Letraset" named after its manufacturer. Popular with designers in the 1970s and 80s, Letraset transfer sheets were available in a large range of typefaces, symbols, graphic elements, and patterns. These graphic elements were transferred to paper by hand-rubbing the vinyl forms down in order to simulate typeset headlines or to add patterns to illustrations. Although still available, this tool has largely been replaced by digital design and the computer.
Kelly lives and works in Toronto. She has exhibited widely across Canada and internationally (including the United States, Australia, and Europe). Exhibition venues include: The National Gallery of Canada (Ottawa, ON), Art Gallery of Ontario (Toronto, ON), The Power Plant (Toronto, ON), Contemporary Art Gallery (Vancouver, BC), Saidye Bronfman Art Center (Montreal, QC), ZieherSmith Gallery (New York, NY), Museum of New Art (Detroit, MI), University of Houston (Houston, TX), Real Art Ways (Hartford, CT), Ikon Gallery (Birmingham, UK), Lisson Gallery (London, UK), and the Physics Room (Christchurch, NZ). She represented Canada in both the 1998 Sydney Biennale and the 2006 Liverpool Biennial. In Seattle, her work has be exhibited at the Henry Art Gallery.
Eric's work has been included in group shows in the Kunsthaus Hamburg and the Outdoor Sculpture Projects at Volta03 in Basel, Switzerland. He has also had solo shows at Gallery4Culture, the Hedreen Gallery at the Lee Center for the Arts, both in Seattle, and the Kolva/Sullivan Gallery in Spokane. His work was included in the group show Unnatural Presence at Platform in 2006 and he mounted a solo show at Art Agents Gallery in Hamburg, Germany in 2008 andHis last solo exhibition at Platform, Prospect Fields, was also in 2008. He received his MFA in 2005 from the University of Washington.
"With this show, we desire to illuminate and challenge the parallels between the disciplines of art and magic(k). Both disciplines share belief systems that rely on a priori knowledge and metaphysics. In order to explore the parallels, we have sought out artifacts of practices rather than traditional art works. The difference between an artifact and an art work is dependent on our perception of an illusion or delusion. The distinction occurs through the acceptance of an idea, a value system that elevates common materials into works of art. In the art market, art achieves phenomenal values akin to precious metals and stones; the artist, the collector, the dealer, critics, and the auction houses transform ordinary materials with little intrinsic value into desirous objects. Creating the commonly agreed upon preciousness of art describes another form of magik, turning earth into gold, and in the art market, it is made possible. In the broader art world, artists can work in futility to achieve the desired transformation of their ideas, intentions into something of value, but that transformation is impossible without the belief of others.
"This show, and it is indeed a show, not an exhibition, presents a range of operators seeking tangible results; materially, socially, or spiritually. The operators include skeptics and believers whose work acknowledges the gap between what is and what could be.
"In Chinese language there are 98 different concepts of "face". They believe the face is a mask with incarnate spirit—a totem—and we are saving or losing it to stay members of society. In some American Indian cultures people use face paint to describe an emotion, augment one's appearance and power, or prepare for battle.
Ariana graduated from the University of Washington with a MFA in Photography in 2005 She has exhibited at Some Space Gallery, SOIL Gallery, and 4Culture Gallery in Seattle and has had solo exhibitions with Magnan Metz Gallery, New York, NY, and Lisa Sette Gallery, Scottsdale, AZ.
Humans are autonomous beings that both act on the world and create within it: we construct and have influence on our surroundings. But at the same time who we are, how we move through space, even the structures we build are all shaped in part by the environment of which we are a part. Adam Satushek looks at that dependent relationship through photography.
This work deals with our corporeal, precarious, and often hilarious relationship to our environment as it invites us to imagine the how, when, and why these particular interactions occurred. We wonder: how will these things change in the future?
Adam graduated from the University of Washington with a BFA in Photography in 2006 and has exhibited at Rake Gallery in Portland, OR, SAM Gallery, Gallery4Culture, and SOIL Gallery in Seattle. His work was part of a two-person show at Platform titled In Between Days in 2007.
Michael has had a solo exhibitions in 2007 and 2009 at Pierogi New York (New York, NY). His work has been included in groups shows at Urbis Art Center (Manchester, United Kingdom, 2009), Neuberger Museum, (Purchase, NY, 2008), Breda's Museum (The Netherlands, 2007), Galerie Adler (Frankfurt, Germany, 2006), and the 2005 Center on Contemporary Art Annual (Seattle, WA, 2005), among others. His work was last seen at Platform in the group show Eden's on Fire in 2008 and was included in McSweeney's #32 and the Better of McSweeney's, Volume 2. He received his MFA from Pratt Institute in New York and is the recipient of a 2007–2008 Pollock-Krasner Foundation Grant.
"Michael Jackson died on the day that I both started and lost my job in Las Vegas. My fellow workers and I drove around that afternoon picking up boxes to move everything out of the closing showroom, crying. Crying because of the death, our own fears, our losses, and crying because, at that moment, we were totally screwed in middle of the desert. 'Neverland'—as a fictional world, an isolated California compound—has always been about our hopes and failures but as is typical in Las Vegas today, usually not in that order. My exhibition, also titled Neverland, unites some of the objects that have mystified, disappointed, thrilled, saddened, and possessed me over the last several months in our new home. These include an embroidered cardboard sign that reads 'FOR SALE', with thread covering scrawled, faded black marker written onto an open, torn-apart box of medical supplies; a black t-shirt depicting Michael Jackson, with the King of Pop now also hand-embroidered over in thick black thread, simultaneously erasing and fixing his image; a shipping blanket patched together and repaired with repurposed pillowcases, tablecloths, and fabric scraps; and a series of found drawings and writings where every handmade mark has been meticulously re-written in matching thread.
"The blanket was given to me a few days after we moved to Las Vegas. It was the beginning of the summer and the blanket was wrapped around pieces of a bed frame. When we took the unit out of storage and assembled it, we started using the blanket to protect our bikes from the relentless Vegas sun. Placed over the bikes, on our patio, the blanket—over the course of only two months—decayed visibly. The blue surface turned to blue dust and with the slightest touch, drifted away. I tried to take a sample to match the color and it turned to powder in my hand, in my pocket. This is what Vegas often feels like now for us; slowly destructive, invisibly weakening, turning to dust in front of our eyes. What happens in Vegas stays in Vegas.


You want the best, brightest, and most extravagant holiday display on the block. You also want to keep your electricity turned on for the remainder of the year. Fortunately, it's possible to do both. You absolutely can deck the halls in a manner that rivals the North Pole without breaking the bank. By planning ahead of time (choosing the right energy planner and making smarter lighting purchases), you can set up an affordable display and keep the holiday spirit alive.
Shopping for the best utility rates will not only guarantee an affordable holiday lighting display, it will also be the gift that keeps on giving. In North America, energy is deregulated in a few markets, including Ontario and Alberta Canada. Learn more here.
In the U.S., 13 states offer deregulated markets that allow consumers to shop around for energy plans. Unfortunately, here in Roanoke, Virginia energy deregulation has been suspended, but gas is still deregulated (Pilot).
Deregulated markets are awesome because only you can research the best price for your needs. You may also enjoy the independence and freedom of choice. Just watch out for "teaser rates" that can suddenly rise, according to Consumer Affairs; you don't want a plan that seems perfect when you're putting up your holiday lights, but that blindsides you later.
Overestimate your lighting needs, and you'll waste money on unused lights. Underestimate, and you'll be rushing to the store for last minute supplies just as prices are at their peak. You can avoid these pitfalls with some careful planning ahead of time.
Energy efficient LED lights are a more economical purchase than standard incandescent holiday lights. Even though LED can be a more expensive purchase from the get-go, they'll be much kinder to your energy bill and will last for many more seasons. If they'll work in your display, mini LED lights are a similarly cheaper and more efficient choice. No matter what kind of bulb you choose, don't forget to set your lighting display on an automatic timer, so you're not wasting bright lights on a sleeping neighborhood.
A great Holiday lighting display isn't just a matter of grabbing the biggest, craziest lights and decorations at the store. With some thoughtful planning ahead – from utility charges, to the design of your display, to the bulbs that comprise it – an exciting display is achievable even for very modest budgets. Put in the planning now, and you and your entire block will be enjoying your holiday lighting show for many seasons to come.
For more on holiday planning, check out the article: Holiday Entertaining Made Easy.


text:
is a two-part original video animation produced by Encourage Films and directed by Junichi Sato. The two parts will be released on Blu-ray Disc and DVD on February 26 and June 25, 2014 respectively, whilst AT-X aired them on December 29, 2013 and May 6, 2014 respectively. The opening theme and ending themes are  and  respectively, both performed by Haruka Chisuga.

Summary
The story takes place in a world where certain individuals possess a power called Incomprehensible Skill of Human beings (ISH), giving them supernatural powers. One of these individuals is Amane Todoroki, a straightforward and somewhat air-headed girl who works as an idol magician for a performance team called Nought. Amane has a twin sister named Lilianne who was born without a body. Unlike Amane, whose ISH is fairly weak, Lilianne is extremely powerful and is able to lend her power to Amane, who uses it in her Nought performances. Amane and Lilianne try to spread the joy of ISH powers via magic shows, but everything changes when Amane is approached by someone from IAM, a group that puts on magic shows like Nought's, but is secretly experimenting with ISH users.

Characters

The main character, a girl who possesses ISH. Her power is weak and she cannot control it very well, but she is able to use the power from her twin sister Lilianne, who possesses an extremely powerful ISH. Amane helps put on magic shows in the hopes that people will come to accept ISH users and give Lilianne's existence a sense of purpose.

Amane's twin sister, who lost her body in her mother's womb. Due to her ISH ability she exists as a spirit form, often residing in the body of a stuffed bear. Despite being one of the most powerful ISH users, she cannot use her abilities by herself as she lacks a proper body. However, she is able to lend her power to Amane and can unleash her full power if she fully merges with her.

A popular magician from the group IAM. She's an ISH user and is sent to investigate Amane's potential. Her ability allows her to create illusions.

The leader of Nought, a group of ISH users who use their powers in magic shows. She is a ISH user but has sealed her powers away. She inspired Amane to become a performer after covering for her when she used Lilianne's full power at a young age.

A member of IAM, who is interested in Amane's potential. Unaware that Amane's powerful ISH comes from Lilianne, he believes her to be an archetype, which was thought to have been extinct.

A performer at Nought who can talk to birds. He wants to excel at magic without using his ISH power.

A performer at Nought who possesses superhuman strength.

An alcoholic fortune teller whom Amane often comes to for advice. She possesses the ISH ability to communicate with Earth, which she refers to as Gaia.

Amane's patron who is quite doting on Amane.

A friend of Kakeru.

A friend of Amane's and a fan of her magic shows. She comes to learn of Amane and Lilianne's powers after they save her from IAM.

Another fan of Amane's shows who is often seen with Kozumi.

A fictional superheroine.

Episode list

References

External links

Action anime and manga
Encourage Films
Magical girl anime and manga
Supernatural anime and manga

redpajama_set_name: RedPajamaWikipedia


text:
Lo ZX Spectrum Vega è una versione miniaturizzata del computer a 8 bit Sinclair ZX Spectrum approvata dall'inventore del computer originale, Clive Sinclair, e prodotta dal 2015.

Storia
Nel 2014 la società britannica Retro Computers Ltd ha annunciato la produzione di una retro-console di videogiochi dello ZX Spectrum, dal prezzo finale di 100 sterline e finanziata in crowdfunding con la piattaforma Indiegogo; secondo il quotidiano britannico The Guardian lo stesso Clive Sinclair avrebbe agito apportando un investimento personale. Al 31 gennaio 2015, erano state raccolte 155.682 GBP, pari al 150% del budget richiesto dal produttore.

Venne poi annunciato e sviluppato il progetto di una nuova versione portatile della console, chiamata ZX Spectrum Vega+, che al 27 marzo 2016 aveva raccolto 512.790 GBP attraverso Indiegogo, pari al 366% del budget richiesto dal produttore. Il prototipo presentava un piccolo display montato tra i comandi, ed è simile ad altre console tascabili con dotazione di circa 1.000 giochi classici già installati e previsto per la commercializzazione a partire dal 20 ottobre 2016. Tuttavia, nonostante l'incasso di un budget multiplo quello richiesto e il successo commerciale del primo modello, la consegna dei modelli ai sottoscrittori del finanziamento on-line è slittata al febbraio 2017, e poi senza data, tanto che nel marzo 2017 la stampa specializzata dubitava della reale produzione della console. L'8 agosto 2017, l'azienda produttrice ha promesso la spedizione dei primi modelli entro 8 settimane dal comunicato, motivando il ritardo con ragioni di carattere tecnico, commerciale (l'acquisizione delle licenze di alcuni tra i videogiochi più famosi per lo Spectrum) e legale. Nei mesi successivi, Retro Computers ha pubblicato sul proprio canale YouTube diversi video di produzione della scocca della mini-console. Il 6 giugno 2018, dopo l'ennesimo rinvio e dopo avere eluso le richieste di Indiegogo a garanzia dei micro-investitori nel progetto, la società di crowdfunding ha annunciato di percorrere le vie legali per recuperare i soldi investiti dai propri utenti.

Caratteristiche

Hardware
Lo ZX Spectrum Vega ha la forma di un gamepad per console che contiene la componentistica elettronica basata su processore ARM e riproduce il design del computer originale firmato da Rick Dickinson, con i tasti necessari al gioco (direzione, fuoco, opzioni) e senza una tastiera fisica completa: questa caratteristica sfavorisce la programmazione e caratterizza la macchina più come una console per giochi.

Per l'uso, è necessario collegare la console a un televisore con il cavo fornito, che prevede solamente una interfaccia video a componenti; non è presente una presa HDMI, e nemmeno l'adattatore SCART, è alimentata da un cavo micro USB da collegare ad una spina elettrica. Utilizza una tastiera virtuale, con l'iterazione del cursore su ogni tasto: lettere dell'alfabeto, numeri e simboli sono raccolti in gruppi, per passare da un gruppo all'altro si usano i tasti direzionali, quindi le lettere sono assegnate ai quattro tasti principali di input.

Software
La confezione recita "mille giochi classici pre-caricati", e sono inclusi anche quelli di software house come Ultimate Play the Game che avevano sempre rifiutato di acconsentire alla libera distribuzione dei vecchi codici degli anni '80. È possibile caricare altri giochi in formato TZX e aggiornare il firmware della macchina, usando una scheda microSD.

Note

Voci correlate
 Clive Sinclair
 Sinclair ZX Spectrum

Altri progetti

Collegamenti esterni
 Retro Computers Ltd
 Retro Computers – canale YouTube

Console
Retrogaming


text:
Home »News »Stan: What's New For 10 August - 16 August 2021
Stan: What's New For 10 August - 16 August 2021
Another huge list of updates from Stan this week. Which is just as well, since we all need something new to watch during this never-ending lockdown.
A couple of new series have just ended up on Stan. Heels has an interesting premise - two brothers fighting over their late father's wrestling promotion, the Duffy Wrestling League set in small-town Georgia. New British crime drama Deceit also looks promising. Both series will be "airing" new episodes on a weekly basis.
The mid-season premiere of Godfather of Harlem is here (new episodes weekly) and there is also a new season of MacGyver (complete season 5).
There is also a new season of the new Doctor Who series to look forward to, as well as quite a few older series. This should occupy a few months of your time.
Movies, Documentaries:
Some great movies just became available on Stan. If you're looking for something more recent, and definitely more topical, Suicide Squad might be what you're after, especially with the sequel in cinemas and on premium VOD right now.
Then there's Christopher Nolan's The Prestige, Tom Cruise in Risky Business, John Travolta shortly after his renaissance in Michael (obligatory John Travolta dancing scene), the original and still the best Dumb and Dumber (skip the pseudo sequel and the actual sequel), Beetlejuice, The Truman Show, Saving Private Ryan, The Notebook, and Kiss Kiss Bang Bang.
All the Friday The 13th movies have also just been added to Stan, even including Freddy vs Jason.
Those looking for documentary series should check out the superb Life Below Zero, the fascinating Tattoo Fixers Extreme or Panorama: Catching the Catfish.
Release List:
You can view last week's list here.
Here's the complete list of the new additions to Stan for the week of Stan: What's New For 10 August - 16 August 2021 (Content highlighted above shown in bold below):
Desus & Mero - Season 3, Episode 40-41
Heels - New Series (Season 1, Episode 1)
Power Book III: Raising Kanan - Season 1, Episode 5
Deceit - New Series (Season 1, Episode 1)
Walker - Season 1, Episode 18
Drag Race Holland - Season 2, Episode 2
The L Word: Generation Q - Season 2, Episode 2
RuPaul's Drag Race: All Stars - Season 6, Episode 9
RuPaul's Drag Race: All Stars Untucked - Season 6, Episode 9
Doctor Who - New Season (Season 12)
Doctor Who: The Five Doctors
Doctor Who: Attack of the Cybermen
Doctor Who: Remembrance of the Daleks
Doctor Who: Shada
Doctor Who: The Dalek Invasion of Earth
Doctor Who: The Daleks
Doctor Who: The Two Doctors
Doctor Who: Genesis of the Daleks
Doctor Who: Death to the Daleks
Doctor Who: Revenge of the Cybermen
Doctor Who: Day of the Daleks
Doctor Who: Resurrection of the Daleks
Doctor Who: The Three Doctors
Doctor Who: Revelation of the Daleks
Doctor Who: Planet of the Daleks
Doctor Who: The Macra Terror
Doctor Who: Power of the Daleks
Miracle Workers - Season 3, Episode 5
Godfather of Harlem - Season 2, Episode 7
The Republic of Sarah - Season 1, Episode 9
MacGyver - New Season (Season 5)
Life Below Zero - New Documentary Series
Tattoo Fixers Extreme (UK) - New Documentary Series
Sins of the City - Season 1, Episode 14
Panorama: Catching the Catfish - New Documentary Series
Friday The 13th (1980)
Friday The 13th Part II
Friday The 13th Part III
Friday The 13th Part IV: The Final Chapter
Friday The 13th Part V: A New Beginning
Friday The 13th Part VI: Jason Lives
Friday The 13th Part VII: The New Blood
Night (2007)
Kiss Kiss Bang Bang
Look Back In Angus
The Saddle Club
Scooby-Doo! and the Witch's Ghost
Strawberry Shortcake's Berry Bitty Adventures - New Episodes
Monster Family

redpajama_set_name: RedPajamaCommonCrawl


text:
Other Insights
Fleet Alliance is recruiting SME-focused Appointed Representatives
COP26 accelerates move to electrification
CES 2022: your fleet future today
Lower EV grant does not change fleet electrification trajectory
Being an Appointed Representative: An Introduction
Insights / Current Post
Tesla Wallchargers power up Scottish homes
Fiona Irving
In an interesting interplay between electric vehicle technology and home heating provision, a battery storage project has helped to reduce energy costs in 133 homes in Dumfries and Galloway, Scotland.
Using wallchargers made by Tesla the electric car maker, Warmworks Scotland has managed to deliver lower heating costs to targeted properties owned by Dumfries and Galloway Housing Partnership where electricity is the only available form of energy.
Participants in the trial were encouraged to swap energy providers once a smart meter was installed, with an 83% drop in energy bills recorded as the greatest saving overall.
One of the residents who benefited from the battery installation said:
"Well I don't mean to be overly dramatic but it has been life changing for me. Before this opportunity came along, I was having problems and now I'm much better off. My bills before were £125 per month and now it's down to £75. It's like winning the lottery, totally life changing. Especially when you get old; I am 62 and still working.
"I feel the cold more and I have health issues, which can cause me problems. I also work in social care and don't make a lot of money. I can't stress any more how much of a difference this battery has made to me."
Not only did the Tesla wallcharger, known as a Powerwall, offer energy storage for reduced bills, but also provided residents security of supply in the event of electricity blackouts.
Tesla has also been pivotal in the switching of fleet drivers into electric vehicles, with the Model 3 topping the sales charts in June according to latest figures from the SMMT. The same month also saw battery electric vehicles also outsell diesel vehicles for the first time.
"As we approach the COP26 conference climate, which takes place next door to the Fleet Alliance offices, this innovative energy solution provided by Warmworks Scotland is an indicator that we need new thinking to meet the challenges of decarbonisation," commented Martin Brown, Managing Director of Fleet Alliance.
"As a business we have decarbonised the company's own vehicles, but we have realised we need to do more and we are now undertaking a full carbon audit to identify the correct strategies required to become carbon zero. It's an ambitious goal, but it's vital to prevent further global warming."
The COP26 climate conference takes place this November at the Glasgow Scottish Event Campus.
Image: SPEN
Fleet Alliance is actively recruiting new Appointed Representatives (ARs) to join its award-winning company You'll ...
The COP26 climate conference is now over with a commitment to vehicle electrification in place On a global basis, the...
Presidency programme announced for COP26
The programme of events has been released for the COP26 climate conference taking place between 31 October to 12 Novembe...
COP26 President-Designate Alok Sharma on why Glasgow must deliver
Ahead of the Glasgow conference on climate change - COP26 - President Sharma spoke on Tuesday in Paris (12 October) abou...
EV Rally of Scotland to take place during COP26
A rally to demonstrate the effectiveness of Scotland's EV charging infrastructure will take place during COP26 (01-12 No...
Fleet Alliance Provides the Driving Force Behind Scotland's Renewable Energy COP26 Roadshow
Glasgow-based leasing and fleet management company, Fleet Alliance, is providing a zero-emission vehicle to help promote...
Glasgow receives £4.8m funding for active travel ahead of COP26
Glasgow City Council is being awarded an additional £48m in grant funding to help support the city's sustainable transp...
Government lays out greenprint for decarbonising transport
The Government has announced its Transport decarbonisation plan ahead of COP26 in Glasgow at the beginning of November ...
Ready to make the management of your fleet more efficient?
Your Phone Number**
Your Company**
Your Email Address**


text:
Q: What is a good way to create and update entities using Angular? I am using Angular now for about 2-3 weeks and have only used data binding and have made attempts to create directives. Now I'd like to save an object to the server.
The domain model looks like this:
public class Customer
{
    public int Id { get; set; }
    public string Code { get; set; }
    public string CompanyName { get; set; }
    public string EmailAddress { get; set; }
    public DateTime BirthDate { get; set; }
    public string BSNNo { get; set; }
    public string IdCardNo { get; set; }
    public bool Deceased { get; set; }
    public Gender Gender { get; set; }
    public Title Title { get; set; } // Title is an enum
    internal bool IsActive { get; set; }

    public PersonName Name { get; set; } // A value object
    public PhoneNumber DayPhone { get; set; } // A value object
    public PhoneNumber OtherPhone { get; set; }

    public virtual Address Address { get; set; } // A value object
    public virtual Address PostallAddress { get; set; }
}

Now I've created a corresponding HTML form and when I submit this form, it will be handled by Angular. But now I am wondering what the best/recommended way is to save this form.
FYI: We are using ASP.NET MVC 4

A: We find $resource to be a great way to go.  The $httpBackend service allows for easy testing as well.  We have something like the following and it works well for us.  You can always drop back to the $http service if you want a little more control.
View
<!DOCTYPE html >

<html ng-app="myApp">
<head>
</head>
<body ng-controller="CustomerController">
    <form name="form" novalidate>
        <input type="text" ng-model="customer.name" required />
        <input type="text" ng-model="customer.address" required />
        <button ng-click="add(customer)">Save</button>
    </form>
    <script src="~/Scripts/angular.js"></script>
    <script src="~/Scripts/angular-resource.js"></script>
    <script src="~/Scripts/app/app.js"></script>
    <script src="~/Scripts/app/services/customerResource.js"></script>
    <script src="~/Scripts/app/controllers/CustomerController.js"></script>

</body>
</html>

Service:
myApp.factory('customerResource', function($resource){
  var resource = $resource('/data/customer/:id', { id: '@id' }, { 'put' : {method:'PUT' } });

  return {
    getAll : function(){
        return resource.query();
    },
    add : function(customer){
            return resource.save(customer);
    },
    update : function(customer){
            return resource.put({ id: customer._id }, customer);
    },
    remove : function(id){
            return resource.remove( { id: id });
    }
  };
});

Controller:
myApp.controller('CustomerController', function($scope, customerResource) {

  $scope.customer = {};

  $scope.customers = customerResource.getAll();

  $scope.add = function(customer){
    $scope.customers.push(customerResource.add(customer));
  }

  $scope.update = function(customer){
    customerResource.update(customer);
  }

  $scope.remove = function(customer){
    customerResource.remove(customer._id);
    $scope.customers.splice($scope.customers.indexOf(customer), 1);
  }
});

Very basic testing:
describe('customerResource', function(){
  beforeEach(module('myApp'));

  describe('getAll', function(){

    it('should issue a GET request to /data/customer', inject(function(customerResource, $httpBackend){
      $httpBackend.expectGET('/data/customer').respond([{ level: '5'}]);

      var customers = customerResource.getAll();
      $httpBackend.flush();

      expect(customers[0].level).toBe('5');
  }));

  it('should return an array of custoemrs', inject(function(customerResource, $httpBackend){
    $httpBackend.when('GET', '/data/customer').respond([{ level: '5'}, { level: '6'}]);

    var customers = customerResource.getAll();
    $httpBackend.flush();

    expect(customers[0].level).toBe('5');
    expect(customers[1].level).toBe('6');
  }));
});

MVC Action (ADD - MVC model binders will do the work of parsing the html params into the VM):
[HttpPost]
public ActionResult Customer(Customer customer)
{
        // add the customer to the database or whatever
}

ViewModel:
public class Customer
{
    public string Name { get; set; }
    public string Address { get; set; }
}

The HTTP request will look something like:
Request URL:http://mywebsite/data/customer
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:application/json, text/plain, */*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-GB,en;q=0.8,en-US;q=0.6
Cache-Control:no-cache
Connection:keep-alive
Content-Length:30
Content-Type:application/json;charset=UTF-8
Host:mywebsite
Origin:http://mywebsite
Pragma:no-cache
Request Payloadview source
  {name:somename, address:someaddress}
  address: "somename"
 name: "someaddress"

HTH

A: Try taking a look at breeze.js - it includes some handy change tracking and also has .Net Linq style syntax for querying a OData/WebAPI services where the query will actually be run server-side. It's like $resource but on steroids.


I love the East Midlands and the region features heavily in my novels (current novel Leicester, next novel Nottingham and the third novel Derbyshire) so I've decided, for the paperback release of 'The Things We Thought We Knew', to do an East Midlands Book Tour! I'll be visiting Nottingham, Market Harborough, Leicester and Derby Waterstones stores as well as doing a Twitter Q&A (just send me your question with @mahsudasnaith in your tweet). All events free, just ask in store for tickets. I am very excited to see you all!
I often get asked at author events if my novel is auto-biographical. The story is centred around a British-Bangladeshi girl growing up on a council estate in Leicester, so I say 'no, not autobiographical at all'. And for a long time I didn't really think it was. I write to escape, to put myself in other people's shoes, to revel in the fun of making stuff up. But recently when I was asked at an event if I, like the central character of 'The Things We Thought We Knew', have ever suffered from a condition like chronic pain I realised that, in my early 20's, I had suffered with a mysterious condition that left me drained of all energy, in physical pain and isolated in my mother's council estate house.
So no, not autobiographical at all.
As part of International Women's Day (March 8th) and for the Penguin #LikeAWoman celebrations I was asked to write a piece about women who have inspired me. The more I thought about it the more I realised that the women who have inspired and, what's more, have CHANGED me are rebellious, fearless women who don't care one iota about societal norms. I'm going to keep on trying to be a bit more like them every day. It might be a slow rebellion, but it will be a rebellion nonetheless!
Last night was the official launch of 'The Things We Thought We Knew' in my home town of Leicester and in the Waterstones I worked in over 15 years ago. Surreal is just one word to sum up the night. Surreal to be back in the same store I fantasised about being a writer in, surreal to have all the people I love in one room and surreal to be signing copies of my published novel for them.
As a writer, you quietly tap away at your keyboard, hoping one day all the words you've carefully strung together will be good enough to entertain and enthral readers in the future. You become attached to each character, knowing their habits and innermost thoughts. You plan their futures and fear for them as though they are real, solid people who live around the corner from you. Then you come to the time when you have to let them go. They stop being yours and become others. It's a scary but wonderful time and that time has now come. I hereby release 'The Things We Thought We Knew' into the world! I hope people will enjoy reading the book as much as I loved writing it and cherish those characters as though they are friends. I hope too that other writers will see that dreams can come true. You don't need lots of money and connections to be a writer but what you do need is determination and passion for writing that you can't quit. If the Asian dyslexic girl from the council estate can do it, so can you.
Thanks to everyone who could come to last night's launch (and Farhana Shaikh for the above photograph) as well as my agent James Wills, editor Lizzy and publicist Tom who made the trip up to see the novel off. Now for publication day which is tomorrow (eek!). Let the surreal days continue.