4

I have multiple instances of a service running on multiple EC2 instances and I need a global counter which all instances of the service can access. The counter needs to support set/reset and increment operations. My first attempt to build this was using SimpleDB where an attribute in SimpleDB stores the counter value. But SimpleDB is proving to be too expensive for this since I expect a very high number of requests accessing the counter. Most of the requests to the counter are get requests with very few requests actually modifying the counter value.

Another option that I am thinking of is to use memcache to cache the counter value and use SimpleDB as the persistent store for the counter. This should significantly reduce the number of calls to SimpleDB. But since I really do not have any other use of memcache or SimpleDB in my service it seems like I need to unnecessarily manage two extra components for a small functionality.

Is there any standard solution to this problem?

randomuser
  • 1,858
  • 2
  • 17
  • 21

2 Answers2

1

We finally decided to use SimpleDB. It was pretty simple and served our needs well.

randomuser
  • 1,858
  • 2
  • 17
  • 21
0

Redis has a persistent store, unless you get to 100% of the memory usage you won't run into a problem. You can also backup, master/slave, and dump the database in Redis.

Daniel
  • 7,006
  • 7
  • 43
  • 49