
0
10000
20000
30000
40000
50000
60000
70000
80000
90000
0 1 5 10 20 50 100
throughput (txns/sec)
% cross-region transactions
Low contention
High contention
Figure 1: Single-master throughput under contention.
reads and writes — as long as those reads and writes initiate from
a region near the master region for the data being accessed.
Many workloads have a locality in their access patterns. For
example, for applications that revolve around users, the data as-
sociated with a user is heavily skewed to being accessed from the
physical location of that user. Thus, for these workloads, it is possi-
ble to achieve strict serializability and low latency writes. However,
arbitrary transactions may access multiple data items, where each
data item is mastered at a different region. For such transactions,
achieving strict serializability requires coordination across regions.
Existing approaches prevent conflicting transactions from running
during this coordination. Cross-region coordination is time con-
suming since messages must be sent over a WAN. Thus, the time
window that conflicting transactions cannot run is large, which re-
duces system throughput. For example, we implemented a version
of NuoDB
1
, and ran some benchmarks (see Section 4) where we
varied the contention level and percentage of multi-region transac-
tions. As shown in Figure 1, under high contention, the through-
put of the system dropped dramatically at even low percentages
of multi-region transactions, and also fell (although less dramati-
cally) at low contention. For this reason, many systems that allow
different data to be controlled by different regions do not support
multi-region transactions, such as PNUTS [20] and DPaxos [58].
In this paper, we present the design of a system, SLOG, that is
the first (to the best of our knowledge) to achieve all three: (1)
strict serializability (2) low-latency reads and writes (on at least
some transactions) and (3) high throughput. SLOG uses locality in
access patterns to assign a home region to each data granule. Reads
and writes to nearby data occur rapidly, without cross-region com-
munication. However, reads and writes to remote data, along with
transactions that access data from multiple regions, must pay cross-
region communication costs. Nonetheless, SLOG uses a determin-
istic architecture to move most of this communication outside of
conflict boundaries, thereby enabling these transactions to be pro-
cessed at high throughput, even for high contention workloads.
SLOG supports two availability levels: one in which the only
synchronous replication is internally within a home region (which
is susceptible to unavailability in the event of an entire region fail-
ure), and one in which data is synchronously replicated to one or
more nearby regions (or availability zones) to achieve an availabil-
1
NuoDB declined to give us their software, so we implemented our
own version. NuoDB uses a MVCC protocol that is susceptible to
write skew anomalies. Our version used locking instead in order to
guarantee strict serializability.
ity similar to Amazon Aurora [89, 90] where the system remains
available even in the event of a failure of an entire region. Unlike
Spanner, Cosmos DB, Aurora, or the other previously cited systems
that support synchronous cross-region replication, SLOG’s deter-
ministic architecture ensures that its throughput is unaffected by
the presence of synchronous cross-region replication.
2. BACKGROUND
SLOG supports strictly serializable transactions that access data
mastered in multiple regions. Unlike systems such as L-Store [49]
and G-Store [23], which remaster data on the fly so that all data
accessed by a transaction becomes mastered at the same physical
location, SLOG does not remaster data as part of executing a trans-
action. Instead, it utilizes a coordination protocol across regions to
avoid data remastership. One important technique used by SLOG
to overcome the scalability and throughput limitations caused by
coordination across partitions is to leverage a deterministic execu-
tion framework. Our technique is inspired by the work on Lazy
Transactions [30], Calvin [87, 88], T-Part [92], PWV [31], and Fau-
naDB [1] which use determinism to move coordination outside of
transactional boundaries, thereby enabling conflicting transactions
to run during this coordination process.
In the above-cited deterministic systems, all nodes involved in
processing a transaction — all replicas and all partitions within a
replica — run an agreement protocol prior to processing a batch
of transactions that plans out how to process the batch. This plan
is deterministic in the sense that all replicas that see the same plan
must have only one possible final state after processing transactions
according to this plan. Once all parties agree to the plan, processing
occurs (mostly) independently on each node, with the system rely-
ing on the plan’s determinism in order to avoid replica divergence.
This approach prevents the dramatic reductions in throughput under
data contention that are observed in systems such as NuoDB [66,
67] and the strictly serializable transaction implementation on top
of FuzzyLog [53] that perform coordination inside transactional
boundaries, and G-Store and L-Store which prevent contended data
access during the remastering operations.
Determinism also reduces latency and improves throughput by
eliminating any possibility of distributed and local deadlock [7, 70,
78, 79, 87], and reducing (or eliminating) distributed commit pro-
tocols such as two-phase commit [7, 83, 84, 86, 87].
Unfortunately, in order to create a deterministic plan of execu-
tion, more knowledge about the transaction is needed prior to pro-
cessing it relative to traditional nondeterministic systems. Most
importantly, the entire transaction must be present during this plan-
ning process. This makes deterministic database systems a poor fit
for ORM tools and other applications that submit transactions to
the database in pieces.
Second, advanced planning usually requires knowledge regard-
ing which data will be accessed by a transaction [33, 34, 83, 87].
Most deterministic systems do not require the client to specify this
information when the transaction is submitted. Instead they at-
tempt to statically derive this knowledge from inspecting the trans-
action code [87], make conservative estimates [31], and/or specu-
latively execute parts of the transaction, such as the OLLP protocol
in Calvin or the multi-stage execution process in FaunaDB.
SLOG’s use of determinism causes it to inherit both of these re-
quirements. As we will describe in Section 4, we implement SLOG
inside the open source version of Calvin’s codebase. Since Calvin
uses a combination of static analysis and OLLP to determine read
and write sets prior to transaction execution, our implementation
also uses these techniques.
1748
评论