cache2k vs Memcached
cache2k
cache2k.orgMemcached
memcached.orgSide by side
| Figure | cache2k | Memcached |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | — |
| macOS | — | Yes |
| Linux | Yes | Yes |
| Android | Yes | — |
| API | Yes | Yes |
| Self-hosted | Yes | Yes |
| Plans published | 1 | 1 |
| Spec score · Caching Software | 8.1 (#6) | 7.9 (#10) |
| Purpose | cache2k is an in-memory object caching library for Java applications. | Memcached is a distributed in-memory key-value cache intended to speed up dynamic web applications by reducing database load. |
| Support | The project directs bug reports and feature requests to GitHub issues and general usage questions to the cache2k Stack Overflow tag. | The project directs users to its Discord chat, documentation, and mailing list for questions, and points to Cache Forge for business support. |
Plans
In their own words
cache2k
cache2k is an Apache-licensed, open-source library that keeps Java application objects in memory. Its project describes a JAR smaller than 400 KB with no external dependencies, and the implementation is written in pure Java without sun.misc.Unsafe. Cache behavior includes automatic expiry, refresh, refresh ahead, read-through loading, and event listeners. Cache loaders can suppress exceptions or retry them according to configuration. Integrations listed include Spring Framework, Scala Cache, DataNucleus through JCache, and Hibernate through JCache. cache2k supports JCache / JSR 107, while its guide notes extra overhead for that API compared with the native interface. Monitoring options include low-overhead statistics, JMX, and documented Micrometer metrics. Version 2 requires Java 8 or later and is described as compatible with Android API level 26. The library is free, available from Maven Central, self-hosted, and does not persist data.
Memcached
Memcached is a free, self-hosted in-memory key-value cache for reducing database load in dynamic web applications. It keeps small chunks of arbitrary data, such as strings, objects, and results from database calls, API calls, or page rendering. Clients use key-based hashing to choose a server, while servers operate independently without synchronization or replication. Items can expire after a specified time, and the default eviction policy is least recently used (LRU). The project describes Memcached as a developer tool, not code acceleration software or database middleware. Its API is available for most popular languages, and downloads include a source tarball and installation instructions with package prerequisites for Debian/Ubuntu and Red Hat/CentOS. TLS authentication and encryption are supported in version 1.5.13 and later when built with TLS and used with a TLS-capable client. Optional extstore moves values to external storage while keeping keys and the hash table in memory; it needs version 1.6.0 or newer. The project began in 2003. It is free and self-hosted, with no hosted plan or price listed.