You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The wrapper is complementary to an existing NodeJS driver and aims to extend the functionality of the driver to enable applications to take full advantage of the features of clustered databases such as Amazon Aurora. In other words, the AWS Advanced NodeJS Wrapper does not connect directly to any database, but enables support of AWS and Aurora functionalities on top of an underlying NodeJS driver of the user's choice.
Copy file name to clipboardExpand all lines: common/lib/utils/locales/en.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
"PluginManager.unableToRetrievePlugin": "Unable to retrieve plugin instance.",
5
5
"ConnectionProvider.unsupportedHostSelectorStrategy": "Unsupported host selection strategy '%s' specified for this connection provider '%s'. Please visit the documentation for all supported strategies.",
6
6
"ConnectionPluginChainBuilder.errorImportingPlugin": "The plugin could not be imported due to error '%s'. Please ensure the required dependencies have been installed. Plugin: '%s'",
"ClientUtils.queryTaskTimeout": "Client query task timed out, if a network error did not occur, please review the usage of the 'mysqlQueryTimeout' connection parameter.",
Copy file name to clipboardExpand all lines: docs/GettingStarted.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,13 +10,13 @@ Before using the AWS Advanced NodeJS Wrapper, you must install:
10
10
- To use the wrapper with Aurora with PostgreSQL compatibility, install the [PostgreSQL Client](https://github.com/brianc/node-postgres).
11
11
- To use the wrapper with Aurora with MySQL compatibility, install the [MySQL2 Client](https://github.com/sidorares/node-mysql2).
12
12
13
-
If you are using the AWS NodeJS Wrapper as part of a Node project, include the wrapper and underlying driver as dependencies.
13
+
If you are using the AWS Advanced NodeJS Wrapper as part of a Node project, include the wrapper and underlying driver as dependencies.
14
14
15
-
> **Note:** Depending on which features of the AWS NodeJS Wrapper you use, you may have additional package requirements. Please refer to this [table](https://github.com/awslabs/aws-advanced-nodejs-wrapper/blob/main/docs/using-the-nodejs-wrapper/UsingTheNodejsWrapper.md#list-of-available-plugins) for more information.
15
+
> **Note:** Depending on which features of the AWS Advanced NodeJS Wrapper you use, you may have additional package requirements. Please refer to this [table](https://github.com/awslabs/aws-advanced-nodejs-wrapper/blob/main/docs/using-the-nodejs-wrapper/UsingTheNodejsWrapper.md#list-of-available-plugins) for more information.
16
16
17
-
## Obtaining the AWS NodeJS Wrapper
17
+
## Obtaining the AWS Advanced NodeJS Wrapper
18
18
19
-
You can use [npm](https://www.npmjs.com/) to obtain the AWS NodeJS Wrapper by adding the following configuration to the application's `package.json` file:
19
+
You can use [npm](https://www.npmjs.com/) to obtain the AWS Advanced NodeJS Wrapper by adding the following configuration to the application's `package.json` file:
20
20
21
21
```json
22
22
{
@@ -26,6 +26,6 @@ You can use [npm](https://www.npmjs.com/) to obtain the AWS NodeJS Wrapper by ad
26
26
}
27
27
```
28
28
29
-
## Using the AWS NodeJS Wrapper
29
+
## Using the AWS Advanced NodeJS Wrapper
30
30
31
-
For more detailed information about how to use and configure the AWS NodeJS Wrapper, please visit [this page](./using-the-nodejs-wrapper/UsingTheNodejsWrapper.md).
31
+
For more detailed information about how to use and configure the AWS Advanced NodeJS Wrapper, please visit [this page](./using-the-nodejs-wrapper/UsingTheNodejsWrapper.md).
| Unit tests | Tests for AWS NodeJS Wrapper correctness.|
38
+
| Unit tests | Tests for AWS Advanced NodeJS Wrapper correctness. |
39
39
| Failover integration tests | Wrapper-specific tests for different reader and writer failover workflows using the Failover Connection Plugin. |
40
40
| Enhanced failure monitoring integration tests | Wrapper-specific tests for the enhanced failure monitoring functionality using the Host Monitoring Connection Plugin. |
41
41
| Read Write Splitting integration tests | Wrapper-specific tests for the read write splitting functionality using the Read Write Splitting Plugin. |
@@ -44,14 +44,14 @@ The AWS NodeJS Wrapper uses the following tests to verify its correctness and pe
44
44
45
45
### Performance Tests
46
46
47
-
The AWS NodeJS Wrapper has 2 types of performance tests:
47
+
The AWS Advanced NodeJS Wrapper has 2 types of performance tests:
48
48
49
49
1. manually-triggered performance tests measuring the failover and enhanced failure monitoring plugins' performance under different configurations.
50
-
2. benchmarks measuring the AWS NodeJS Wrapper's overhead when executing simple methods using the [benny benchmarking framework](https://www.npmjs.com/package/benny).
50
+
2. benchmarks measuring the AWS Advanced NodeJS Wrapper's overhead when executing simple methods using the [benny benchmarking framework](https://www.npmjs.com/package/benny).
51
51
52
-
#### AWS NodeJS Wrapper Benchmarks
52
+
#### AWS Advanced NodeJS Wrapper Benchmarks
53
53
54
-
There are specific benchmarks measuring the AWS NodeJS Wrapper's [pipelines](Pipelines.md). The goal of these benchmarks is to measure the overhead of using the AWS NodeJS Wrapper with multiple plugins enabled. These benchmarks do not make actual connections to the databases, and they test connections with different numbers of simple test plugins and with the default plugin combination which consists of the [aurora connection tracker](../using-the-nodejs-wrapper/using-plugins/UsingTheAuroraConnectionTrackerPlugin.md), [failover](../using-the-nodejs-wrapper/using-plugins/UsingTheFailoverPlugin.md), and [host monitoring](../using-the-nodejs-wrapper/using-plugins/UsingTheHostMonitoringPlugin.md). The images below represent the benchmarks for the `connect`, `execute` and `releaseResources` pipelines.
54
+
There are specific benchmarks measuring the AWS Advanced NodeJS Wrapper's [pipelines](Pipelines.md). The goal of these benchmarks is to measure the overhead of using the AWS Advanced NodeJS Wrapper with multiple plugins enabled. These benchmarks do not make actual connections to the databases, and they test connections with different numbers of simple test plugins and with the default plugin combination which consists of the [aurora connection tracker](../using-the-nodejs-wrapper/using-plugins/UsingTheAuroraConnectionTrackerPlugin.md), [failover](../using-the-nodejs-wrapper/using-plugins/UsingTheFailoverPlugin.md), and [host monitoring](../using-the-nodejs-wrapper/using-plugins/UsingTheHostMonitoringPlugin.md). The images below represent the benchmarks for the `connect`, `execute` and `releaseResources` pipelines.
@@ -69,17 +69,17 @@ See [here](PluginPipelinePerformanceResults.md#benchmarks) for a more detailed p
69
69
70
70
#### Failover-specific Performance Tests
71
71
72
-
The diagrams in this section show the AWS NodeJS Wrapper's failure detection performance with or without the Failover Connection Plugin under different settings.
72
+
The diagrams in this section show the AWS Advanced NodeJS Wrapper's failure detection performance with or without the Failover Connection Plugin under different settings.
73
73
The performance tests share the following workflow:
74
74
75
-
1. The AWS NodeJS Wrapper executes an SQL query with a long execution time.
75
+
1. The AWS Advanced NodeJS Wrapper executes an SQL query with a long execution time.
76
76
2. After a network outage delay in milliseconds, the test triggers a network outage.
77
77
Varying values for the network outage delay are tested, represented on the X axis of the diagrams below.
78
78
3. Measures elapsed time between when the network outage and
79
-
- when the AWS NodeJS Wrapper detects the network failure if the Host Monitoring Plugin is used, or
80
-
- when the AWS NodeJS Wrapper finishes the failover process if the Failover Plugin is used.
79
+
- when the AWS Advanced NodeJS Wrapper detects the network failure if the Host Monitoring Plugin is used, or
80
+
- when the AWS Advanced NodeJS Wrapper finishes the failover process if the Failover Plugin is used.
81
81
82
-
The following diagrams show how the AWS NodeJS Wrapper performs under a more common failure detection setting versus a more aggressive setting.
82
+
The following diagrams show how the AWS Advanced NodeJS Wrapper performs under a more common failure detection setting versus a more aggressive setting.
83
83
84
84
Common Failure Detection Setting
85
85
@@ -122,7 +122,7 @@ See [here](PluginPipelinePerformanceResults.md#enhanced-failure-monitoring-perfo
122
122
123
123
#### Read-Write Splitting and Internal Connection Pooling Performance Tests
124
124
125
-
The diagram in this section shows the AWS NodeJS Wrapper's performance when using the read-write splitting plugin, with or without connection pooling enabled. This test sets up a large number of connections in parallel; the initial connection is to the writer but will be changed to a random reader instance. The test executes a long query many times to simulate heavy queries.
125
+
The diagram in this section shows the AWS Advanced NodeJS Wrapper's performance when using the read-write splitting plugin, with or without connection pooling enabled. This test sets up a large number of connections in parallel; the initial connection is to the writer but will be changed to a random reader instance. The test executes a long query many times to simulate heavy queries.
126
126
127
127
The average overhead time is measured as the average time difference between running the entire test with the read-write plugin and running the entire test without any plugins. The baseline overhead time is 0 because there are no plugins in this scenario and thus there is no plugin overhead.
128
128
@@ -133,7 +133,7 @@ See [here]() for a more detailed performance breakdown.
133
133
134
134
### Running the Tests
135
135
136
-
After building the AWS NodeJS Wrapper you can now run the unit tests.
136
+
After building the AWS Advanced NodeJS Wrapper you can now run the unit tests.
137
137
This will also validate your environment is set up correctly.
Copy file name to clipboardExpand all lines: docs/using-the-nodejs-wrapper/UsingTheNodejsWrapper.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,15 @@ These parameters are applicable to any instance of the AWS Advanced NodeJS Wrapp
52
52
| `clusterInstanceHostPattern` | `string` | If connecting using an IP address or custom domain URL: Yes<br><br>Otherwise: No | This parameter is not required unless connecting to an AWS RDS cluster via an IP address or custom domain URL. In those cases, this parameter specifies the cluster instance DNS pattern that will be used to build a complete instance endpoint. A "?" character in this pattern should be used as a placeholder for the DB instance identifiers of the instances in the cluster. See [here](#host-pattern) for more information. <br/><br/>Example: `?.my-domain.com`, `any-subdomain.?.my-domain.com`<br/><br/>Use case Example: If your cluster instance endpoints follow this pattern:`instanceIdentifier1.customHost`, `instanceIdentifier2.customHost`, etc. and you want your initial connection to be to `customHost:1234`, then your client configuration should look like this: `{ host: "customHost", port: 1234, database: "test", clusterInstanceHostPattern: "?.customHost" }` | If the provided host is not an IP address or custom domain, the NodeJS Wrapper will automatically acquire the cluster instance host pattern from the customer-provided host. |
53
53
| `mysqlQueryTimeout` | `number` | No | Query timeout in milliseconds. This is only applicable when using the AwsMySQLClient. To set query timeout for the AwsPGClient, please use the built-in `query_timeout` parameter. See the `node-postgres` [documentation](https://node-postgres.com/apis/client) for more details.. | 20000 |
54
54
55
+
## Host Pattern
56
+
57
+
When connecting to Aurora clusters, the [`clusterInstanceHostPattern`](#aws-advanced-nodejs-wrapper-parameters) parameter is required if the host does not provide enough information about the database cluster domain name.
58
+
If the Aurora cluster endpoint is used directly, the AWS Advanced NodeJS Wrapper will recognize the standard Aurora domain name and can re-build a proper Aurora instance name when needed.
59
+
In cases where the host is an IP address, a custom domain name, or localhost, the wrapper won't know how to build a proper domain name for a database instance endpoint.
60
+
For example, if a custom domain was being used and the cluster instance endpoints followed a pattern of `instanceIdentifier1.customHost`, `instanceIdentifier2.customHost`, etc., the wrapper would need to know how to construct the instance endpoints using the specified custom domain.
61
+
Since there isn't enough information from the custom domain alone to create the instance endpoints, you should set the `clusterInstanceHostPattern` to `?.customHost`, making the client configuration `{ host: "customHost", port: 1234, database: "test", clusterInstanceHostPattern: "?.customHost" }`.
62
+
Refer to [this diagram](../images/failover_behavior.png) about AWS Advanced NodeJS Wrapper behavior for different connection URLs and more details and examples.
63
+
55
64
## Plugins
56
65
57
66
The AWS Advanced NodeJS Wrapper uses plugins to execute methods. You can think of a plugin as an extensible code module that adds extra logic around any database method calls. The AWS Advanced NodeJS Wrapper has a number of [built-in plugins](#list-of-available-plugins) available for use.
0 commit comments