主权项 |
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 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; andsending, to the client application, a response to the first query that is based on the first result. |