as closed loops. We think about the predictability of their
behavior in terms of predictable inputs producing predictable outputs. This is a necessity for creating correct software systems. The good news in many cases is that using
BASE doesn’t change the predictability of a system as a
closed loop, but it does require looking at the behavior in
total.
A simple example can help illustrate the point. Consider a system where users can transfer assets to other
users. The type of asset is irrelevant—it could be money
or objects in a game. For this example, we will assume
that we have decoupled the two operations of taking the
asset from one user and giving it to the other with a message queue used to provide the decoupling.
Immediately, this system feels nondeterministic and
problematic. There is a period of time where the asset has
The good news is that
using BASE doesn’t change
the predictability of a system as
a closed loop, but it does require
looking at the behavior in total.
left one user and has not arrived at the other. The size of
this time window can be determined by the messaging
system design. Regardless, there is a lag between the begin
and end states where neither user appears to have the
asset.
If we consider this from the user’s perspective, however, this lag may not be relevant or even known. Neither
the receiving user nor the sending user may know when
the asset arrived. If the lag between sending and receiving
is a few seconds, it will be invisible or certainly tolerable
to users who are directly communicating about the asset
transfer. In this situation the system behavior is considered consistent and acceptable to the users, even though
we are relying upon soft state and eventual consistency in
the implementation.
EVENT-DRIVEN ARCHITECTURE
What if you do need to know when state has become
consistent? You may have algorithms that need to be
applied to the state but only when it has reached a consistent state relevant to an incoming request. The simple
approach is to rely on events that are generated as state
becomes consistent.
Continuing with the previous example, what if you
need to notify the user that the asset has arrived? Creating an event within the transaction that commits the
asset to the receiving user provides a mechanism for performing further processing once a known state has been
reached. EDA (event-driven architecture) can provide
dramatic improvements in scalability and architectural
decoupling. Further discussion about the application of
EDA is beyond the scope of this article.
CONCLUSION
Scaling systems to dramatic transaction rates requires a
new way of thinking about managing resources. The traditional transactional models are problematic when loads
need to be spread across a large number of components.
Decoupling the operations and performing them in turn
provides for improved availability and scale at the cost of
consistency. BASE provides a model for thinking about
this decoupling. Q
REFERENCES
1. http://highscalability.com/unorthodox-approach-database-design-coming-shard.
2. http://citeseer.ist.psu.edu/544596.html.
LOVE IT, HATE IT? LET US KNOW
feedback@acmqueue.com or www.acmqueue.com/forums
DAN PRITCHETT is a Technical Fellow at eBay where he has
been a member of the architecture team for the past four
years. In this role, he interfaces with the strategy, business,
product, and technology teams across eBay marketplaces,
PayPal, and Skype. With more than 20 years of experience at
technology companies such as Sun Microsystems, Hewlett-Packard, and Silicon Graphics, Pritchett has a depth of
technical experience, ranging from network-level protocols
and operating systems to systems design and software patterns. He has a B.S. in computer science from the University
of Missouri, Rolla.
© 2008 ACM 1542-7730/08/0500 $5.00