Request routing and query processing in a sharded database
First Claim
Patent Images
1. A method, comprising:
- storing, by a shard coordinator, a plurality of map entries;
wherein each map entry, of the plurality of map entries, maps a distinct sharding key value set to a shard of a plurality of shards of a sharded database;
wherein at least one shard of the plurality of shards is mapped to a sharding key value set that comprises non-contiguous sharding key values;
wherein each shard of the plurality of shards comprises one or more database servers;
receiving, at the shard coordinator, a first query from a client application, wherein the first query comprises a first sharding key value;
in response to receiving the first query, performing;
identifying a particular map entry, of the plurality of map entries, that corresponds to a sharding key value set that includes the first sharding key value;
using the particular map entry to identify a target shard, from the plurality of shards, that corresponds to the sharding key value set that includes the first sharding key value;
generating a first result for the first query by using the target shard that corresponds to the sharding key value set that includes the first sharding key value; and
sending, to the client application, a response to the first query that is based on the first result;
wherein generating the first result for the first query and sending the response to the first query are performed by the target shard.
1 Assignment
0 Petitions
Accused Products
Abstract
Techniques are provided for creating, organizing, and maintaining a sharded database. A sharded database can be created using user-defined sharding, system-managed sharding, or composite sharding. The sharded database is implemented with relational database techniques. The techniques described can be used to route database requests and process queries in a sharded database.
-
Citations
32 Claims
-
1. A method, comprising:
-
storing, by a shard coordinator, a plurality of map entries; wherein each map entry, of the plurality of map entries, maps a distinct sharding key value set to a shard of a plurality of shards of a sharded database; wherein at least one shard of the plurality of shards is mapped to a sharding key value set that comprises non-contiguous sharding key values; wherein each shard of the plurality of shards comprises one or more database servers; receiving, at the shard coordinator, a first query from a client application, wherein the first query comprises a first sharding key value; in response to receiving the first query, performing; identifying a particular map entry, of the plurality of map entries, that corresponds to a sharding key value set that includes the first sharding key value; using the particular map entry to identify a target shard, from the plurality of shards, that corresponds to the sharding key value set that includes the first sharding key value; generating a first result for the first query by using the target shard that corresponds to the sharding key value set that includes the first sharding key value; and sending, to the client application, a response to the first query that is based on the first result; wherein generating the first result for the first query and sending the response to the first query are performed by the target shard. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
-
-
16. A method comprising:
-
storing, by a shard coordinator, a plurality of map entries; wherein each map entry, of the plurality of map entries, maps a distinct sharding key value set to a shard of a plurality of shards of a sharded database; wherein each shard of the plurality of shards comprises one or more database servers; receiving, at the shard coordinator, a first query from a client application, wherein the first query comprises a first sharding key value; in response to receiving the first query, performing; identifying a particular map entry, of the plurality of map entries, that corresponds to the sharding key value set that includes the first sharding key value; using the particular map entry to identify a target shard from the plurality of shards; generating a first result for the first query by using the target shard that corresponds to the sharding key value set that includes the first sharding key value; sending, to the client application, a response to the first query that is based on the first result; and for each map entry of the plurality of map entries, mapping the distinct sharding key value set to the shard of a plurality of shards of the sharded database based, at least in part, on user-defined instructions; wherein the user-defined instructions include a mapping criterion, wherein the mapping criterion specifies either; which specific ranges map to which specific shards, or which specific individual sharding key values map to which specific shards.
-
-
17. One or more non-transitory computer-readable media storing instructions, wherein the instructions include:
-
instructions which, when executed by one or more hardware processors, cause storing, by a shard coordinator, a plurality of map entries; wherein each map entry, of the plurality of map entries, maps a distinct sharding key value set to a shard of a plurality of shards of a sharded database; wherein at least one shard of the plurality of shards is mapped to a sharding key value set that comprises non-contiguous sharding key values; wherein each shard of the plurality of shards comprises one or more database servers; instructions which, when executed by one or more hardware processors, cause receiving, at the shard coordinator, a first query from a client application, wherein the first query comprises a first sharding key value; instructions which, when executed by one or more hardware processors, cause, in response to receiving the first query, identifying a particular map entry, of the plurality of map entries, that corresponds to a sharding key value set that includes the first sharding key value; instructions which, when executed by one or more hardware processors, cause, in response to receiving the first query, using the particular map entry to identify a target shard, from the plurality of shards, that corresponds to the sharding key value set that includes the first sharding key value; instructions which, when executed by one or more hardware processors, cause, in response to receiving the first query, generating a first result for the first query by using the target shard that corresponds to the sharding key value set that includes the first sharding key value; and instructions which, when executed by one or more hardware processors, cause, in response to receiving the first query, sending, to the client application, a response to the first query that is based on the first result; wherein generating the first result for the first query and sending the response to the first query are performed by the target shard. - View Dependent Claims (18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31)
-
-
32. One or more non-transitory computer-readable media storing instructions which, when executed by one or more processors, cause:
-
storing, by a shard coordinator, a plurality of map entries; wherein each map entry, of the plurality of map entries, maps a distinct sharding key value set to a shard of a plurality of shards of a sharded database; wherein each shard of the plurality of shards comprises one or more database servers; receiving, at the shard coordinator, a first query from a client application, wherein the first query comprises a first sharding key value; in response to receiving the first query, performing; identifying a particular map entry, of the plurality of map entries, that corresponds to the sharding key value set that includes the first sharding key value; using the particular map entry to identify a target shard from the plurality of shards; generating a first result for the first query by using the target shard that corresponds to the sharding key value set that includes the first sharding key value; and sending, to the client application, a response to the first query that is based on the first result; for each map entry of the plurality of map entries, mapping the distinct sharding key value set to a shard of a plurality of shards of a sharded database based, at least in part, on user-defined instructions; wherein the user-defined instructions include a mapping criterion, wherein the mapping criterion specifies either; which specific ranges map to which specific shards, or which specific individual sharding key values map to which specific shards.
-
Specification