DiceDB / dice

DiceDB is a redis-compliant, reactive, scalable, highly-available, unified cache optimized for modern hardware.
https://dicedb.io/
Other
6.86k stars 1.09k forks source link

Migration, refactoring of Single Shard and Multishard commands #1226

Closed AshwinKul28 closed 1 week ago

AshwinKul28 commented 3 weeks ago

This PR migrates multiple DiceDB commands to support both multi-shard and single-shard scenarios. The migration follows a structured flow for each command type as described below.

Multi-Shard Commands The following commands are migrated with support for multi-shard processing:

  1. MSET
  2. MGET
  3. SINTER
  4. SDIFF
  5. JSON.MGET

For the COPY and RENAME commands, the flow includes preprocessing, followed by decomposition and composition steps to manage multi-shard data efficiently. For the remaining multi-shard commands, only decomposition and composition steps are involved.

Single-Shard Commands The following commands are migrated with support for single-shard processing:

  1. JSON.SET
  2. JSON.GET
  3. JSON.TOGGLE
  4. JSON.TYPE
  5. JSON.DEL
  6. JSON.FORGET
  7. JSON.NUMMULTBY
  8. JSON.INGEST
  9. JSON.HGETALL
  10. JSON.NUMINCRBY

These single-shard commands follow a scatter-gather approach with a straightforward flow, where each command operates directly within the target shard, without the need for complex decomposition.

AshwinKul28 commented 3 weeks ago

@soumya-codes PR is now ready for the review, I will add more comments and documentation before merging.

AshwinKul28 commented 1 week ago

Closing this as opening another