Skip to content

feat: endpoint plugin #971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Aug 15, 2024
Merged

Conversation

aaronchung-bitquill
Copy link
Contributor

@aaronchung-bitquill aaronchung-bitquill commented Apr 25, 2024

Summary

Aurora Limitless Database is a sharded database. It has a DB Shard Group that contains multiple transaction routers that clients are ultimately routed to interact with.

This PR introduces a new plugin that put simply, does client side load balancing whilst connecting to an Aurora Limitless Database.

The plugin does this by polling an API for available transaction routers and their load levels, caching this info, and then choosing which transaction router to connect to based on the load info.

Description

The overall architecture is very similar to the EFM plugin. To poll for available transaction routers and their load levels, there is a LimitlessRouterMonitor class and its accompanying monitor service class LimitlessRouterService class.

To choose hosts, there are modifications to the RoundRobinHostSelector strategy, and a new HighestWeightHostSelector strategy class.

The LimitlessConnectionPlugin uses the RoundRobinHostSelector strategy with weights to select which Transaction Router to connect to. The weights are essentially the inverse of the transaction routers load. So a more loaded transaction router will be selected less, and a less loaded transaction router will be selected more. Modifications to the RoundRobinHostSelector strategy are to allow cached weights to be cleared when there is a change in hosts or weights.

In the case the selected transaction router is down and the driver fails to connect to it, the plugin has connection retry logic. It will mark the last selected router as UNAVAILABLE, then select another transaction router to connect to based on load using the new HighestWeightHostSelector strategy. It will continue to select and try to connect to the highest weight available router until a successful connection is made, or until the max attempts are reached.

Additional Reviewers

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@aaronchung-bitquill aaronchung-bitquill force-pushed the feat/endpoint-plugin branch 2 times, most recently from 7897f9c to afbcdce Compare April 26, 2024 01:13
@aaronchung-bitquill aaronchung-bitquill force-pushed the feat/endpoint-plugin branch 2 times, most recently from 80ca295 to 36c6202 Compare May 15, 2024 21:06
@aaronchung-bitquill aaronchung-bitquill force-pushed the feat/endpoint-plugin branch 2 times, most recently from 259f386 to 360db22 Compare June 8, 2024 01:16
@aaronchung-bitquill aaronchung-bitquill force-pushed the feat/endpoint-plugin branch 6 times, most recently from cd7ea1b to c311548 Compare July 3, 2024 23:18
@aaronchung-bitquill aaronchung-bitquill force-pushed the feat/endpoint-plugin branch 4 times, most recently from a137448 to 680cfa7 Compare July 5, 2024 00:51
@aaronchung-bitquill aaronchung-bitquill force-pushed the feat/endpoint-plugin branch 2 times, most recently from 9a08328 to f77233a Compare July 25, 2024 22:11
…upThread to ensure cleanupThread is not initialized twice
@aaronchung-bitquill aaronchung-bitquill merged commit c2b1457 into aws:main Aug 15, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants