SDKs

Six official clients, one behavior. Point any of them at a single node or at a discovery server — the SDK detects which from the server's own handshake, so development and production use identical code.

Every SDK ships the full feature set: authentication, TLS, discovery replica lists, replication-aware routing (reads fail over, writes fan out to all R owners), transparent reconnect with a single retry, always-on keep-alive, opt-in transparent value compression, opt-in fire-and-forget replica writes, opt-in read repair, and the same rendezvous-hashing pipeline verified against shared cross-language test vectors. Values are strings first: every get returns a string (strict UTF-8), with a get_bytes-style companion for raw byte values.

LanguageRequiresPackageDocs
TypeScript / Node.jsNode 20+nanocached (npm)README
Python3.11+, asyncionanocached (PyPI)README
Java17+org.nanocached:nanocached (Maven Central)README
Rusttokionanocached (crates.io)README
.NET.NET 8+Nanocached (NuGet)README
Go1.22+github.com/nanocached/nanocached/sdk/goREADME

None of the SDKs has runtime dependencies outside its language's standard library (Rust's client uses tokio; its TLS support is a default cargo feature that can be compiled out).

The SDKs are pre-1.0 (currently 0.4.x), and all of them ship at one version together with the server; what 1.0.0 will promise is on the compatibility page. Every SDK also builds directly from the repository.

TypeScript

npm install nanocached
import { NanocachedClient } from "nanocached";

const client = await NanocachedClient.connect({
  addresses: [{ host: "127.0.0.1", port: 8357 }],
});

await client.set("greeting", "hello", 60);       // TTL seconds; omit = no expiry
const value = await client.get("greeting");      // string | null
const existed = await client.delete("greeting"); // boolean

await client.close();

Python

pip install nanocached
import asyncio
from nanocached import NanocachedClient

async def main():
    async with await NanocachedClient.connect([("127.0.0.1", 8357)]) as client:
        await client.set("greeting", "hello", ttl_seconds=60)
        value = await client.get("greeting")        # str | None
        existed = await client.delete("greeting")   # bool

asyncio.run(main())

Java

Group/artifact: org.nanocached:nanocached.

import org.nanocached.NanocachedClient;
import org.nanocached.NanocachedClient.Address;
import org.nanocached.NanocachedClient.Options;

try (NanocachedClient client = NanocachedClient.connect(
        new Options().addresses(List.of(new Address("127.0.0.1", 8357))))) {
    client.set("greeting", "hello", 60);                 // TTL seconds; omit = no expiry
    Optional<String> value = client.get("greeting");     // empty when missing
    boolean existed = client.delete("greeting");
}

Spring users: the separate org.nanocached:nanocached-spring module implements Spring's CacheManager/Cache on this SDK — named caches as namespaces, per-cache TTL, clear() as the namespace's CLEAR. See adapters/spring. Spring Boot users can instead add org.nanocached:nanocached-spring-boot-starter, which autoconfigures both beans from nanocached.* properties — no Java config. See adapters/spring-boot-starter. JSR-107 (javax.cache) users can instead add org.nanocached:nanocached-jcache, an honest-subset CachingProvider/CacheManager/Cache implementation discoverable via Caching.getCachingProvider(). See adapters/jcache.

Rust

cargo add nanocached
use nanocached::{NanocachedClient, Options};

let client = NanocachedClient::connect(
    Options::new().addresses([("127.0.0.1", 8357)]),
).await?;

client.set("greeting", "hello", 60).await?;            // TTL seconds; 0 = no expiry
let value: Option<String> = client.get("greeting").await?;
let existed: bool = client.delete("greeting").await?;

client.close().await;

.NET

dotnet add package Nanocached
using Nanocached;

using NanocachedClient client = await NanocachedClient.ConnectAsync(new Options {
    Addresses = { ("127.0.0.1", 8357) },
});

await client.SetAsync("greeting", "hello", ttlSeconds: 60);  // omit = no expiry
string? value = await client.GetAsync("greeting");   // null when missing
bool existed = await client.DeleteAsync("greeting");

Go

go get github.com/nanocached/nanocached/sdk/go
import nanocached "github.com/nanocached/nanocached/sdk/go"

client, err := nanocached.Connect(nanocached.Config{
    Addresses: []nanocached.Address{{Host: "127.0.0.1", Port: 8357}},
})
if err != nil { /* ... */ }
defer client.Close()

err = client.Set("greeting", "hello", 60) // TTL seconds; 0 = no expiry
value, ok, err := client.Get("greeting")  // ok=false when missing
existed, err := client.Delete("greeting")

Shared behavior, briefly