0

I am using memcache as my caching framework and it works fine when I have a key value pair in cache server.

My requirement is to store a range of keys with one value. Example: Discount is 10% between Jan 01 1999 to Dec 31 2001. Discount is 15% between Jan 01 2002 to Dec 31 2002. User wants to get the value for a specific date like June 10 2000.

How can I store this range of keys in cache?

Thanks

Mahi G
  • 391
  • 1
  • 7
  • 16

1 Answers1

1

Instead of storing many keys store only one value (under one key) that contains object with information about all ranges. You can use NavigableMap

ragnor
  • 2,498
  • 1
  • 22
  • 25