{
  "schema": 1,
  "title": "Thunder documentation bundle",
  "sample_note": "Snapshot of the public website documentation for this storage example. Read the current documentation before deploying.",
  "documents": [
    {
      "source": "get-started.html",
      "title": "Your first durable write.",
      "sections": [
        {
          "id": "requirements",
          "title": "Check your machine.",
          "content": "Check your machine. Docker with Compose v2. Linux kernel 6.8 or newer on the Docker host or VM. A new container image does not update the host kernel. A supported CPU. x86-64 with AVX2, or ARM64 v8.2 with Crypto Extensions. The default x86 image does not require AVX-512. Memory. At least 4 GiB for the default arena allocation, plus overhead. Larger core budgets increase total memory requirements. Storage. ext4 or XFS under Docker’s data directory. Keep Docker Desktop data in a named volume. OpenSSL in your shell to generate the keystore passphrase in the steps below."
        },
        {
          "id": "quickstart",
          "title": "Run your first instance.",
          "content": "Run your first instance. 01 Get the image and release kit. The published 0.1.6 image includes a release kit. Run these commands in a new working directory. The kit contains the Compose configuration, settings, seccomp profile, product guide, and license. SHELL · RELEASE IMAGECopymkdir thunderstrike-run cd thunderstrike-run docker run --rm -v \"$PWD:/out\" docker.io/sbansal793/thunderstrike:0.1.6 kit /out Building from source instead?Run this from the repository root. The build pins the image reference inside the release kit so Compose uses the same local image. SHELL · FROM REPOSITORY ROOTCopydocker build --build-arg IMAGE_REF=thunderstrike:local -t thunderstrike:local . mkdir thunderstrike-run cd thunderstrike-run docker run --rm -v \"$PWD:/out\" thunderstrike:local kit /out 02 Choose cores and memory. Copy the example settings, then edit .env. Keep the image reference written by the kit. Start with the kit’s defaults: a physical-core budget of 2 and automatic arena sizing. Leave THUNDERSTRIKE_ARENA_BYTES empty for the sample workload. SHELLCopycp .env.example .env .ENV · EDIT THESE EXISTING LINESCopyTHUNDERSTRIKE_CORES=2 THUNDERSTRIKE_TLS_PORT=7380 THUNDERSTRIKE_ARENA_BYTES= These defaults allocate 4 GiB of arena memory in total: two 2 GiB reactors with SMT, or one 4 GiB reactor without it. Add process overhead. For 512 MiB values, explicitly set THUNDERSTRIKE_ARENA_BYTES=4294967296; see large-value sizing. Generate the exact port mapping from the CPU topology. Run this again whenever the core budget, starting port, or available topology changes. SHELLCopydocker compose -f compose.yaml run --rm configure 03 Create the keystore passphrase. The passphrase unlocks the encryption keys. Keep it backed up with the data volume: losing either loses access to your values. Run these commands once in a fresh kit directory. SHELLCopymkdir -p docker/secrets docker/tls openssl rand -base64 32 > docker/secrets/passphrase chmod 600 docker/secrets/passphrase 04 Create a TLS identity. Set THUNDERSTRIKE_TLS_NAMES in .env to the hostnames clients use. The default is localhost; retain it when running the included sample. The initialization job creates an Ed25519 CA and a server certificate. SHELLCopydocker compose run --rm tls-init Clients trust docker/tls/ca.crt. Keep ca.key private; only the server certificate and key are mounted into the database. 05 Start the database. SHELLCopydocker compose up -d docker compose ps Wait for healthy. The health check becomes ready after every reactor has recovered its stores and opened its port."
        },
        {
          "id": "verify",
          "title": "Write. Read. Verify.",
          "content": "THE FIRST MILESTONEA healthy server and a sample that exits with code 0: every written value was read back without errors or mismatches. Write. Read. Verify. The included sample client writes values of 256 B, 4 KiB, 64 KiB, 2 MiB, and 16 MiB over 8 connections for 30 seconds. It reads each value back and compares the bytes. Exit code 0 means no mismatches and no errors. SHELLCopydocker compose run --rm sample This is an end-to-end correctness check, not a universal throughput guarantee. Benchmark your actual payload mix, read/write ratio, concurrency, CPU allocation, and storage. The default sample does not exercise 512 MiB values."
        },
        {
          "id": "architecture",
          "title": "Fixed shards. Local ownership.",
          "content": "Fixed shards. Local ownership. Thunder always uses 1,024 logical shards. Each reactor owns a contiguous shard range, one arena, and one port. A reactor group uses two hardware threads: one for the foreground reactor, the other shared by background workers. Uniform CPU topology, with client ports starting at 7380PHYSICAL CORES THREADS / CORE REACTORS SHARDS / REACTOR PORTS 2 1 1 1,024 7380 2 2 2 512 7380–7381 8 1 4 256 7380–7383 8 2 8 128 7380–7387 The client starts with one address and asks for DISCOVER. It computes CRC32C(key) % 1024, finds the owning range in the returned layout, and connects to the corresponding reactor. All generated ports must be reachable on the same host with the same port numbers. CPU affinity, quotas, and actual sibling relationships affect the allocation. CORES is a physical-core budget, not a reactor count. The public budget is even, from 2 through 1,024. Try the interactive topology explorer ↗"
        },
        {
          "id": "large-values",
          "title": "Give large values enough room.",
          "content": "Give large values enough room. Values of 512 MiB and more are first-class. Capacity depends on the arena, in-flight work, and available disk. Memory: one SET needs two copies of its value in the arena. Configure THUNDERSTRIKE_ARENA_BYTES=4294967296 for 512 MiB values. Defaults: 4 GiB with one reactor, or 2 GiB per reactor when there are two or more. Arena memory is resident from boot; the container limit must exceed total arena bytes plus process overhead. Disk: plan for peak live bytes divided by 0.75, plus one 4 GiB chunk for workloads storing values of 512 MiB or more. Full disk: writes return StorageExhausted; the server continues serving reads. A practical example: 8 physical cores with SMT ×2 derive 8 reactors. At 4 GiB per reactor, budget 32 GiB of arena RAM, plus overhead. For 300 GiB of live values including 512 MiB objects, the documented disk-sizing rule gives 404 GiB."
        },
        {
          "id": "operations",
          "title": "Durability is part of the path.",
          "content": "Durability is part of the path. Each write’s journal record reaches disk before acknowledgement. The product guide states that acknowledged writes survive a crash or power cut. TLS 1.3 is mandatory, and all values are encrypted at rest. Stop cleanly. SHELLCopydocker compose stop thunderstrike The server stops accepting work, drains in-flight requests, checkpoints the index, and exits. Compose allows two minutes. A forced kill is a crash. Back up the store and passphrase together. Stop the server or take a filesystem snapshot, then copy the whole data volume and preserve the passphrase securely. Copying files while the database writes is not a consistent backup. Follow the complete procedure in the product guide. Change topology after a clean stop. Run configure again after changing the core budget, starting port, or available topology, then restart. After a crash, recover with an allocation producing the previous reactor count and stop cleanly before changing it; journals belong to reactors."
        },
        {
          "id": "ai-integration",
          "title": "Connect your application.",
          "content": "Connect your application. The official Python client handles discovery and routing. After the server is healthy, install the client and run this example from the release-kit directory. SHELL · INSTALL CLIENTCopypip install thunderstrike PYTHON · WRITE AND READCopyfrom thunderstrike import Thunderstrike with open(\"docker/tls/ca.crt\") as ca: ca_pem = ca.read() db = Thunderstrike( \"127.0.0.1:7380\", tls_server_name=\"localhost\", tls_ca_pem=ca_pem, ) db.set(b\"agent:42:state\", b'{\"step\": 4}') print(db.get(b\"agent:42:state\")) Clients support Linux x86-64 / ARM64, Windows x86-64, and macOS on Intel and Apple silicon. See the official client documentation for Node.js, Go, Rust, .NET, Java, PHP, and C / C++ examples. Thunder stores opaque bytes by key using its own binary protocol over TLS 1.3. It is not a Redis protocol endpoint and does not provide vector similarity search, model execution, automatic GPU integration, or automatic TTL expiry. Choose stable keys for inference artifacts, agent sessions, or media segments. Version them when your serialization or model changes. Serialize your payload in the application. Store the bytes as a value and deserialize after retrieval. Use an official client. Supply one bootstrap address. The client discovers the shard layout and manages connections to the owning reactor ports. Own the lifecycle. Your application decides which artifacts to reuse, invalidate, or delete. Evaluate your workload’s largest objects and concurrent writes. For detailed configuration and operations, download the full product guide. Explore the use cases ↗"
        }
      ]
    },
    {
      "source": "docs.html",
      "title": "Documentation.",
      "sections": [
        {
          "id": "requirements",
          "title": "Prepare the host.",
          "content": "01 / HOST REQUIREMENTS Prepare the host. Docker with Compose v2. The host or Docker Desktop Linux VM must run Linux kernel 6.8 or newer. The server checks this at startup. x86-64: AVX2-capable CPUs, such as Intel Haswell or AMD Zen 1 and newer. The standard image targets x86-64-v3. The separate -v4 tag requires AVX-512. ARM64: ARMv8.2 with Crypto Extensions. The standard ARM image targets hardware such as Graviton2 or newer and Ampere Altra. Memory: resident arena memory plus process overhead. For the default two-core budget, plan at least 4 GiB of arena RAM plus overhead. Filesystem: ext4 or XFS under Docker’s data directory. Use a named volume on Docker Desktop to avoid its host-file-sharing path. The release kit configures the io_uring seccomp allowance and memory-lock limit. When running outside Compose, supply the documented security profile, memlock allowance, and persistent data volume yourself."
        },
        {
          "id": "configuration",
          "title": "Start with .env.",
          "content": "02 / CONFIGURATION REFERENCE Start with .env. Compose reads .env beside compose.yaml; shell environment variables take precedence. Sizes are plain byte counts, without suffixes: use 4294967296 for 4 GiB. Variable Default Purpose THUNDERSTRIKE_IMAGE Release tag in the kit Image used by the Compose services. Keep it pinned to the intended release. THUNDERSTRIKE_CORES 2 Even physical-core budget, from 2 through 1,024. Reactor count is derived. THUNDERSTRIKE_TLS_PORT 7380 First reactor’s listening port. Other ports follow consecutively. THUNDERSTRIKE_ARENA_BYTES Automatic Resident arena bytes per reactor. Empty means 4 GiB with one reactor, or 2 GiB each with multiple reactors. THUNDERSTRIKE_HOST_PASSPHRASE ./docker/secrets/passphrase Host file containing the keystore passphrase on one line. THUNDERSTRIKE_HOST_TLS_DIR ./docker/tls CA and server certificate/key directory. Only server identity files are mounted into the database. THUNDERSTRIKE_TLS_NAMES localhost DNS names included in the server certificate. Separate names with spaces or commas. THUNDERSTRIKE_HOST_DATA data Named volume, or a host path such as /srv/thunderstrike. Regenerate ports after allocation changes. After a clean stop, change the core budget, starting port, or available topology, then run: SHELL · FROM THE RELEASE KITCopydocker compose -f compose.yaml run --rm configure docker compose up -d configure writes compose.override.yaml with the exact mapping. It refuses to overwrite an override file you authored yourself. Stale or missing generated mappings prevent startup before the stores open."
        },
        {
          "id": "clients",
          "title": "One address to connect.",
          "content": "03 / APPLICATION CLIENTS One address to connect. All official client packages use the same compiled core. It discovers the server layout, maintains connections to reactor ports, pipelines requests, and multiplexes large values over TLS 1.3. Language Install or documentation Python pip install thunderstrike Node.js npm install @shortsqueeze/thunderstrike Go go get github.com/TheManhattanProject/thunderstrike-client/go@v0.1.3 Rust cargo add thunderstrike .NET dotnet add package Thunderstrike Java io.github.maverick-ai:thunderstrike-client:0.1.3; JDK 22+ PHP composer require themanhattanproject/thunderstrike-client, then vendor/bin/thunderstrike-install; enable PHP FFI. C / C++ Headers and native libraries from the client releases. Client platforms include Linux x86-64 and ARM64, Windows x86-64, and macOS on Intel and Apple silicon. Server and client release numbers are independent. Consult the client README for platform and packaging details. Python: write a session snapshot. Run from the release-kit directory after the server is healthy. The CA file must be the one that issued the server’s certificate. PYTHONCopyfrom thunderstrike import Thunderstrike with open(\"docker/tls/ca.crt\") as ca: ca_pem = ca.read() db = Thunderstrike( \"127.0.0.1:7380\", tls_server_name=\"localhost\", tls_ca_pem=ca_pem, ) db.set(b\"agent:42:state\", b'{\"step\": 4}') state = db.get(b\"agent:42:state\") print(state) # bytes; None if the key is missing Node.js: the same connection model. JAVASCRIPT · ES MODULECopyimport { ThunderstrikeClient } from \"@shortsqueeze/thunderstrike\"; import { readFileSync } from \"node:fs\"; const db = await ThunderstrikeClient.connect({ endpoints: [\"127.0.0.1:7380\"], tlsServerName: \"localhost\", tlsCaPem: readFileSync(\"docker/tls/ca.crt\"), }); await db.set(Buffer.from(\"agent:42:state\"), Buffer.from('{\"step\": 4}')); const state = await db.get(Buffer.from(\"agent:42:state\")); console.log(state); // Buffer; null if the key is missing Handle errors by their retry class. The client reports a numeric error code and retry class. Busy responses that did not apply a request can be retried. A lost connection or timeout can leave the outcome unknown: retry only when the operation is safe to repeat. The client already retries some busy answers and dropped connections internally; see its documented retry behavior before adding application retries. Thunder uses its own protocol. Redis clients cannot connect directly. Values are opaque bytes; schema interpretation, authorization, search, and automatic expiration belong in your application."
        },
        {
          "id": "routing",
          "title": "Let the client find the owner.",
          "content": "04 / SHARDS & PORTS Let the client find the owner. The server always has 1,024 logical shards. The client requests DISCOVER, hashes each key using CRC32C(key) % 1024, and sends its request to the owning reactor. Each reactor owns a contiguous shard range, one arena, and one port. For R reactors, each receives floor(1024 / R) shards. The first 1024 % R reactors receive one additional shard. Ports start at THUNDERSTRIKE_TLS_PORT and increase by reactor index. Expose every generated port on the same host and port number. Port translation that changes the discovered number breaks routing. The persisted routing epoch advances when ownership or ports change. Two usable hardware threads per physical core produce one reactor group per core. Without SMT, two physical cores supply one group. Actual topology, affinity, and quotas determine the allocation. Explore a key’s shard and owner interactively →"
        },
        {
          "id": "sizing",
          "title": "Size memory per reactor.",
          "content": "05 / CAPACITY PLANNING Size memory per reactor. The arena is resident from boot. Container limits must exceed arena bytes multiplied by the derived reactor count, with additional headroom for the process. Example Arena per reactor Total arena RAM 2 cores, no SMT, automatic arena 4 GiB × 1 reactor 4 GiB + process overhead 2 cores, SMT ×2, automatic arena 2 GiB × 2 reactors 4 GiB + process overhead 8 cores, SMT ×2, 512 MiB values 4 GiB × 8 reactors 32 GiB + process overhead Large writes need working room. A SET needs two copies of its value in the arena. For 512 MiB values, explicitly configure THUNDERSTRIKE_ARENA_BYTES=4294967296. Concurrent requests and the mix of sizes also affect practical capacity. Reserve space beyond the live bytes. The documented disk-sizing rule is peak live bytes / 0.75, plus one 4 GiB chunk when storing values of 512 MiB or more. For 300 GiB of live values with such objects, that gives 404 GiB. Plan backup storage separately. When the volume fills, writes return StorageExhausted and reads continue to be served."
        },
        {
          "id": "security",
          "title": "Protect the connection and the store.",
          "content": "06 / TLS & ENCRYPTION Protect the connection and the store. TLS 1.3 is mandatory. The server requires an Ed25519 certificate issued by a CA, a matching key, and valid certificate dates. A self-signed server identity is refused. The files and who needs them. File Purpose Access ca.crt Issuing CA certificate Distribute to clients so they can verify the server. ca.key CA signing key Keep private and backed up. Do not mount into the database. server.crt Server identity and DNS names Mount read-only into the server. server.key Server private key Only the server needs it. tls-init creates the CA and server identity. Set THUNDERSTRIKE_TLS_NAMES before generating the identity. Clients must connect using a name on the certificate and trust the CA. Keep localhost among the names when using the bundled sample. Renew without replacing the CA. Keep the CA files. Remove the old server certificate and key from the TLS directory, run docker compose run --rm tls-init, then recreate the server container. The job does not overwrite existing identity files. Clients continue trusting the same CA. Use your own CA or mutual TLS. You can provide an Ed25519 CA and key to tls-init, or provide a server certificate chain and key yourself. Every certificate in the chain must use Ed25519. To require client identities, mount a client CA and set THUNDERSTRIKE_TLS_CLIENT_CA to its container path. Keep the keystore passphrase with your backup plan. Every value is encrypted at rest. The passphrase unlocks the keystore; there is no default passphrase. Losing the passphrase or data volume loses access to the values. A wrong passphrase prevents startup with Kek(AuthFailed)."
        },
        {
          "id": "operations",
          "title": "A clean stop is part of the workflow.",
          "content": "07 / OPERATE & RECOVER A clean stop is part of the workflow. SHELL · HEALTH AND LOGSCopydocker compose ps docker compose logs --tail=100 thunderstrike Healthy means every derived reactor has completed recovery and is listening. Startup can take time while arenas become resident and stores recover. Stopping docker compose stop thunderstrike sends SIGTERM. The server stops accepting requests, drains in-flight work, checkpoints the index, and exits. The kit allows two minutes. A forced kill is a crash. Backups Stop the server, or use an appropriate filesystem snapshot. Copy the entire data volume, including the keystore. Preserve the passphrase securely with the backup plan. Keep the original backup intact while validating a restore on a separate deployment. A file copy made while the database is writing is not consistent. Follow the complete backup procedure in the product guide. Upgrades Back up first. Extract the new release kit, carry over the deployment settings and secret/TLS files, set the new image reference, and start it against the preserved data volume. The named data volume is independent of the kit directory. Topology changes after a crash Recover using an allocation that produces the previous reactor count, then stop cleanly before changing it. Reactor journals belong to reactors. After a clean stop and configuration change, rerun configure before starting. Durability Every acknowledged write has a journal record on disk before the acknowledgement. The product guide’s durability contract covers crashes and power cuts. An orderly stop loses no acknowledged writes."
        },
        {
          "id": "troubleshooting",
          "title": "Start with the first refusal.",
          "content": "08 / TROUBLESHOOTING Start with the first refusal. If Compose repeatedly restarts the server, inspect docker compose logs thunderstrike. The first startup refusal usually identifies the setting to fix. Symptom Check io_uring not supported Host kernel must be 6.8+. Use the release kit’s io_uring-enabled seccomp profile. RLIMIT_MEMLOCK too low Use the kit’s memlock allowance. Check the Docker daemon’s own limits if the container cannot set them. Container memory below resident arena Budget arena bytes × derived reactors, plus overhead. Increase the limit or reduce the allocation. no keystore passphrase The configured file must exist, be readable, and contain the passphrase. Kek(AuthFailed) Use the passphrase associated with this volume’s keystore. Certificate verification fails Verify the trusted CA, DNS name, certificate dates, and Ed25519 chain. First port works; later connections fail Expose every discovered reactor port using the same host and container port numbers. Published ports missing or stale After a clean stop, rerun configure and then restart. Physical-core budget refused Use an even budget from 2 through 1,024 within the available physical CPUs and quota. Previous reactor count required Recover with the previous allocation, stop cleanly, then change topology. Exit status 132 / SIGILL The CPU may not support the image’s instruction set. In particular, -v4 requires AVX-512. StorageExhausted The volume is full. Provision sufficient space; the server continues serving reads. Exactly 1,024 shards required The directory uses another routing modulus. Migrate into a new store; do not edit the on-disk count record. A size is not a plain integer Use bytes without unit suffixes. Four GiB is 4294967296. Reference sources: the product guide, release-kit settings, and the official client documentation."
        }
      ]
    }
  ]
}
