feat(database): Implement read replicas for database

This commit is contained in:
Jesse Wierzbinski 2024-08-26 18:04:22 +02:00
parent c75306c58b
commit bc0943c569
No known key found for this signature in database
4 changed files with 106 additions and 19 deletions

View file

@ -10,6 +10,14 @@ username = "versia"
password = "mycoolpassword"
database = "versia"
# Add any eventual read-only database replicas here
# [[database.replicas]]
# host = "other-host"
# port = 5432
# username = "versia"
# password = "mycoolpassword2"
# database = "replica1"
[redis.queue]
# Redis instance for storing the federation queue
# Required for federation

View file

@ -27,6 +27,39 @@
"type": "string",
"minLength": 1,
"default": "versia"
},
"replicas": {
"type": "array",
"items": {
"type": "object",
"properties": {
"host": {
"type": "string",
"minLength": 1
},
"port": {
"type": "integer",
"minimum": 1,
"maximum": 65535,
"default": 5432
},
"username": {
"type": "string",
"minLength": 1
},
"password": {
"type": "string",
"default": ""
},
"database": {
"type": "string",
"minLength": 1,
"default": "versia"
}
},
"required": ["host", "username"],
"additionalProperties": false
}
}
},
"required": ["username"],