Memcached System

Memcached Caching System

Memcached is a free, open-source, high-performance distributed memory caching system. It stores frequently used data in RAM so applications can reduce repeated requests to slower back-end systems such as databases and improve response times.
Distributed Cache Memcached creates a shared logical cache pool that can be used by multiple application nodes.
Database Load Reduction Frequently accessed data can be served from memory instead of being fetched repeatedly from the database.

How Memcached Works

Memcached can be considered short-term memory for an application. Application code stores and retrieves frequently used objects from RAM before falling back to a slower persistent data source when the requested item is not available in cache.

The cache behaves like a large distributed hash table. When the allocated cache becomes full, older items are removed according to a least-recently-used policy so newer data can be stored.

Memcached is designed as a cache, not as a permanent database. Cached data can be evicted and should always be reproducible from the primary data source.

Client-Server Architecture

Memcached uses a client-server model. Memcached servers maintain key-value data in memory, while application clients write values to the cache and request them later using the corresponding keys.

Key Size A key can be up to 250 bytes.
Value Size A cached value can be up to 1 MB.

Why Use Memcached?

Without a distributed caching layer, every web or application node may maintain its own independent cache. This can waste available memory and make cache consistency harder to manage across a scaled application.

Memcached deployment scenario
Independent local caches versus a logically combined distributed cache with Memcached.
Without Memcached Each application node maintains its own independent cache, so available memory is fragmented between servers.
With Memcached Application servers use one logical distributed memory pool, allowing a cached item to be stored and retrieved consistently from the same cache location.

As an application grows and more application servers are added, the amount of frequently accessed data generally grows as well. Memcached allows application capacity and distributed cache capacity to scale together.

Add Memcached to an Environment

1Open the platform dashboard

Sign in to your platform account.

2Create an environment

Click Create Environment to open the Environment Topology dialog.

3Select the application server

Choose the application server required by your workload, such as Tomcat in the source example.

4Enable Memcached

Switch on the Memcached node and configure its vertical scaling limits according to the expected caching requirements.

5Name and create the environment

Enter an environment name and click Create.

Memcached environment topology
Enable Memcached in the topology wizard and configure its vertical scaling limits.

After the environment has been created, the Memcached node appears together with the selected application server and is ready for application-side cache configuration.

Environment with Memcached created
The completed environment includes both the Memcached caching node and application server.
Memcached summary: Use Memcached as a distributed in-memory cache to reduce database requests, improve application response time, combine cache capacity across multiple servers, and scale cache resources together with the application tier.

What’s next?