Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement RDB File Reading on Startup #14

Open
4 tasks
proXDhiya opened this issue Aug 24, 2024 · 0 comments
Open
4 tasks

Implement RDB File Reading on Startup #14

proXDhiya opened this issue Aug 24, 2024 · 0 comments
Assignees
Labels
Command New command enhancement New feature or request RDB Redis Database Worker Worker update

Comments

@proXDhiya
Copy link
Owner

Implement functionality to read an RDB (Redis Data Persistence) file at the start of the program. The file will be provided via --dir and --dbfilename options. If the specified RDB file does not exist, the program should treat the database as empty.

Requirements:

  • On program start, check if the RDB file specified by --dir and --dbfilename exists:
    • If the file exists, read and load the database from it.
    • If the file does not exist, initialize the database as empty.
  • Implement support for reading numbers stored in the RDB file using both little-endian and big-endian formats, as per the RDB specification.
  • Integrate the reading functionality with the SAVE command to ensure that a valid RDB file is generated and can be read back correctly.

Acceptance Criteria:

  • The program correctly reads an existing RDB file at startup, loading the database with its contents.
  • If the RDB file does not exist, the program initializes with an empty database.
  • The program can correctly interpret numbers stored in little-endian and big-endian formats within the RDB file.
  • The RDB file generated by the SAVE command is valid and can be successfully read on subsequent startups.

Additional Notes:

  • Refer to the MDN article on endianness to understand how to handle little-endian and big-endian formats.
  • Ensure the implementation is robust, handling edge cases such as corrupted or partially written RDB files.
@proXDhiya proXDhiya added enhancement New feature or request Command New command Worker Worker update RDB Redis Database labels Aug 24, 2024
@proXDhiya proXDhiya self-assigned this Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Command New command enhancement New feature or request RDB Redis Database Worker Worker update
Projects
None yet
Development

No branches or pull requests

1 participant