The VLDB Journal

, Volume 23, Issue 1, pp 147–172 | Cite as

Consistency anomalies in multi-tier architectures: automatic detection and prevention

Regular Paper


Modern transaction systems, consisting of an application server tier and a database tier, offer several levels of isolation providing a trade-off between performance and consistency. While it is fairly well known how to identify qualitatively the anomalies that are possible under a certain isolation level, it is much more difficult to detect and quantify such anomalies during run-time of a given application. In this paper, we present a new approach to detect and quantify consistency anomalies for arbitrary multi-tier application running under any isolation levels ensuring at least read committed. In fact, the application can run even under a mixture of isolation levels. Our detection approach can be online or off-line and for each detected anomaly, we identify exactly the transactions and data items involved. Furthermore, we classify the detected anomalies into patterns showing the business methods involved as well as analyzing the types of cycles that occur. Our approach can help designers to either choose an isolation level where the anomalies do not occur or to change the transaction design to avoid the anomalies. Furthermore, we provide an option in which the occurrence of anomalies can be automatically reduced during run-time. To test the effectiveness and efficiency of our approach, we have conducted a set of experiments using a wide range of benchmarks.


Consistency Serializability Transactions 


  1. 1.
    Adya, A.: Weak Consistency: A Generalized Theory and Optimistic Implementations for Distributed Transactions. PhD thesis, MIT (1999)Google Scholar
  2. 2.
    Adya, A., Liskov, B., O’Neil, P.E.: Generalized isolation level definitions. In IEEE International Conference on Data Engineering (ICDE), pp. 67–78 (2000)Google Scholar
  3. 3.
    Amza, C., Chanda, A., Cox, A.L., Elnikety, S., Gil, R., Rajamani, K., Zwaenepoel, W.: Specification and implementation of dynamic web site benchmarks. In Workshop on Workload Characterization (WWC), pp. 3–13 (2002)Google Scholar
  4. 4.
    Berenson, H., Bernstein, P.A., Gray, J., Melton, J., O’Neil E.J., O’Neil, P.E.: A critique of ANSI SQL isolation levels. In ACM SIGMOD International Conference on Management of Data, pp. 1–10 (1995)Google Scholar
  5. 5.
    Bernstein, A., Lewis, P., Lu, S.: Semantic conditions for correctness at different isolation levels. In IEEE International Conference on Data Engineering (ICDE), pp. 57–66. IEEE (2000)Google Scholar
  6. 6.
    Bernstein, P.A., Fekete, A., Guo, H., Ramakrishnan, R., Tamma, P.: Relaxed-currency serializability for middle-tier caching and replication. In ACM SIGMOD International Conference on Management of Data, pp. 599–610 (2006)Google Scholar
  7. 7.
    Bernstein, P.A., Hadzilacos, V., Goodman, N.: Concurrency Control and Recovery in Database Systems. Addison Wesley, Reading (1987)Google Scholar
  8. 8.
    Cahill, M.J., Röhm, U., Fekete, A.D.: Serializable isolation for snapshot databases. ACM Trans. Database Syst. (TODS), 34(4), 20:1–20:42 (2009)Google Scholar
  9. 9.
    Casanova, M.A.: The Concurrency Control Problem for Database Systems, Lecture Notes in Computer Science, vol. 116. Springer, Berlin (1981)CrossRefGoogle Scholar
  10. 10.
    Daudjee, K., Salem K.: Inferring a serialization order for distributed transactions. In IEEE International Conference on Data Engineering (ICDE), p. 154 (2006)Google Scholar
  11. 11.
    Elnikety, S., Dropsho, S.G., Pedone, F. (2006) Tashkent: uniting durability with transaction ordering for high-performance scalable database replication. In EuroSys Conference, pp. 117–130Google Scholar
  12. 12.
    Eswaran, K.P., Gray, J.N., Lorie, R.A., Traiger, I.L.: The notions of consistency and predicate locks in a database system. Communications of the ACM 19(11), 624–633 (1976) Google Scholar
  13. 13.
    Fekete, A.: Serialisability and snapshot isolation. In The Australian Database Conference (ADC), pp. 201–210 (1999)Google Scholar
  14. 14.
    Fekete, A., Goldrei, S., Asenjo, J.P.: Quantifying isolation anomalies. Int. Conf. Very Large Data Bases (VLDB) 2(1), 467–478 (2009)Google Scholar
  15. 15.
    Fekete, A., Liarokapis, D., O’Neil, E.J., O’Neil, P.E., Shasha, D.: Making snapshot isolation serializable. ACM Trans. Database Syst. (TODS) 30(2), 492–528 (2005)CrossRefGoogle Scholar
  16. 16.
    Georgakopoulos, D., Rusinkiewicz, M., Sheth, A.P.: On serializability of multidatabase transactions through forced local conflicts. In IEEE International Conference on Data Engineering (ICDE), pp. 314–323 (1991)Google Scholar
  17. 17.
    Jorwekar, S., Fekete, A., Ramamritham, K., Sudarshan, S.: Automating the detection of snapshot isolation anomalies. In International Conference on Very Large Data Bases (VLDB), pp. 1263–1274 (2007)Google Scholar
  18. 18.
    JPA. The Java Persistence API, Sun Microsystems, JSR 220.
  19. 19.
    Kraska, T., Hentschel, M., Alonso, G., Kossmann, D.: Consistency rationing in the cloud: Pay only when it matters. Int. Conf. Very Large Data Bases (VLDB) 2(1), 253–264 (2009)Google Scholar
  20. 20.
    Kung, H.T., Robinson, J.T.: On optimistic methods for concurrency control. ACM Trans. Database Syst. (TODS) 6(2), 213–226 (1981)CrossRefGoogle Scholar
  21. 21.
    Paulley, G.: The second deadly sin part un. PowerBuilder Developer’s Journal, July 2012, 19(7), pp. 6–9, A similar version appeared as blog at
  22. 22.
    Ports, D.R.K., Grittner, K.: Serializable snapshot isolation in postgresql. In International Conference on Very Large Data Bases (VLDB) (2012)Google Scholar
  23. 23.
    Revilak, S., O’Neil, P.E., O’Neil, E.J.: Precisely serializable snapshot isolation (pssi). In IEEE International Conference on Data Engineering (ICDE), pp. 482–493 (2011)Google Scholar
  24. 24.
    Röhm, U., Böhm, K., Schek, H.-J., Schuldt, H.: Fas - a freshness-sensitive coordination middleware for a cluster of olap components. In International Conference on Very Large Data Bases (VLDB), pp. 754–765 (2002)Google Scholar
  25. 25.
    Röhm, U., Schmidt, S.: Freshness-aware caching in a cluster of J2EE application servers. In International Conference on Web Information Systems Engineering (WISE), pp. 74–86 (2007)Google Scholar
  26. 26.
    SPECjEnterprise2010. A performance benchmark for Java Enterprise Edition (JavaEE) 5 or later application servers.
  27. 27.
    Tarjan, R.E.: Depth-first search and linear graph algorithms. SIAM J. Comput. (SICOMP) 1(2), 146–160 (1972)CrossRefMATHMathSciNetGoogle Scholar
  28. 28.
    TPC-C.: An on-line transaction processing benchmark.
  29. 29.
    Yabandeh, M., Ferro, D.G.: A critique of snapshot isolation. In EuroSys Conference, pp. 155–168 (2012)Google Scholar
  30. 30.
    Zellag, K.: On the Detection and Prevention of Consistency Anomalies in Multi-tier and Cloud Applications. PhD thesis, McGill University (2012)Google Scholar
  31. 31.
    Zellag, K., Kemme, B.: Real-time quantification and classification of consistency anomalies in multi-tier architectures. In IEEE International Conference on Data Engineering (ICDE), pp. 613–624 (2011)Google Scholar
  32. 32.
    Zellag, K., Kemme, B.: Consad: a real-time consistency anomalies detector. In ACM SIGMOD International Conference on Management of Data, pp. 641–644 (2012)Google Scholar
  33. 33.
    Zellag, K., Kemme, B.: How consistent is your cloud application? In ACM Symposium on Cloud Computing (SoCC), pp. 6:1–6:14 (2012)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  1. 1.School of Computer ScienceMcGill UniversityMontrealCanada

Personalised recommendations