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

Multi-Database Support #1005

Draft
wants to merge 46 commits into
base: main
Choose a base branch
from
Draft

Multi-Database Support #1005

wants to merge 46 commits into from

Conversation

TalZaccai
Copy link
Contributor

@TalZaccai TalZaccai commented Feb 7, 2025

This PR enables multiple logical databases in a single Garnet server instance.

This PR includes:

  • Adding MaxDatabases configuration to garnet.conf + compatibility with redis.conf
  • Multi-DB support in StoreWrapper, including checkpointing & AOF
  • Current-DB context switching support in RespServerSession
  • Update GarnetInfoMetrics to reflect multiple databases data
  • Support for the following commands:
    • SELECT - switch current DB context
    • SWAPDB - swap two DB instances
    • FLUSHDB - flush all keys from current DB in context
    • FLUSHALL - flush all keys from all active databases
    • RANDOMKEY - get a random key from the current DB in context
  • Add support for specifying a DB ID in the following commands:
    • SAVE - synchronous checkpointing database by ID
    • BGSAVE - asynchronous checkpointing database by ID
    • LASTSAVE - number of seconds since last checkpoint of database by ID
    • COMMITAOF - synchronous database AOF commit by ID
  • Add DB ID to client info
  • Testing for supported commands
  • Benchmarking for supported commands

@badrishc badrishc linked an issue Feb 10, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple DB support and "SELECT" command support
2 participants