{
  "id": "valkey",
  "title": "Valkey",
  "lang": "en",
  "source_lang": "en",
  "summary": "Valkey is an open-source, in-memory data structure server used for caching, databases, messaging, and other low-latency applications, developed as a community-governed fork of Redis.",
  "category": "computer-science",
  "subcategory": "software",
  "type": "product",
  "aliases": [],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/valkey/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/valkey/",
      "json": "https://aiwiki.page/zh/valkey.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "Valkey is an open-source in-memory data structure server used as a database, application cache, and message broker. It stores values under keys and provides commands for manipulating strings, lists, sets, hashes, sorted sets, streams, and other specialized structures. The project originated in March 2024 as a fork of Redis, following a change to the licensing of future Redis releases. Valkey is developed under the auspices of the Linux Foundation and distributed under the permissive BSD 3-Clause license."
    },
    {
      "heading": "Origins and governance",
      "text": "Valkey was created from Redis 7.2.4, which was available under the BSD 3-Clause license. In March 2024, Redis announced that subsequent releases would use the Redis Source Available License version 2 and the Server Side Public License version 1 instead of its previous BSD license. These licenses imposed conditions that differed from the established permissive licensing model.\n\nThe Linux Foundation announced Valkey later that month as a community-led continuation of the BSD-licensed codebase. Initial supporters included Amazon Web Services, Google Cloud, Oracle, Ericsson, and Snap. Several contributors with experience maintaining Redis joined the new project.\n\nThe fork preserved the right to develop and redistribute the existing BSD-licensed code independently of changes to the upstream project's licensing. Valkey has its own maintainers, technical governance, release process, and development priorities. Its relationship to Redis is therefore one of shared ancestry rather than a permanent promise that the two projects will implement identical features."
    },
    {
      "heading": "Data model and commands",
      "text": "Valkey uses a key–value model, but its values are not limited to opaque byte sequences. Each supported data structure has commands that operate on its contents, allowing work to take place on the server rather than requiring applications to retrieve, modify, and replace an entire value.\n\nCore types include:\n\n- Strings: Binary-safe values that can hold text, serialized objects, or numeric representations. Commands support operations such as replacement, concatenation, and incrementing.\n- Lists: Ordered sequences supporting insertion and removal at either end, as well as indexed and range-based access.\n- Sets: Collections of unique members, with operations for membership testing, union, intersection, and difference.\n- Hashes: Collections of field–value pairs, often used to represent records.\n- Sorted sets: Unique members associated with numeric scores, supporting ranking and score-range queries.\n- Streams: Append-oriented collections of entries with identifiers, including consumer-group facilities for distributing processing work.\n\nAdditional facilities include bitmaps, approximate cardinality estimation with HyperLogLog, and geospatial operations.\n\nKeys can have expiration times. Expiration supports uses such as temporary session records, short-lived credentials, and cached query results. It is distinct from eviction: expiration follows a key's lifetime, whereas eviction removes data under a configured memory policy.\n\nValkey is commonly classified as a NoSQL system. Unlike a relational database, it does not principally organize information into tables with declarative joins and general-purpose SQL queries. Applications typically express access patterns through keys and type-specific commands."
    },
    {
      "heading": "Architecture and protocol",
      "text": "Valkey follows a client–server model. Applications connect through client libraries and send commands using the Redis Serialization Protocol, usually abbreviated RESP. Retaining this protocol and much of the inherited command interface allows many existing Redis clients and applications to work with Valkey.\n\nThe server's architecture centers on an event loop and efficient in-memory operations. Valkey also uses background work and multithreaded I/O facilities; their behavior and scope depend on the release and configuration. Multithreaded networking does not imply that every command executes concurrently across all processor cores.\n\nCommand cost depends on the operation and data size. A simple lookup can be inexpensive, while scanning a large collection, returning a large response, or running a lengthy script can occupy server resources substantially longer. In-memory storage reduces dependence on disk access for normal operations, but it does not make all commands equally fast.\n\nClients can use pipelining to send multiple commands without waiting for each reply before sending the next. This reduces network round trips but does not itself provide transactional isolation."
    },
    {
      "heading": "Atomic operations and transactions",
      "text": "Many individual Valkey commands execute as an atomic operation relative to other client commands. An increment, for example, avoids the race that would arise if a client separately read a value, modified it locally, and wrote it back.\n\nValkey also supports grouped command execution through MULTI and EXEC. These transactions execute queued commands without interleaving commands from other clients. WATCH provides optimistic concurrency control by allowing execution to be cancelled if monitored keys change before the transaction is committed.\n\nThese facilities differ from transactions in many relational systems. In particular, a runtime error in one queued command does not generally roll back commands that have already executed. Atomic execution should not be confused with unrestricted rollback or guaranteed durability.\n\nServer-side Lua scripting can combine several operations while avoiding intermediate client round trips. Long-running scripts can delay other work, and clustered deployments impose restrictions on the keys that a script may access."
    },
    {
      "heading": "Persistence and replication",
      "text": "Although Valkey normally serves its working dataset from memory, it can persist data to storage.\n\nRDB snapshots record point-in-time representations of the dataset. They are useful for compact saved images and recovery, but changes made after the most recent successful snapshot may be lost after a failure.\n\nAppend-only files, or AOF, record write operations so that the dataset can be reconstructed. Synchronization policies control how frequently buffered data is flushed to durable storage, creating a trade-off between write overhead and potential data loss. Rewriting compacts the log rather than retaining an indefinitely growing history of every operation.\n\nPersistence can be disabled, enabled in one form, or configured using both mechanisms. It is not equivalent to an independent backup strategy: accidental deletion or other unwanted changes can also become part of persisted state.\n\nValkey supports primary–replica replication. Replicas receive updates from a primary and can serve reads or become candidates for promotion after a failure. Replication is normally asynchronous, so replica reads may lag behind the primary. Commands that wait for replication acknowledgements can reduce some loss risks, but do not turn the system into a strongly consistent, consensus-based database."
    },
    {
      "heading": "Availability and clustering",
      "text": "Valkey provides two principal mechanisms for operating beyond a single independent server.\n\nSentinel monitors primary and replica instances, detects failures, coordinates failover, and helps clients discover the active primary. It addresses availability but does not automatically partition a dataset across multiple primaries.\n\nValkey Cluster partitions keys across 16,384 hash slots assigned to primary nodes. Replicas provide failover capacity, and cluster-aware clients route requests to the appropriate nodes or follow redirections.\n\nClustering introduces constraints on multi-key operations. Commands that require several keys together generally require those keys to occupy the same hash slot. Hash tags—designated substrings enclosed in braces within key names—allow related keys to be placed together.\n\nNeither replication nor clustering eliminates failure trade-offs. Network partitions, replication lag, and failover timing can affect availability and the preservation of acknowledged writes."
    },
    {
      "heading": "Applications and operational limits",
      "text": "Common applications include caching database results, maintaining user sessions, implementing counters and rate limits, storing rankings, and coordinating short-lived application state. These uses benefit from low-latency access and operations tailored to particular data structures.\n\nMessaging facilities have different delivery properties. Publish/subscribe distributes messages to currently connected subscribers without retaining a replayable history. Streams retain entries and support consumer groups, but reliable processing still depends on acknowledgement handling, retention settings, persistence, and application behavior.\n\nMemory capacity is a central operational constraint. The memory footprint includes stored values, keys, internal structures, allocator overhead, client buffers, and replication or persistence activity. When a configured memory limit is reached, Valkey can reject writes or evict keys according to policy. Eviction suitable for a disposable cache may be unsuitable for authoritative records.\n\nSecurity facilities include authentication, access-control lists, and TLS. Their protection depends on configuration and deployment boundaries; command access can expose or alter the stored dataset."
    },
    {
      "heading": "Compatibility and divergence",
      "text": "Valkey's shared origin with Redis makes compatibility an important part of its ecosystem. Many applications using commands available in Redis 7.2 can migrate with limited changes. Compatibility nevertheless has several distinct dimensions: network protocol, command behavior, persistence formats, configuration, replication, and extension interfaces.\n\nCompatibility with the fork's starting point does not guarantee compatibility with every later Redis feature or proprietary extension. Valkey and Redis evolve independently, and mixed-version operation depends on the specific releases and features involved."
    }
  ],
  "links": [
    "open-source-software",
    "database",
    "message-broker",
    "software-fork",
    "redis",
    "data-structure",
    "nosql",
    "relational-database",
    "client-server-model",
    "event-loop",
    "atomic-operation",
    "database-transaction",
    "data-backup",
    "database-replication",
    "authentication",
    "access-control",
    "transport-layer-security"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}