6

I'm currently architecting a system that must be capable of dealing with tens of thousands of writes per second. I am more-or-less settled on using Apache Cassandra for the persistence layer, and will be using Java for the application layer, but there are situations where I need to quickly access data in a way that picks up any changes within seconds.

Hitting Cassandra every single time I need to check this data for changes will be too slow, which means I need to use some kind of application layer caching.

To ensure that the cached data remains current, ideally it would support some kind of multicast-based cache invalidation.

What are my options?

sanity
  • 35,347
  • 40
  • 135
  • 226
  • 1
    I don't think you should presume that hitting Cassandra for this data will be too slow. If the data you're accessing is either fresh or hot, it'll always be in memory anyhow and all you'll do is waste more memory by caching it again. You should experiment and test rather than presume. – Nick Bastin Jun 20 '10 at 18:21

2 Answers2

1

I would start by investigating if the cassandra key (avoid index scan) and/or row cache (avoid sstable lookup) is sufficient enough.

detailed information: http://wiki.apache.org/cassandra/API

Schildmeijer
  • 20,702
  • 12
  • 62
  • 79
0

I have used ehcache and it worked really nice. Nicely configurable outside the app and it supports multicast invalidation (and disk based persistence which I needed more than the invalidation).

Peter Tillemans
  • 34,983
  • 11
  • 83
  • 114