📜 ⬆️ ⬇️

Amazon ElastiCache: Implementing Memcached in the AWS Cloud

Amazon ElastiCache , a new web service that facilitates the deployment, management and scaling of caching nodes and clusters in the cloud, has begun public beta-testing. The service improves the performance of web applications by accessing a fast cache in RAM, instead of slow disk DBMS, it is reported on ofsayte .

Amazon ElastiCache is protocol-compatible with Memcached, a widely known system for in-memory data caching. Thus, all your code, applications and tools that are currently working in Memcached environment can migrate to the new service without any serious consequences.

Here is an example of how cache accesses are implemented. Suppose that your application has a Calculate math function with two variables A and B. Without using the Calculate cache, it will look like this:

function Calculate(A, B) { C = [some lengthy calculation dependent on A and B]; return C; } 

If the numerous Calculate function calls slow down the application, then you can simply cache all previous results.
')
 function CachedCalculate(A, B) { C = Cache.Get("Calculate", A, B); if (C == null) { C = Calculate(A, B); Cache.Put("Calculate", A, B, C); } return C; } 

You can also cache the results of database queries. For example, in a social network you can cache the list of friends of each user, if this information is requested with great regularity.

Amazon ElastiCache is ideal for many high-load applications (such as social networks, games, and social media), as well as systems with a large computational load (like recommendation systems).

This is how ElastiCache fits into the AWS architecture.



Amazon ElastiCache cost is based on Cache Nodes and starts at $ 0.095 per hour. At the moment, the service is available only in the US East region (Virginia), and in other regions it will appear in the coming months.

Demo
Step-by-step instructions on starting a caching cluster

Source: https://habr.com/ru/post/126911/


All Articles