Skip to content

Commit

Permalink
docs: fastest response strategy plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
joyc-bq committed Dec 10, 2024
1 parent efc2df4 commit d3df735
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/using-the-jdbc-driver/ReaderSelectionStrategies.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ To balance connections to reader instances more evenly, different selection stra
| `roundRobin` | See the following rows for configuration parameters. | The round robin strategy will select a reader instance by taking turns with all available database instances in a cycle. A slight addition to the round robin strategy is the weighted round robin strategy, where more connections will be passed to reader instances based on user specified connection properties. | N/A |
| | `roundRobinHostWeightPairs` | This parameter value must be a `string` type comma separated list of database host-weight pairs in the format `<host>:<weight>`. The host represents the database instance name, and the weight represents how many connections should be directed to the host in one cycle through all available hosts. For example, the value `instance-1:1,instance-2:4` means that for every connection to `instance-1`, there will be four connections to `instance-2`. <br><br> **Note:** The `<weight>` value in the string must be an integer greater than or equal to 1. | `null` |
| | `roundRobinDefaultWeight` | This parameter value must be an integer value in the form of a `string`. This parameter represents the default weight for any hosts that have not been configured with the `roundRobinHostWeightPairs` parameter. For example, if a connection were already established and host weights were set with `roundRobinHostWeightPairs` but a new reader node was added to the database, the new reader node would use the default weight. <br><br> **Note:** This value must be an integer greater than or equal to 1. | `1` |
| `fastestResponse` | See the following rows for configuration parameters. | The fastest response strategy identifies the fastest response host, then stores this host in a cache for future use. <br><br> **Note:** The Fastest Response Strategy plugin must also be loaded into the plugins list by setting the `plugins` connection configuration parameter to include the `fastestResponseStrategy` plugin code. | N/A |
| | `responseMeasurementIntervalMs` | Interval in millis between measuring response time to a database node. | `30000` |
1 change: 1 addition & 0 deletions docs/using-the-jdbc-driver/UsingTheJdbcDriver.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ The AWS JDBC Driver has several built-in plugins that are available to use. Plea
| [Developer Plugin](./using-plugins/UsingTheDeveloperPlugin.md) | `dev` | Any database | Helps developers test various everyday scenarios including rare events like network outages and database cluster failover. The plugin allows injecting and raising an expected exception, then verifying how applications handle it. | None |
| [Aurora Initial Connection Strategy](./using-plugins/UsingTheAuroraInitialConnectionStrategyPlugin.md) | `initialConnection` | Aurora | Allows users to configure their initial connection strategy to reader cluster endpoints. | None |
| [Limitless Connection Plugin](./using-plugins/UsingTheLimitlessConnectionPlugin.md) | `limitless` | Aurora | Enables client-side load-balancing of Transaction Routers on Amazon Aurora Limitless Databases . | None |
| Fastest Response Strategy Plugin | `fastestResponseStrategy` | Aurora | When read-write splitting is enabled, this plugin selects the reader to switch to based on the host with the fastest response time. The plugin achieves this by periodically monitoring the hosts' response times and storing the fastest host in a cache. **Note:** the `readerHostSelectorStrategy` parameter must be set to `fastestResponse` in the user-defined connection properties in order to enable this plugin. See [reader selection strategies](./ReaderSelectionStrategies.md) | None |

[^1]: [RDS Multi-AZ DB Clusters do not support IAM](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.Limitations.html).
[^2]: Federated Identity and Okta rely on IAM. Due to [^1], RDS Multi-AZ Clusters are not supported.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public class FastestResponseStrategyPlugin extends AbstractConnectionPlugin {
private static final Set<String> subscribedMethods =
Collections.unmodifiableSet(new HashSet<String>() {
{
add("connect");
add("forceConnect");
add("notifyNodeListChanged");
add("acceptsStrategy");
add("getHostSpecByStrategy");
Expand Down

0 comments on commit d3df735

Please sign in to comment.