matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.83k stars 2.13k forks source link

Give the Rust portion of Synapse access to the database #16501

Open reivilibre opened 1 year ago

reivilibre commented 1 year ago

Eventually it seems like we will want to get the Rust parts of Synapse some access to the database so we can offload some of the expensive processing (including state resolution) to Rust, sidestepping the GIL and likely improving performance generally.

This is not exactly trivial.

Option 1: expose existing connections to Rust (i.e. Rust calls Python)

Good:

Bad:

Option 2: move database machinery into Rust and have Python call Rust

Good:

Bad:

Option 3: maintain connections in both languages

Good:

Bad:

Any others?