Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can an app on EC2 autodiscover ElastiCache instances?

Say I have a webapp running on some number of load-balanced EC2 servers, storing and retrieving metadata from SimpleDB with larger chunks of data stored on S3 (due to the whole 1 KB limitation of SimpleDB). Since S3 is pretty high latency and I don't want to be making a ton of requests over there anyway, I'll want a caching layer for the info... enter ElastiCache.

Ok so I provision an ElastiCache server with endpoint X so I hardcode X into my app on EC2 and it's running happily until I get a few hundred thousand new users and all of a sudden my cache server is woefully underpowered for the demand. Fortunately I can just start up a few new larger cache servers... but then I realize I've got endpoints X, Y, and Z and my app only knows to try X, so I still have a problem.

So right now I'm just trying to get my head wrapped around the various pieces to this puzzle, and I haven't gotten to the coding part yet, but won't this be an issue? I've read the documentation for ElastiCache and it mentions that it is a cache cluster, but then each server in the cluster seems to have its own endpoint. Is there a way for an app running on EC2 to know about all the cache servers that are running, and more to the point which one contains the data for a particular key? Is it possible to ask the cluster as a whole to store or retrieve a piece of information?

like image 767
Ty W Avatar asked Sep 16 '11 05:09

Ty W


People also ask

Does ElastiCache run on EC2?

Your Amazon ElastiCache instances are designed to be accessed through an Amazon EC2 instance. If you launched your ElastiCache instance in an Amazon Virtual Private Cloud (Amazon VPC), you can access your ElastiCache instance from an Amazon EC2 instance in the same Amazon VPC.

How can an application use Amazon ElastiCache to improve database read performance?

Amazon ElastiCache improves the performance of web applications by allowing you to retrieve information from a fast, managed, in-memory system, instead of relying entirely on slower disk-based databases.

How many requests can ElastiCache handle?

Individual ElastiCache for Redis nodes support up to 65,000 concurrent client connections.

What are the benefits of using Amazon ElastiCache?

You can use ElastiCache for caching, which accelerates application and database performance, or as a primary data store for use cases that don't require durability like session stores, gaming leaderboards, streaming, and analytics. ElastiCache is compatible with Redis and Memcached.


1 Answers

Today Aws announced cache discovery. Your problem is solved. http://aws.typepad.com/aws/2012/11/amazon-elasticache-now-with-auto-discovery.html .

like image 189
Elroy Flynn Avatar answered Oct 10 '22 03:10

Elroy Flynn