-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementation of Postgres PollDataDAO with read and write caching
- Loading branch information
Showing
9 changed files
with
668 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# PostgreSQL | ||
|
||
By default conductor runs with an in-memory Redis mock. However, you | ||
can run Conductor against PostgreSQL which provides workflow management, queues and indexing. | ||
There are a number of configuration options that enable you to use more or less of PostgreSQL functionality for your needs. | ||
It has the benefit of requiring fewer moving parts for the infrastructure, but does not scale as well to handle high volumes of workflows. | ||
You should benchmark Conductor with Postgres against your specific workload to be sure. | ||
|
||
|
||
## Configuration | ||
|
||
To enable the basic use of PostgreSQL to manage workflow metadata, set the following property: | ||
|
||
```properties | ||
conductor.db.type=postgres | ||
spring.datasource.url=jdbc:postgresql://postgres:5432/conductor | ||
spring.datasource.username=conductor | ||
spring.datasource.password=password | ||
``` | ||
|
||
To also use PostgreSQL for queues, you can set: | ||
|
||
```properties | ||
conductor.queue.type=postgres | ||
``` | ||
|
||
You can also use PostgreSQL to index workflows, configure this as follows: | ||
|
||
```properties | ||
conductor.indexing.enabled=true | ||
conductor.indexing.type=postgres | ||
conductor.elasticsearch.version=0 | ||
``` | ||
|
||
By default, Conductor writes the latest poll for tasks to the database so that it can be used to determine which tasks and domains are active. This creates a lot of database traffic. | ||
To avoid some of this traffic you can configure the PollDataDAO with a write buffer so that it only flushes every x seconds: | ||
|
||
```properties | ||
# Flush the data every 5 seconds | ||
conductor.postgres.pollDataFlushInterval=5 | ||
``` | ||
|
||
You can also configure a duration when the cached poll data will be considered stale. This means that the PollDataDAO will try to use the cached data, but if it is older than the configured period, it will check against the database. | ||
|
||
```properties | ||
# Data older than 5 seconds is considered stale | ||
conductor.postgres.pollDataCacheValidityPeriod=5 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.