A minimal, high-performance memcached client for Node.js, built on the meta text protocol.
This repository is a pnpm workspace.
| Package | Documentation | Description |
|---|---|---|
@platformatic/memcached |
Client README | The memcached client: meta protocol, full request pipelining, zero runtime dependencies. |
@platformatic/memcached-otel |
OpenTelemetry README | OpenTelemetry tracing instrumentation for the client, built on its diagnostics channels. |
npm install @platformatic/memcachedimport { Client } from '@platformatic/memcached'
const client = new Client('localhost:11211')
await client.set('greeting', 'hello', { ttl: 60 })
const value = await client.get('greeting')
console.log(value?.toString()) // 'hello'
await client.close()For complete usage and API details, see the client documentation:
- Installation and quick start
- Client API
- Authentication, sharding, and ElastiCache Auto Discovery
- Metrics and diagnostics
- OpenTelemetry instrumentation
SET/GET throughput against the notable Node.js memcached clients, each running with its
best-known configuration — this client and memjs
pipeline on a single connection, while
memcache-client and
memcached (3rd-Eden) get a 10-connection pool.
Median of 3 runs, 50,000 operations at concurrency 500, memcached:alpine on loopback,
Node.js 24, Linux:
| ops/s | @platformatic/memcached | memjs | memcache-client (pool 10) | memcached (pool 10) |
|---|---|---|---|---|
| SET 64 B | 352,000 | 111,000 | 138,000 | 43,000 |
| GET 64 B | 369,000 | 137,000 | 113,000 | 59,000 |
| SET 4 KiB | 168,000 | 80,000 | 92,000 | 31,000 |
| GET 4 KiB | 135,000 | 92,000 | 87,000 | 10,000 |
Absolute numbers vary by machine: reproduce with
node packages/memcached/benchmarks/compare-all.js (details in the
client's performance notes).
pnpm install
pnpm build # build every package
pnpm lint # lint the whole workspace
pnpm typecheck # typecheck every package
pnpm test # run every package's testsTests run against a real memcached; pnpm test starts a memcached:alpine Docker
container automatically (and stops it afterwards). Source is TypeScript in the erasable
subset, executed directly by Node.js >= 22.18.0 via type stripping; published packages
ship compiled JavaScript and declaration files.
Apache-2.0 — see LICENSE.