A Little Background
The most commonly used caching software is memcached which is a very lightweight, high-performance, distributed, in-memory caching system. To use memcached, you run memcached daemons on servers that have some extra memory to spare. Then in your application when you want to put some data into the cache, the memcached client that your application is using will hash the key you are using to put your data against the list of servers. After choosing a server, it will send the request to that server to store the data. So the servers don't really need to know anything about the other servers around it, it just stores whatever you give it and it will return whatever you ask for. Very simple, very efficient. There are a few major drawbacks though:
- Each client must know the entire list of memcached servers (if you add/remove a server, you have to update the server list on each client)
- If you change the server list on the clients, you invalidate the entire cache because the key to server hashes will all change.
- Memcached doesn't handle failover. If a server goes down it's just down and any attempt to put to or get from keys that hash to that server will fail.
- You have to run and maintain all these memcached servers!
The last point is the biggest pain point in our eyes. It's the very reason we love using AWS, so we don't have to maintain anything. AWS frees us from requiring storage hardware (S3), queueing servers (SQS), and database servers (SimpleDB), but not caching.
Memcached On Demand
If Amazon were to make a caching service, CloudCache is what it would look like. It gives you everything memcached gives you (and more) and you barely need to lift a finger. Just sign up, get your access key, secret key, and a client library for your language of choice. In a couple of minutes, you have a whole farm of cache servers ready and waiting for you. And did I mention it's cheap? At only $0.05 per MB per month, it's almost the same as running an EC2 instance for a month and better yet, you pay only for what you use.
No comments:
Post a Comment