StackExchange.Redis icon indicating copy to clipboard operation
StackExchange.Redis copied to clipboard

how to copy database to server another ?

Open TranNghia1998 opened this issue 4 years ago • 3 comments

I'm doing copy database to server another with bulk records. Below code, It working but very slow image

I used try copy on GUI of Redis. It run very fast. Have way speed up ?

TranNghia1998 avatar Dec 24 '21 08:12 TranNghia1998

I would presume a combination of batching, concurrency, and pipelining. These, however, are not trivial to explain! You can probably make a passable first stab simply by using Parallel.ForEach on the result of Keys(...), though.

mgravell avatar Dec 24 '21 17:12 mgravell

I'm not sure which GUI is in play here, but I'd guess they're using the MIGRATE API probably? (this assumes server A can see server B) It has bulk modes added in later versions - not something I've used much but we do support it and I've had fun fixing the tests up around it :) Details: https://redis.io/commands/migrate

NickCraver avatar Dec 24 '21 17:12 NickCraver

Closing this out as answered above - migrate is what you want for max speed here, regardless of the client :)

NickCraver avatar Dec 31 '21 15:12 NickCraver