
a result) real systems often provide inadequate support, making ap-
plication developers handle DDL operations “in the trenches” (e.g.,
with external third-party tools [
38
]) and often describe DDL opera-
tions as “dicey” and “dangerous” [
50
]. Consequently, application
developers often try their best to avoid DDL operations, limiting
application functionality and end-user experience.
1.2 Tesseract: Data-Denition-as-Manipulation
This paper presents Tesseract, a new approach to non-blocking
and transactional schema evolution in MVCC systems without the
aforementioned limitations.
Tesseract provides bake-in support for online and transactional
schema evolution by directly adapting the concurrency control (CC)
protocol in MVCC database engines. This is enabled by leveraging
two very simple but useful observations: (1) Conceptually, transac-
tional DDL operations can be modeled by “normal” transactions of
DML statements that modify the schema and (sometimes option-
ally) entire tables involved. (2) In MVCC systems—thanks to their
built-in versioning support—schemas can be stored as versioned
data records and be used to participate concurrency control in ways
similar to “normal” data accesses for determining table data vis-
ibility. When combined, these observations allow us to devise a
data-denition-as-manipulation (DDaM) approach that supports
online and transactional DDL almost “for free” by slightly tweak-
ing the underlying SI protocol within the database engine, without
having to rely on additional features such as views and triggers.
Like classic catalog management designs [
44
], Tesseract asso-
ciates each table (or other resources, such as a database) with a
schema record which is stored in a catalog table which in turn
has a predened schema (e.g., table name, constraints, etc.). Us-
ing the system’s built-in versioned storage support, such schema
records are also multi-versioned. This allows us to implement DDL
operations as simple as (1) appending a new schema version via
standard record update routines and (2) nishing data verication
and migration, both in a single transaction that follows the commit
and rollback processes of the underlying CC protocol. To access a
table, the DML transactions simply follows the standard SI proto-
col to read the table’s schema record version that is visible to the
transaction. The schema version record then dictates which data
record versions should be accessed by the transaction.
DDaM is straightforward in concept, but realizing it requires
careful considerations. Specically, DDL transactions can be very
long by accessing entire tables, and so could block the progress
of other transactions, or be aborted due to frequent conicts with
concurrent transactions. It also adds prohibitively high footprint
tracking overhead for writes if we were to follow the SI protocol
naively. Moreover, concurrent DDL and DML operations must be
handled with care to ensure that logically, a DML transaction with
work done based on an older schema version never commits after
a newer schema has been installed (otherwise subsequent reads
would interpret the old content based on a new schema version,
leading to potentially wrong results). To this end, in later sections,
we propose a relaxed DDaM design that further adapts the SI pro-
tocol to allow more concurrency and reduce unnecessary aborts.
Relaxed DDaM is the key for Tesseract to achieve online schema
evolution without sacricing much for DML operations.
Although we focus on MVCC in this paper, single-versioned
systems could adopt Tesseract if extra (but straightforward) steps
are taken to support versioned schema; we discuss possible solu-
tions later. Tesseract can also work with existing lazy migration
approaches [
4
] to support instant deployment of compatible schema
changes, which we demonstrate in later sections.
We have implemented and integrated Tesseract with ERMIA [
22
],
a main-memory MVCC database engine, as its schema management
and evolution solution. Following past work, we use several rep-
resentative schema evolution workloads to evaluate Tesseract. On
a 40-core server, compared to prior approaches, Tesseract allows
the system to evolve database schemas without service downtime
or signicantly impacting application performance. As we show
in detail later, we often observe only up to
∼
10% of drop for DML
operations with DDL operations that involve heavyweight data
copying such as adding a column eagerly.
1.3 Contributions and Paper Organization
This paper makes four contributions.
1
We make the key obser-
vation that schema evolution can be models as modifying entire
tables, to unify DDL and DML handling and propose a simple but
useful data-denition-as-manipulation (DDaM) approach for trans-
actional and non-blocking DDL operations.
2
We show how simple
tweaks can be applied to common snapshot isolation protocols to
easily and natively support transactional and non-blocking DDL
without ad hoc “patches.”
3
Based on DDaM, we build Tesseract
to show Tesseract’s feasibility and address challenges brought by
DDaM.
4
We compile a comprehensive set of schema evolution
benchmarks to evaluate Tesseract and related work. Tesseract is
open-source at hps://github.com/sfu-dis/tesseract.
Next, we start with the necessary background in Section 2, and
give the basic idea and simple tweaks needed for SI to handle DDL
natively in Sections 3–4. Section 5 then describes Tesseract in detail
and addresses the challenges of DDaM. We cover evaluation in
Section 6 and related work in Section 7, before Section 8 concludes.
2 MVCC BACKGROUND
In this section, we give the necessary background on MVCC and
clarify the assumptions we make throughout the paper.
2.1 Database Model
Following past and recent work on memory-optimized MVCC [
7
,
11
,
12
,
22
,
31
,
55
], we adopt the MVCC model described by Adya [
1
]
where the database consists of a set of records, each of which is
represented by a sequence of totally-ordered versions. An update
then appends a new version to the sequence and delete is modeled as
a special case of update that appends a tombstone version. Similarly,
inserting a record is treated as an update that appends the rst valid
version for the record. To read a record, the transaction picks a
version that is visible to it depending on the isolation level used
(described later). To facilitate this, the system maintains a central
counter usually implemented as a 64-bit integer [
11
,
22
]. Upon
start (or accessing the rst record), the transaction reads the global
counter to obtain a begin timestamp. Upon commit, the transaction
atomically increments the global counter (e.g., using the atomic
fetch-add or compare-and-swap instruction [
20
]) to obtain a commit