Doc: Add RDB file format specification (rdb-spec.md)
Adds rdb-spec.md documenting the RDB v12 file format. Currently, the format is only documented through C code, making it difficult for developers and third-party implementations to understand. This spec provides a centralized reference covering all types, opcodes, and encodings. Another option is to have this file at librdb repo.
i don't see the benefit.. it's not detailed enough to be used as a spec (for someone to parse the file solely based on that). e.g. detailing the exact encoding of everything.
it does say that the authority is the source code, which is nice.
i'm not sure it'll really serve any purpose. i.e. one purpose it can serve is to provide some introduction to the format, before getting into more details reading the source, but i'm not sure there's enough text here to cover that. another purpose it can serve it to explain reasoning and nuances in the format (but maybe code comments in either rdb.h or rdb.c could serve that purpose better.
all in all, i don't mind adding it, and gradually improving as we go, but i think the risk of leaving it stale are greater (see our README.md describing the files structure and other code parts :facepalm: )
@oranagra, i can move it to librdb repo and maintain it there if you have doubts.
well, being here means it's the official documentation of the format in redis. and arguably librdb is the official parser (part of the redis org), so maybe there's no big difference... i suppose being documented closer to rdb.c is better.
i just doubt it's very useful in the current state (not detailed enough for spec, and maybe not verbal enough for an introduction), and i'm afraid it'll easily become stale.
bottom line, from my perspective you can proceed as you see fit.
As a side note, our official RDB format specifications should cover all the Redis 8+ modules. We should also align on a single version number, of course.