Patent ID: 11893042
Assignee: MONGODB, INC.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 17:
18. A non-transitory computer-readable storage medium storing code that, when executed by a processor, causes the processor to perform a method of resharding a sharded database of a collection of data sharded according to a first shard key, the method comprising steps of:
(a) receiving an instruction to reshard the sharded database;
(b) receiving a new shard key to be used in a resharding process to reshard the sharded database;
(c) determining whether a duration of unavailability of the sharded database during the resharding process is less than a predetermined amount of time; and
(d) automatically performing the resharding process according to the new shard key to produce a resharded database of the collection of data, if the duration of unavailability is less than the predetermined amount of time;
wherein the duration of unavailability is a first duration of unavailability, and the method is further comprising:
(e) performing, by the processor, the resharding process for a first period of time if the first duration of unavailability is determined to be equal to or greater than the predetermined amount of time;
(f) determining, by the processor after the first period of time, whether a current duration of unavailability of the sharded database is less than the first duration of unavailability;
(g) performing, by the processor, the resharding process for a second period of time if the current duration of unavailability is less than the first duration of unavailability; and
(h) automatically cancelling, by the processor, the resharding process if the current duration of unavailability determined at step (f) is equal to or greater than the first duration of unavailability.