Skip to content

Commit

Permalink
docs: plugin service (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophia-bq authored Nov 1, 2024
1 parent 0159447 commit 694af5c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ on:
pull_request:
branches:
- "*"
paths-ignore:
- "**/*.md"
- "**/*.jpg"
- "**/README.txt"
- "**/LICENSE.txt"
- "docs/**"
- "ISSUE_TEMPLATE/**"
- "**/remove-old-artifacts.yml"

jobs:
run-checks-and-unit-tests:
Expand Down
34 changes: 34 additions & 0 deletions docs/development-guide/PluginService.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Plugin Service

![](../images/plugin_service.png)

The plugin service retrieves and updates the current connection and its relevant host information.

It also keeps track of the host list provider in use, and notifies it to update its host list.

It is expected that the plugins do not establish a connection themselves, but rather call `PluginService.connect()`
to establish connections.

## Host List Providers

The plugin service uses the host list provider to retrieve the most recent host information or topology information about the database.

The AWS Advanced NodeJS Wrapper has two host list providers, the `ConnectionStringHostListProvider` and the `RdsHostListProvider`.

The `ConnectionStringHostListProvider` is the default provider, it parses the host parameter for cluster information and stores the information.
The provider supports having multiple hosts in the host parameter:

| Host parameter | Support |
| ------------------------------- | ------------------ |
| `hostname1,hostname2` | :x: |
| `hostname1,hostname2:8090` | :x: |
| `hostname1:8090,hostname2` | :white_check_mark: |
| `hostname1:8090,hostname2:8090` | :white_check_mark: |

The `RdsHostListProvider` provides information about the Aurora cluster.
It uses the current connection to track the available hosts and their roles in the cluster.

The `ConnectionStringHostListProvider` is a static host list provider, whereas the `RdsHostListProvider` is a dynamic host list provider.
A static host list provider will fetch the host list during initialization and does not update the host list afterward,
whereas a dynamic host list provider will update the host list information based on database status.
When implementing a custom host list provider, implement either the `StaticHostListProvider` or the `DynamicHostListProvider` marker interfaces to specify its provider type.
Binary file added docs/images/plugin_service.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 694af5c

Please sign in to comment.