US 11,893,042 B2
Methods and systems for automatically resharding a sharded collection of data
Mark Porter, Seattle, WA (US); Max Jacob Hirschhorn, New York, NY (US); Daniel William Gottlieb, Long Island City, NY (US); Garaudy Etienne, Brooklyn, NY (US); Andrew Michalski Schwerin, Brooklyn, NY (US); Judah Schvimer, New York, NY (US); Siyuan Zhou, Weehawken, NJ (US); Kaloian Manassiev, Barcelona (ES); and Esha Maharishi, Ashburn, VA (US)
Assigned to MongoDB, Inc., New York, NY (US)
Filed by MongoDB, Inc., New York, NY (US)
Filed on Jul. 1, 2022, as Appl. No. 17/856,171.
Claims priority of provisional application 63/220,121, filed on Jul. 9, 2021.
Prior Publication US 2023/0009909 A1, Jan. 12, 2023
Int. Cl. G06F 16/27 (2019.01); G06F 16/28 (2019.01)
CPC G06F 16/278 (2019.01) [G06F 16/285 (2019.01)] 18 Claims
OG exemplary drawing
 
1. A computer-implemented 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, by a processor, an instruction to reshard the sharded database;
(b) receiving, by the processor, a new shard key to be used in a resharding process to reshard the sharded database;
(c) determining, by the processor, 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, by the processor, the resharding process according to the new shard key, if the duration of unavailability is less than the predetermined amount of time, to produce a resharded database of the collection of data,
wherein the sharded database is stored in one or more first memories and the resharded database is stored in one or more second memories, the one or more second memories being same as or different from the one or more first memories,
wherein the duration of unavailability is a first duration of unavailability, and the method is further comprised of:
(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.