How can I interpret the rdb file

493 views
Skip to first unread message

Kashif

unread,
Aug 6, 2010, 4:41:34 AM8/6/10
to Redis DB
antirez,
I am writing a script that needs to read the dump.rdb file. I have
not been able to figure out how it formatted - I have gone through
rdb.c but because I am not a C programmer, I havent been able to
figure out the solution. How is dump.rdb formatted and encoded?

Thanks

Josiah Carlson

unread,
Aug 6, 2010, 11:58:30 AM8/6/10
to redi...@googlegroups.com
The full format of the .rdb file is a little much to explain in a
quick one-off "how does it work, I don't understand C" thread. My
advice: learn as much C as is necessary to understand the code that
was written ('introduction to C' offers some good links at Google),
and write your decoder while going through the code. While writing
your decoder, also have a small .rdb that you have saved in advance to
test your decoder against.

Also, learning C is worth the time. As long as you know some other
procedural language in advance, C shouldn't be much of a problem.

There is also some perl code out there to read and write .rdb files
(search the archives of this group), but I would still suggest
learning C.

- Josiah

> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
>
>

Salvatore Sanfilippo

unread,
Aug 6, 2010, 2:01:56 PM8/6/10
to redi...@googlegroups.com

I'm sorry Kashif, but currently the only "specification" for the RDB
file format is the source code itself.
This is not good and should be addressed, I'm adding this to the TODO
list, hoping that some good soul will take the challenge and help us
with that, otherwise I'll try to find the time to do it myself.

Cheers,
Salvatore

> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
>
>

--
Salvatore 'antirez' Sanfilippo
http://invece.org

"Once you have something that grows faster than education grows,
you’re always going to get a pop culture.", Alan Kay

Kashif

unread,
Aug 6, 2010, 5:35:14 PM8/6/10
to Redis DB
Thank you for your responses, when I figure it out I will try to help
with the related documentation.
Regards

On Aug 6, 11:01 pm, Salvatore Sanfilippo <anti...@gmail.com> wrote:
> On Fri, Aug 6, 2010 at 10:41 AM, Kashif <kashif.razza...@gmail.com> wrote:
> > antirez,
> >  I am writing a script that needs to read the dump.rdb file. I have
> > not been able to figure out how it formatted - I have gone through
> > rdb.c but because I am not a C programmer, I havent been able to
> > figure out the solution. How is dump.rdb formatted and encoded?
>
> > Thanks
>
> I'm sorry Kashif, but currently the only "specification" for the RDB
> file format is the source code itself.
> This is not good and should be addressed, I'm adding this to the TODO
> list, hoping that some good soul will take the challenge and help us
> with that, otherwise I'll try to find the time to do it myself.
>
> Cheers,
> Salvatore
>
> > --
> > You received this message because you are subscribed to the Google Groups "Redis DB" group.
> > To post to this group, send email to redi...@googlegroups.com.
> > To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/redis-db?hl=en.
>
> --
> Salvatore 'antirez' Sanfilippohttp://invece.org

Sripathi Krishnan

unread,
Mar 12, 2012, 12:56:56 AM3/12/12
to redi...@googlegroups.com
Hi,

I spent some time documenting the rdb file format - https://github.com/sripathikrishnan/redis-rdb-tools/blob/master/RDB_File_Format.textile, others may find it useful.

The github project also has a python script to parse the rdb file. This script is work in progress. Right now, the script is unable to parse LZF compressed strings. Other than that, it can parse the entire rdb file.

--Sri

On Saturday, August 7, 2010 3:05:14 AM UTC+5:30, Kashif wrote:
Thank you for your responses, when I figure it out I will try to help
with the related documentation.
Regards

On Aug 6, 11:01 pm, Salvatore Sanfilippo <anti...@gmail.com> wrote:
> On Fri, Aug 6, 2010 at 10:41 AM, Kashif <kashif.razza...@gmail.com> wrote:
> > antirez,
> >  I am writing a script that needs to read the dump.rdb file. I have
> > not been able to figure out how it formatted - I have gone through
> > rdb.c but because I am not a C programmer, I havent been able to
> > figure out the solution. How is dump.rdb formatted and encoded?
>
> > Thanks
>
> I'm sorry Kashif, but currently the only "specification" for the RDB
> file format is the source code itself.
> This is not good and should be addressed, I'm adding this to the TODO
> list, hoping that some good soul will take the challenge and help us
> with that, otherwise I'll try to find the time to do it myself.
>
> Cheers,
> Salvatore
>
> > --
> > You received this message because you are subscribed to the Google Groups "Redis DB" group.
> > To post to this group, send email to redi...@googlegroups.com.
> > To unsubscribe from this group, send email to redis-db+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages