{
  "id": "rdd",
  "title": "Redis design draft #2 (historical)",
  "url": "https://redis.io/docs/latest/operate/oss_and_stack/reference/internals/rdd/",
  "summary": "A design for the RDB format written in the early days of Redis",
  "tags": [
    "docs",
    "operate",
    "stack",
    "oss"
  ],
  "last_updated": "2026-04-01T08:10:08-05:00",
  "page_type": "content",
  "content_hash": "4b2db9c3cb21aedc0149cd0b0e692c1851bfb78f6db4d306e294b6f037ee6418",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "**Note: this document was written by the creator of Redis, Salvatore Sanfilippo, early in the development of Redis (c. 2013), as part of a series of design drafts. This is preserved for historical interest.**"
    },
    {
      "id": "redis-design-draft-2-rdb-version-7-info-fields",
      "title": "Redis Design Draft 2 -- RDB version 7 info fields",
      "role": "content",
      "text": "* Author: Salvatore Sanfilippo `antirez@gmail.com`\n* GitHub issue [#1048](https://github.com/redis/redis/issues/1048)"
    },
    {
      "id": "history-of-revisions",
      "title": "History of revisions",
      "role": "history",
      "text": "1.0, 10 April 2013 - Initial draft."
    },
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "The Redis RDB format lacks a simple way to add info fields to an RDB file\nwithout causing a backward compatibility issue even if the added meta data\nis not required in order to load data from the RDB file.\n\nFor example thanks to the info fields specified in this document it will\nbe possible to add to RDB information like file creation time, Redis version\ngenerating the file, and any other useful information, in a way that not\nevery field is required for an RDB version 7 file to be correctly processed.\n\nAlso with minimal changes it will be possible to add RDB version 7 support to\nRedis 2.6 without actually supporting the additional fields but just skipping\nthem when loading an RDB file.\n\nRDB info fields may have semantic meaning if needed, so that the presence\nof the field may add information about the data set specified in the RDB\nfile format, however when an info field is required to be correctly decoded\nin order to understand and load the data set content of the RDB file, the\nRDB file format must be increased so that previous versions of Redis will not\nattempt to load it.\n\nHowever currently the info fields are designed to only hold additional\ninformation that are not useful to load the dataset, but can better specify\nhow the RDB file was created."
    },
    {
      "id": "info-fields-representation",
      "title": "Info fields representation",
      "role": "content",
      "text": "The RDB format 6 has the following layout:\n\n* A 9 bytes magic \"REDIS0006\"\n* key-value pairs\n* An EOF opcode\n* CRC64 checksum\n\nThe proposal for RDB format 7 is to add the optional fields immediately\nafter the first 9 bytes magic, so that the new format will be:\n\n* A 9 bytes magic \"REDIS0007\"\n* Info field 1\n* Info field 2\n* ...\n* Info field N\n* Info field end-of-fields\n* key-value pairs\n* An EOF opcode\n* CRC64 checksum\n\nEvery single info field has the following structure:\n\n* A 16 bit identifier\n* A 64 bit data length\n* A data section of the exact length as specified\n\nBoth the identifier and the data length are stored in little endian byte\nordering.\n\nThe special identifier 0 means that there are no other info fields, and that\nthe remaining of the RDB file contains the key-value pairs."
    },
    {
      "id": "handling-of-info-fields",
      "title": "Handling of info fields",
      "role": "content",
      "text": "A program can simply skip every info field it does not understand, as long\nas the RDB version matches the one that it is capable to load."
    },
    {
      "id": "specification-of-info-fields-ids-and-content",
      "title": "Specification of info fields IDs and content.",
      "role": "content",
      "text": "#### Info field 0 -- End of info fields\n\nThis just means there are no longer info fields to process.\n\n#### Info field 1 -- Creation date\n\nThis field represents the unix time at which the RDB file was created.\nThe format of the unix time is a 64 bit little endian integer representing\nseconds since 1th January 1970.\n\n#### Info field 2 -- Redis version\n\nThis field represents a null-terminated string containing the Redis version\nthat generated the file, as displayed in the Redis version INFO field."
    }
  ],
  "examples": []
}
