EVCache is a distributed in-memory caching solution based on memcached & spymemcached that is well integrated with Netflix OSS and AWS EC2 infrastructure. Today we are announcing the open sourcing of EVCache client library on Github.
EVCache is an abbreviation for:
Ephemeral - The data stored is for a short duration as specified by its TTL(Time To Live).
Volatile - The data can disappear any time (Evicted).
Cache – An in-memory key-value store.
The advantages of distributed caching are:
- Faster response time compared to data being fetched from source/database
- Reduces the load and number of servers needed to handle the requests as most of the requests are served by the cache
- Increases the throughput of the services fronted by the cache
Please read more about EVCache from our earlier blog post for more details.
What is an EVCache App?
EVCache App is a logical grouping of one or more memcached instances (servers). Each instance can be a
- EVCache Server (to be open sourced soon) running memcached and a Java sidecar app
- EC2 instance running memcached
- ElastiCache instance
- instance that can talk memcahced protocol (eg. Couchbase, MemcacheDB)
Each app is associated with a name. Though it is not recommended, a memcached instance can be shared across multiple EVCache Apps.
What is an EVCache Client?
EVCache client manages all the operations between an Java application and EVCache App.
What is an EVCache Server?
EVCache Server is an EC2 instance running an instances of memcached and a Java Sidecar application. The sidecar is responsible for interacting with Eureka, monitoring the memcached process and collecting and reporting performance data to the Servo. This will be Open Sourced soon.
Generic EVCache DeploymentThe Figure 1 shows an EVCache App consisting of 3 memcached nodes with an EVCache client connecting to it.
Multi-Cluster EVCache Deployment
The Figure 2 shows an EVCache App in 2 Clusters (A & B) with 3 memcached nodes in each Cluster. Data is replicated between the two clusters. To achieve low latency, reliability and isolation all the EC2 instances for a cluster should be in the same availability zone. This way if an availability zone is having any issues the performance of the other zone is not impacted. In a scenario where we lose instances in one cluster, we can dynamically set that cluster to “write only” and direct all the read traffic to other zone. This ensures that latency and cache hit rate is not impacted.
EVCache Deployment using EurekaThe Figure 3 shows an EVCache App in 3 Clusters (A, B & C) with 3 EVCache servers in each Cluster. Each cluster is in an availability zones. An EVCache server (to be open sourced soon) consists of a memcached instance and sidecar app. The sidecar app interacts with Eureka Server and monitor the memcached process.
Netflix OSS - All Netflix Open Source Software
EVCache - Sources & EVCache Wiki - Documentation & Configuration
memcached - A high-performance in-memory data store
spymemcached - Java Client to memcached
Archaius - Library for configuration management API
Eureka - Discovery and Managing EVCache servers
Servo - Application Monitoring Library
If you like building infrastructure components like this, for a service that millions of people use world wide, take a look at http://jobs.netflix.com.