Logical Physical Clocks

  • Sandeep S. Kulkarni
  • Murat Demirbas
  • Deepak Madappa
  • Bharadwaj Avva
  • Marcelo Leone
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8878)


There is a gap between the theory and practice of distributed systems in terms of the use of time. The theory of distributed systems shunned the notion of time, and introduced “causality tracking” as a clean abstraction to reason about concurrency. The practical systems employed physical time (NTP) information but in a best effort manner due to the difficulty of achieving tight clock synchronization. In an effort to bridge this gap and reconcile the theory and practice of distributed systems on the topic of time, we propose a hybrid logical clock, HLC, that combines the best of logical clocks and physical clocks. HLC captures the causality relationship like logical clocks, and enables easy identification of consistent snapshots in distributed systems. Dually, HLC can be used in lieu of physical/NTP clocks since it maintains its logical clock to be always close to the NTP clock. Moreover HLC fits in to 64 bits NTP timestamp format, and is masking tolerant to NTP kinks and uncertainties.We show that HLC has many benefits for wait-free transaction ordering and performing snapshot reads in multiversion globally distributed databases.


Physical Time Clock Synchronization Naive Algorithm Clock Drift Snapshot Isolation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Bhatia, K., Marzullo, K., Alvisi, L.: Scalable causal message logging for wide-area environments. Concurrency and Computation: Practice and Experience 15(10), 873–889 (2003)CrossRefGoogle Scholar
  2. 2.
    Corbett, J., Dean, J., et al.: Spanner: Google’s globally-distributed database. In: Proceedings of OSDI (2012)Google Scholar
  3. 3.
    Demirbas, M., Kulkarni, S.: Beyond truetime: Using augmentedtime for improving google spanner. In: Workshop on Large-Scale Distributed Systems and Middleware (LADIS) (2013)Google Scholar
  4. 4.
    Dijkstra, E.W.: Self-stabilizing systems in spite of distributed control. Communications of the ACM 17(11) (1974)Google Scholar
  5. 5.
    Du, J., Elnikety, S., Roy, A., Zwaenepoel, W.: Orbe: Scalable causal consistency using dependency matrices and physical clocks. In: Proceedings of the 4th Annual Symposium on Cloud Computing, SOCC 2013, pp. 11:1–11:14. ACM, New York (2013),
  6. 6.
    Du, J., Elnikety, S., Zwaenepoel, W.: Clock-SI: Snapshot isolation for partitioned data stores using loosely synchronized clocks. In: IEEE Symposium on Reliable Distributed Systems (SRDS), pp. 173–184 (2013)Google Scholar
  7. 7.
    Escriva, R., Dubey, A., Wong, B., Sirer, E.: Kronos: The design and implementation of an event ordering service. In: EuroSys (2014)Google Scholar
  8. 8.
    Fan, R., Lynch, N.: Gradient clock synchronization. In: PODC, pp. 320–327 (2004)Google Scholar
  9. 9.
    Fidge, J.: Timestamps in message-passing systems that preserve the partial ordering. In: Proceedings of the 11th Australian Computer Science Conference, vol. 10(1), pp. 56–66 (1988)Google Scholar
  10. 10.
    Kingsbury, K.: The trouble with timestamps,
  11. 11.
    Kotla, R., Alvisi, L., Dahlin, M., Clement, A., Wong, E.: Zyzzyva: Speculative byzantine fault tolerance. SIGOPS Oper. Syst. Rev. 41(6), 45–58 (2007)CrossRefGoogle Scholar
  12. 12.
    Kulkarni, S., Demirbas, M., Madeppa, D., Avva, B., Leone, M.: Logical physical clocks and consistent snapshots in globally distributed databases. Tech. Rep. 2014-04, SUNY Buffalo (May 2014)Google Scholar
  13. 13.
    Kulkarni, S., Ravikant: Stabilizing causal deterministic merge. J. High Speed Networks 14(2), 155–183 (2005)Google Scholar
  14. 14.
    Lakshman, A., Malik, P.: Cassandra: Structured storage system on a p2p network. In: Proceedings of the 28th ACM Symposium on Principles of Distributed Computing, PODC 2009, p. 5 (2009)Google Scholar
  15. 15.
    Lamport, L.: Time, clocks, and the ordering of events in a distributed system. Communications of the ACM 21(7), 558–565 (1978)CrossRefzbMATHGoogle Scholar
  16. 16.
  17. 17.
  18. 18.
    Li, C., Porto, D., Clement, A., Gehrke, J., Preguiça, N., Rodrigues, R.: Making geo-replicated systems fast as possible, consistent when necessary. In: Symposium on Operating Systems Design and Implementation (OSDI 2012), pp. 265–278 (2012)Google Scholar
  19. 19.
    Lloyd, W., Freedman, M., Kaminsky, M., Andersen, D.: Don’t settle for eventual: Scalable causal consistency for wide-area storage with cops. In: SOSP, pp. 401–416 (2011)Google Scholar
  20. 20.
    Maroti, M., Kusy, B., Simon, G., Ledeczi, A.: The flooding time synchronization protocol. In: SenSys (2004)Google Scholar
  21. 21.
    Mashtizadeh, A., Bittau, A., Huang, Y., Mazières, D.: Replication, history, and grafting in the ori file system. In: SOSP, pp. 151–166 (2013)Google Scholar
  22. 22.
    Mattern, F.: Virtual time and global states of distributed systems. In: Parallel and Distributed Algorithms, pp. 215–226 (1989)Google Scholar
  23. 23.
    Mills, D.: A brief history of ntp time: Memoirs of an internet timekeeper. ACM SIGCOMM Computer Communication Review 33(2), 9–21 (2003)CrossRefGoogle Scholar
  24. 24.
    Patt-Shamir, B., Rajsbaum, S.: A theory of clock synchronization (extended abstract). In: ACM Symposium on Theory of Computing (STOC), pp. 810–819 (1994)Google Scholar
  25. 25.
    Saito, Y.: Unilateral version vector pruning using loosely synchronized clocks. Tech. rep., HP Labs (2002)Google Scholar
  26. 26.
    Sigelman, B., Barroso, L., Burrows, M., Stephenson, P., Plakal, M., Beaver, D., Jaspan, S., Shanbhag, C.: Dapper, a large-scale distributed systems tracing infrastructure. Tech. rep., Google, Inc. (2010),
  27. 27.
    Sovran, Y., Power, R., Aguilera, M., Li, J.: Transactional storage for geo-replicated systems. In: SOSP, pp. 385–400 (2011)Google Scholar
  28. 28.
    Vogels, W.: Eventually consistent. Communications of the ACM 52(1), 40–44 (2009)CrossRefGoogle Scholar
  29. 29.
    Wu, Z., Butkiewicz, M., Perkins, D., Katz-Bassett, E., Madhyastha, H.: Spanstore: Cost-effective geo-replicated storage spanning multiple cloud services. In: SOSP, pp. 292–308 (2013)Google Scholar
  30. 30.
    Zhang, Y., Power, R., Zhou, S., Sovran, Y., Aguilera, M., Li, J.: Transaction chains: Achieving serializability with low latency in geo-distributed storage systems. In: SOSP, pp. 276–291 (2013)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Sandeep S. Kulkarni
    • 1
  • Murat Demirbas
    • 2
  • Deepak Madappa
    • 2
  • Bharadwaj Avva
    • 2
  • Marcelo Leone
    • 1
  1. 1.Computer Science & EngineeringMichigan State UniversityUSA
  2. 2.Computer Science & EngineeringUniversity at Buffalo, SUNYUSA

Personalised recommendations