fails. Note, that if we would read from different work-
ers, we could be unlucky and read from a delayed or
from a server belonging to a separated partition.
4.2.4 Read-my-writes
It is guaranteed that effects of all updates performed
by the client, are visible to the client’s subsequent
reads. If a client updates data and then reads this data,
then the read will return the result of this update (or
an update that was done later) (Terry, 2013).
In Lorq, the read-my-writes consistency is guaran-
teed in the way similar to that of bounded staleness.
• let read(x) be a read operation issued by a client
with identifier clId, and let read(x) = (x,v,t) in
an arbitrarily chosen server;
• let O
clId
be the set of operations stored on server’s
log, and issued by clId;
• if O
clId
is empty, then read(x) is the result;
• otherwise, apply all operations from O
clId
, in in-
creasing order, to the auxiliary database AuxDB =
{(x,v,t)}; next, perform read(x) against the final
state of AuxDB.
5 CONCLUSIONS AND FUTURE
WORK
We proposed a new algorithm, called Lorq, for man-
aging replicated data based on the consensus quo-
rum approach. Lorq, like another consensus quorum
algorithms, is devoted for data-centric applications,
where the trade-off between consistency, availability
and partition tolerance must be taken into account.
The implementation of Lorq make advantages of the
modern software engineering methods and tools ori-
ented to asynchronous and parallel programing. In
future work, we plan to extend the Lorq algorithm
to take advantages of so-called replicated data types
(Burckhardt et al., 2014; Shapiro et al., 2011). We
plan also to prepare and conduct some real-system ex-
periments. This research has been supported by Pol-
ish Ministry of Science and Higher Education under
grant 04/45/DSPB/0136.
REFERENCES
Abadi, D. (2012). Consistency tradeoffs in modern dis-
tributed database system design. IEEE Computer,
45(2):37–42.
Amazon DynamoDB Pricing (2014). http://aws.amazon.
com/dynamodb/pricing.
Asynchronous Programming with Async and Await
(2014). http://msdn.microsoft.com/en-us/library/
hh191443.aspx.
Bernstein, P. A., Hadzilacos, V., and Goodman, N. (1987).
Concurrency Control and Recovery in Database Sys-
tems. Addison Wesley Publishing Company.
Burckhardt, S., Gotsman, A., Yang, H., and Zawirski, M.
(2014). Replicated data types: specification, verifi-
cation, optimality. In ACM SIGPLAN-SIGACT Sym-
posium on Principles of Programming Languages,
POPL’14, pages 271–284.
Cattell, R. (2010). Scalable SQL and NoSQL data stores.
SIGMOD Record, 39(4):12–27.
Chang, F., Dean, J., Ghemawat, S., Hsieh, W. C., and et
al. (2008). Bigtable: A distributed storage system for
structured data. ACM Trans. Comput. Syst., 26(2).
Cooper, B. F., Ramakrishnan, R., Srivastava, U., Silber-
stein, A., and et al. (2008). PNUTS: Yahoo!’s hosted
data serving platform. PVLDB, 1(2):1277–1288.
Corbett, J. C., Dean, J., Epstein, M., and et al. (2013). Span-
ner: Google’s globally distributed database. ACM
Trans. Comput. Syst., 31(3):8.
DeCandia, G., Hastorun, D., Jampani, M., and et al. (2007).
Dynamo: Amazon’s highly available key-value store.
SIGOPS Oper. Syst. Rev., 41(6):205–220.
Gafni, E. and Lamport, L. (2000). Disk Paxos. In Dis-
tributed Computing, DISC 2000, LNCS 1914, pages
330–344. Springer.
Gifford, D. K. (1979). Weighted Voting for Replicated Data.
In ACM SIGOPS 7th Sym. on Op. Systems Principles,
SOSP’79, pages 150–162.
Gilbert, S. and Lynch, N. A. (2012). Perspectives on the
CAP Theorem. IEEE Computer, 45(2):30–36.
Golab, W., Rahman, M. R., AuYoung, A., Keeton, K., and
Li, X. S. (2014). Eventually consistent: Not what you
were expecting? Commun. ACM, 57(3):38–44.
Lakshman, A. and Malik, P. (2010). Cassandra: A de-
centralized structured storage system. SIGOPS Oper.
Syst. Rev., 44(2):35–40.
Lamport, L. (2006). Fast Paxos. Distributed Computing,
19(2):79–103.
Ongaro, D. and Ousterhout, J. (2014). In Search of an Un-
derstandable Consensus Algorithm. In USENIX An-
nual Technical Conference, pages 305–319.
Pankowski, T. (2015). A consensus quorum algorithm for
replicated NoSQL data. In BDAS 2015, Communi-
cations in Computer and Information Science, pages
1–10. Springer.
Shapiro, M., Preguic¸a, N. M., Baquero, C., and Zawirski,
M. (2011). Conflict-free replicated data types. Lecture
Notes in Computer Science 6976, pages 386–400.
Terry, D. (2013). Replicated data consistency explained
through baseball. Commun. ACM, 56(12):82–89.
Terry, D. B., Prabhakaran, V., Kotla, R., Balakrishnan,
M., and et al. (2013). Consistency-based service
level agreements for cloud storage. In ACM SIGOPS,
SOSP’13, pages 309–324.
Vogels, W. (2009). Eventually consistent. Commun. ACM,
52(1):40–44.
ConsistencyandAvailabilityofDatainReplicatedNoSQLDatabases
109