System for dynamically varying traffic routing modes in a distributed cluster and method therefor
First Claim
1. A system comprising:
- a load balancer;
a database partitioned into at least a first shard of the database and a second shard of the database, the first shard of the database and the second shard of the database having been split from a partition of the database, and the partition of the database having been split from the database;
a first plurality of database servers coupled to the load balancer, each database server in the first plurality of database servers hosting a copy of the first shard of the database; and
a second plurality of database servers coupled to the load balancer, each database server in the second plurality of database servers hosting a copy of the second shard of the database; and
a centralized data store configured to maintain a list of (1) each database server in the first plurality of database servers and (2) each database server in the second plurality of database servers;
wherein;
the load balancer is configured to;
send incoming instructions to a database server selected from the first plurality of database servers or the second plurality of database servers, using load balancing techniques;
receive a first incoming instruction from a user, wherein the first incoming instruction comprises first queries of the first shard and second queries of the second shard;
process the first incoming instruction to extract the first queries of the first shard and the second queries of the second shard from the first incoming instruction;
forward the first queries of the first shard to the first plurality of database servers;
forward the second queries of the second shard to the second plurality of database servers;
receive a first query result from one database server of the first plurality of database servers;
receive a second query result from one database server of the second plurality of database servers;
aggregate the first query result and the second query result into an aggregated query result; and
present the aggregated query result to a requestor;
each database server in the first plurality of database servers is configured to send the first queries of the first shard of the database to a database server in the first plurality of database servers such that consecutive queries of the first queries of the first shard of the database are sent to different database servers of the first plurality of database servers; and
each database server in the second plurality of database servers is configured to send the second queries of the second shard of the database to a database server in the second plurality of database servers such that consecutive queries of the second queries of the second shard of the database are sent to different database servers of the second plurality of database servers.
2 Assignments
0 Petitions
Accused Products
Abstract
A system for dynamically varying traffic routing modes in a distributed database system is presented. A database system comprises a load balancer and a database partitioned into a first and second shard. Coupled to the load balancer are a first plurality of database servers and a second plurality of database servers. Each of the first plurality of database servers contains a copy of the first shard of the database. Each of the second plurality of database servers contains a copy of the second shard of the database. Each server in the first plurality of database servers sends queries to a server in the second plurality of database servers using a round-robin system in which servers in the second plurality of database servers take turns processing incoming queries, as a method of distributing load among the multiple servers. Other embodiments also are disclosed.
-
Citations
17 Claims
-
1. A system comprising:
-
a load balancer; a database partitioned into at least a first shard of the database and a second shard of the database, the first shard of the database and the second shard of the database having been split from a partition of the database, and the partition of the database having been split from the database; a first plurality of database servers coupled to the load balancer, each database server in the first plurality of database servers hosting a copy of the first shard of the database; and a second plurality of database servers coupled to the load balancer, each database server in the second plurality of database servers hosting a copy of the second shard of the database; and a centralized data store configured to maintain a list of (1) each database server in the first plurality of database servers and (2) each database server in the second plurality of database servers; wherein; the load balancer is configured to; send incoming instructions to a database server selected from the first plurality of database servers or the second plurality of database servers, using load balancing techniques; receive a first incoming instruction from a user, wherein the first incoming instruction comprises first queries of the first shard and second queries of the second shard; process the first incoming instruction to extract the first queries of the first shard and the second queries of the second shard from the first incoming instruction; forward the first queries of the first shard to the first plurality of database servers; forward the second queries of the second shard to the second plurality of database servers; receive a first query result from one database server of the first plurality of database servers; receive a second query result from one database server of the second plurality of database servers; aggregate the first query result and the second query result into an aggregated query result; and present the aggregated query result to a requestor; each database server in the first plurality of database servers is configured to send the first queries of the first shard of the database to a database server in the first plurality of database servers such that consecutive queries of the first queries of the first shard of the database are sent to different database servers of the first plurality of database servers; and each database server in the second plurality of database servers is configured to send the second queries of the second shard of the database to a database server in the second plurality of database servers such that consecutive queries of the second queries of the second shard of the database are sent to different database servers of the second plurality of database servers. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A method comprising:
-
receiving, at a load balancer, a first incoming instruction from a user, wherein the first incoming instruction comprises first queries of a first shard and second queries of a second shard; processing, at the load balancer, the first incoming instruction to extract the first queries of the first shard and the second queries of the second shard from the first incoming instruction; forwarding a first one of the first queries of the first shard from the load balancer to a first database server of a first plurality of database servers, wherein the first plurality of database servers hosts a first shard of a database, the first shard of the database having been split from a partition of the database, and the partition of the database having been split from the database; forwarding a second one of the first queries of the first shard from the load balancer to a second database server of the first plurality of database servers such that consecutive queries of the first queries of the first shard of the database are sent to different database servers of the first plurality of database servers; executing the first queries in both the first database server and the second database server to produce a first query result; forwarding a first one of the second queries of the second shard from the load balancer to a third database server of a second plurality of database servers, wherein the second plurality of database servers hosts a second shard of the database, the second shard of the database having been split from the partition of the database; forwarding a second one of the second queries of the second shard from the load balancer to a fourth database server of the second plurality of database servers, such that consecutive queries of the second queries of the second shard of the database are sent to different database servers of the second plurality of database servers; executing the second queries in both the third database server and the fourth database server to produce a second query result; aggregating the first query result with the second query result to form an aggregated query result; and presenting the aggregated query result to a requestor. - View Dependent Claims (8, 9, 10, 11, 12, 13, 14, 15)
-
-
16. A method comprising:
-
processing a first instruction at a load balancer; forwarding a processed first instruction from the load balancer to a first database server (1) assigned to a first server set and (2) hosting a first shard, the first shard having been split from a partition, and the partition having been split from a database; forwarding the processed first instruction from the load balancer to a second database server (1) assigned to the first server set and (2) hosting a second shard different than the first shard hosted by the first database server, the second shard having been split from the partition of the database; performing a first query on both the first database server and the second database server; processing a second instruction at the load balancer; forwarding a processed second instruction from the load balancer to a third database server (1) assigned to a second server set and (2) hosting a copy of the first shard; forwarding the processed second instruction from the load balancer to a fourth database server (1) assigned to the second server set and (2) hosting a copy of the second shard; performing a second query on both the third database server and the fourth database server; receiving a first query result from the first database server; receiving a second query result from the second database server; aggregating the first query result with the second query result to form an aggregated query result; and presenting the aggregated query result to a requestor; wherein; the third database server is distinct from the first database server and chosen using a first predetermined order of a first plurality of database servers hosting the first shard, wherein the first plurality of database servers host the first shard or a copy thereof; and the fourth database server is distinct from the second database server and chosen using a second predetermined order of a second plurality of database servers hosting the second shard, wherein the second plurality of database servers host the second shard or a copy thereof. - View Dependent Claims (17)
-
Specification