From 51ec7c355d6c3137ba0197ce6f54d941ada93f5d Mon Sep 17 00:00:00 2001 From: clokep Date: Tue, 17 Oct 2023 15:57:19 +0000 Subject: deploy: 6e6d611f555245a8302396936dd4dae1f28e3b2a --- v1.95/replication.html | 217 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 v1.95/replication.html (limited to 'v1.95/replication.html') diff --git a/v1.95/replication.html b/v1.95/replication.html new file mode 100644 index 0000000000..a271ecaa45 --- /dev/null +++ b/v1.95/replication.html @@ -0,0 +1,217 @@ + + + + + + Replication - Synapse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+ +
+ +
+ +

Replication Architecture

+

Motivation

+

We'd like to be able to split some of the work that synapse does into +multiple python processes. In theory multiple synapse processes could +share a single postgresql database and we'd scale up by running more +synapse processes. However much of synapse assumes that only one process +is interacting with the database, both for assigning unique identifiers +when inserting into tables, notifying components about new updates, and +for invalidating its caches.

+

So running multiple copies of the current code isn't an option. One way +to run multiple processes would be to have a single writer process and +multiple reader processes connected to the same database. In order to do +this we'd need a way for the reader process to invalidate its in-memory +caches when an update happens on the writer. One way to do this is for +the writer to present an append-only log of updates which the readers +can consume to invalidate their caches and to push updates to listening +clients or pushers.

+

Synapse already stores much of its data as an append-only log so that it +can correctly respond to /sync requests so the amount of code changes +needed to expose the append-only log to the readers should be fairly +minimal.

+

Architecture

+

The Replication Protocol

+

See the TCP replication documentation.

+

The TCP Replication Module

+

Information about how the tcp replication module is structured, including how +the classes interact, can be found in +synapse/replication/tcp/__init__.py

+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + \ No newline at end of file -- cgit 1.5.1