Skip to content

Update Documentation to Reflect GatewayD’s Support for Multiple Proxies and Configuration Blocks #61

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

7 changes: 6 additions & 1 deletion miscellaneous/glossary.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-05-31 20:16:38
last_modified_date: 2024-07-30 16:55:16
layout: default
title: Glossary
description: Glossary of GatewayD terms
Expand Down Expand Up @@ -28,6 +28,11 @@ Each configuration file contains multiple configuration objects that correspond

To enable multi-tenancy, GatewayD supports configuring multiple instances of each (configuration) object using configuration groups. All the default configuration objects have a single configuration group called `default`, except the `API`.

## Configuration block
Within each configuration group, GatewayD allows for further segmentation of settings through the use of configuration blocks. A configuration block represents a specific set of parameters within a configuration group, tailored to a particular instance.

Configuration blocks are supported for the following configuration objects: `clients`, `pools` and `proxies`.

## Configuration parameter

A configuration object has one or many configuration parameters to set up the corresponding object. For example, the `output` parameter on the `logger` object is used to set the outputs by the `default` (configuration group) logger.
Expand Down
40 changes: 23 additions & 17 deletions using-gatewayd/configuration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-05-31 20:16:38
last_modified_date: 2024-07-30 16:36:53
layout: default
title: Configuration
description: GatewayD is fully configurable via various sources, including default values, YAML config files, environment variables, CLI flags and plugins.
Expand Down Expand Up @@ -74,28 +74,31 @@ metrics:

clients:
default:
network: tcp
address: localhost:5432
tcpKeepAlive: False
tcpKeepAlivePeriod: 30s # duration
receiveChunkSize: 8192
receiveDeadline: 0s # duration, 0ms/0s means no deadline
receiveTimeout: 0s # duration, 0ms/0s means no timeout
sendDeadline: 0s # duration, 0ms/0s means no deadline
dialTimeout: 60s # duration, 0ms/0s means no timeout
# Retry configuration
retries: 3 # 0 means no retry
backoff: 1s # duration
backoffMultiplier: 2.0 # 0 means no backoff
disableBackoffCaps: false
activeWrites: # ⬅️ Configuration block
network: tcp
address: localhost:5432
tcpKeepAlive: False
tcpKeepAlivePeriod: 30s # duration
receiveChunkSize: 8192
receiveDeadline: 0s # duration, 0ms/0s means no deadline
receiveTimeout: 0s # duration, 0ms/0s means no timeout
sendDeadline: 0s # duration, 0ms/0s means no deadline
dialTimeout: 60s # duration, 0ms/0s means no timeout
# Retry configuration
retries: 3 # 0 means no retry
backoff: 1s # duration
backoffMultiplier: 2.0 # 0 means no backoff
disableBackoffCaps: false

pools:
default:
size: 10
activeWrites:
size: 10

proxies:
default:
healthCheckPeriod: 60s # duration
activeWrites:
healthCheckPeriod: 60s # duration

servers:
default:
Expand All @@ -107,6 +110,9 @@ servers:
certFile: ""
keyFile: ""
handshakeTimeout: 5s # duration
loadBalancer:
# Load balancer strategies can be found in config/constants.go
strategy: ROUND_ROBIN

api:
enabled: True
Expand Down
33 changes: 17 additions & 16 deletions using-gatewayd/global-configuration/clients.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-05-31 20:16:38
last_modified_date: 2024-07-29 17:35:18
layout: default
title: Clients
description: GatewayD client configuration
Expand All @@ -10,7 +10,7 @@ grand_parent: Using GatewayD

# Clients

GatewayD supports multiple client configurations. Each client in each configuration group will connect to the same database server specified in the configuration parameters and will be added to its corresponding [pool](pools) based on their configuration group, i.e. `default`.
GatewayD supports multiple client configurations. Each client within a configuration group will connect to a database server specified in the configuration parameters and will be added to its corresponding [pool](pools) based on their configuration group (e.g., `default`) and configuration block (e.g., `activeWrites`).

## Configuration parameters

Expand All @@ -33,18 +33,19 @@ GatewayD supports multiple client configurations. Each client in each configurat
```yaml
clients:
default:
network: tcp
address: localhost:5432
tcpKeepAlive: False
tcpKeepAlivePeriod: 30s # duration
receiveChunkSize: 8192
receiveDeadline: 0s # duration, 0ms/0s means no deadline
receiveTimeout: 0s # duration, 0ms/0s means no timeout
sendDeadline: 0s # duration, 0ms/0s means no deadline
dialTimeout: 60s # duration, 0ms/0s means no timeout
# Retry configuration
retries: 3 # 0 means no retry
backoff: 1s # duration
backoffMultiplier: 2.0 # 0 means no backoff
disableBackoffCaps: false
activeWrites:
network: tcp
address: localhost:5432
tcpKeepAlive: False
tcpKeepAlivePeriod: 30s # duration
receiveChunkSize: 8192
receiveDeadline: 0s # duration, 0ms/0s means no deadline
receiveTimeout: 0s # duration, 0ms/0s means no timeout
sendDeadline: 0s # duration, 0ms/0s means no deadline
dialTimeout: 60s # duration, 0ms/0s means no timeout
# Retry configuration
retries: 3 # 0 means no retry
backoff: 1s # duration
backoffMultiplier: 2.0 # 0 means no backoff
disableBackoffCaps: false
```
5 changes: 3 additions & 2 deletions using-gatewayd/global-configuration/pools.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-05-31 20:16:38
last_modified_date: 2024-07-29 17:37:00
layout: default
title: Pools
description: GatewayD pool configuration
Expand All @@ -23,5 +23,6 @@ The size of the pool defines the maximum capacity of the pool. Upon start, Gatew
```yaml
pools:
default:
size: 10
activeWrites:
size: 10
```
9 changes: 5 additions & 4 deletions using-gatewayd/global-configuration/proxies.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-05-31 20:16:38
last_modified_date: 2024-07-30 16:34:34
layout: default
title: Proxies
description: GatewayD proxy configuration
Expand All @@ -12,7 +12,7 @@ grand_parent: Using GatewayD

The proxy object is used to proxy connections between database clients and servers.

GatewayD supports a fixed proxy that creates a pool with a fixed number of connection to the database server. It honors the pool capacity, and if the number of connections from the clients is more than the capacity, new connections will be rejected.
GatewayD supports multiple proxies, each creating its own pool of connections to the database server. Each proxy pool honors its capacity, and if the number of connections from the clients exceeds the capacity, new connections will be rejected.

The PostgreSQL database expects new connections to authenticate before keeping them connected forever, thus the TCP connections from GatewayD will be timed out and dropped. A health check scheduler is started when creating connections to the database. If there are connections available in the available connections pool after the `healthCheckPeriod` is reached, it will remove and recreate new TCP connections to the database and put them in the pool.

Expand All @@ -32,5 +32,6 @@ Each proxy has two pools:
```yaml
proxies:
default:
healthCheckPeriod: 60s # duration
```
activeWrites:
healthCheckPeriod: 60s # duration
```
28 changes: 17 additions & 11 deletions using-gatewayd/global-configuration/servers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-05-31 20:16:38
last_modified_date: 2024-07-30 16:45:29
layout: default
title: Servers
description: GatewayD server configuration
Expand All @@ -14,16 +14,19 @@ The server object runs to listen for incoming connections from database clients.

## Configuration parameters

| Name | Type | Default value | Possible values | Description |
| ---------------- | ------- | ------------- | --------------- | ----------------------------------- |
| network | string | tcp | tcp, unix | The network protocol to use |
| address | string | 0.0.0.0:15432 | Valid host:port | The address to listen on |
| enableTicker | boolean | False | True, False | Whether to enable the ticker or not |
| tickInterval | string | 5s | Valid duration | The interval of the ticker |
| enableTLS | boolean | False | True, False | Whether to enable TLS or not |
| certFile | string | | Valid path | The path to the TLS certificate |
| keyFile | string | | Valid path | The path to the TLS key |
| handshakeTimeout | string | 5s | Valid duration | The timeout for TLS handshake |
| Name | Type | Default value | Possible values | Description |
| ---------------- | ------- | ------------- | --------------- | ------------------------------------------- |
| network | string | tcp | tcp, unix | The network protocol to use |
| address | string | 0.0.0.0:15432 | Valid host:port | The address to listen on |
| enableTicker | boolean | False | True, False | Whether to enable the ticker or not |
| tickInterval | string | 5s | Valid duration | The interval of the ticker |
| enableTLS | boolean | False | True, False | Whether to enable TLS or not |
| certFile | string | | Valid path | The path to the TLS certificate |
| keyFile | string | | Valid path | The path to the TLS key |
| handshakeTimeout | string | 5s | Valid duration | The timeout for TLS handshake |
| loadBalancer | object | | | Configuration for the load balancer |
| loadBalancer.strategy | string | ROUND_ROBIN | ROUND_ROBIN | The strategy used to distribute connections |


## Example configuration

Expand All @@ -38,4 +41,7 @@ servers:
certFile: ""
keyFile: ""
handshakeTimeout: 5s # duration
loadBalancer:
# Load balancer strategies can be found in config/constants.go
strategy: ROUND_ROBIN
```
Loading