Rmarmorstein
Rmarmorstein

Reputation: 72

Lightweight cache system for java?

I've been looking for a lightweight caching system for java, I've been exploring a few different options; I'm wondering what people think would be the easiest one to implement and what would be the most lightweight.

These are what I've been exploring:

  1. Guava cache
  2. EHCache
  3. Using redis and making my own system

I'm also open to other ideas, currently, I'm using a hashmap and just getting the values from there; I'd like something a little bit more feature rich. I don't have any needs per say, but there are certainly some things that would be handy such as a TTL and max sizes, etc. etc.

Any input would be greatly appreciated.

Upvotes: 1

Views: 1897

Answers (2)

cruftex
cruftex

Reputation: 5723

"Lightweight" is a little broad. Within cache2k I try to address it in different ways:

  • Low overhead (See benchmarks)
  • Low memory consumption
  • Basic compatibility with Java 6, to be usable within Android
  • More useful stuff, like JMX support, is optional and in additional jars

Anyway your question(s) should be more specific. It does not comply with the general question guidelines. The question is to broad and you are asking for a product.

Upvotes: 2

Zbyszko Papierski
Zbyszko Papierski

Reputation: 56

Guava cache is great if you're only looking for simple, non-distributed solution. I would also recommend Infinispan - it's extremely easy to setup for single host application and not that hard for distributed one.

Upvotes: 0

Related Questions