Comparing Ehcache’s coherency and correctness settings with Database isolation levelsLevels

Ehcache has configurable correctness and coherency settings. A good, though not complete analogy is database isolation settings.

So, within an Ehcache cache clustered with Terracotta, you have:

Incoherent – No isolation control. Dirty Reads and Dirty Writes.
Coherent writes and incoherent reads  – Read Uncommitted
Coherent – Read Committed
Coherent with transactional rollback (JTA) – Read Committed with Two Phase Commit.
What about replicated cache clusters using RMI, JGroups or JMS? These have no isolation control. Read and Writes are dirty. Writes to the same key made in different JVMs in the cluster will race each other to propagate across the cluster. Differences between JVMs are highly likely. When using this style of cluster you must program accordingly.

By Greg Luck

As Terracotta’s CTO, Greg (@gregrluck) is entrusted with understanding market and technology forces and the business drivers that impact Terracotta’s product innovation and customer success. He helps shape company and technology strategy and designs many of the features in Terracotta’s products. Greg came to Terracotta on the acquisition of the popular caching project Ehcache which he founded in 2003. Prior to joining Terracotta, Greg served as Chief Architect at Australian online travel giant Wotif.com. He also served as a lead consultant for ThoughtWorks on accounts in the United States and Australia, was CIO at Virgin Blue, Tempo Services, Stamford Hotels and Resorts and Australian Resorts and spent seven years as a Chartered Accountant in KPMG’s small business and insolvency divisions. He is a regular speaker at conferences and contributor of articles to the technical press.

4 comments

  1. Pingback: ANTHONY
  2. Pingback: EDGAR
  3. Pingback: accessories
  4. Pingback: ERNEST

Comments are closed.