Then, whenever the state of the chatroom changes (e.g. you join it, or someone else joins it), each server has to resolve its view of the state of the room with the proposed change. We call this merge conflict resolution algorithm 'state resolution', and it's typically where the heaviness comes from, as a naive implementation loads up all the state events for the room in order to calculate and store the new state.
In exchange, you get fully decentralised access control, and an eventually consistent zero-trust distributed key-value store, with resilience to network partitions (including in P2P environments) - unlike (say) vanilla XMPP which applies access control and KV on a single given server per-conversation.
Now, the key thing is that *there is nothing in the protocol which makes this intrinsically heavy to implement*. The only reason that servers can be heavyweight today is simply because more time has been invested in chasing down more pressing issues like encryption issues, investing in client SDKs, speeding up sync responses, switching to OIDC for auth, etc.
The problem is made worse by the fact that Synapse (the original Python server) has historically been particularly clunky, skewing perception. Over the last few years this has improved significantly, although it could still be way better - at the Matrix Conference last month (https://youtu.be/kdEDxI2MCjA?list=PLFDUAtPqCX98&t=329) we showed off a fork which had improved CPU 10x by shifting the hot path entirely to Rust from Python. (It turns out that over 2026, we wrote as much Rust for Synapse as we did Python, ignoring tests). Further improvements would be to memoize the state res and calculate it incrementally rather than starting from scratch every time. Similarly, there are 100x improvements to be had on storage usage - e.g. by storing state temporally (c.f. my https://docs.google.com/presentation/d/1pKtLl4vCV3-8xz8crvxW... spike from last year).
So, why haven't these improvements landed yet? In practice, the team at Element who builds Synapse have had to focus on customer-driven work instead in order to keep the lights on, and frustratingly performance is lower down the todo list than other feature-work. On the plus side, over the last year or so Element has got into a much healthier state - hence us being able to show off the 10x improvements in Synapse last month (although they still need to land).
Meanwhile, elsewhere in Matrix there are other servers which are more actively focused on being lightweight right now (e.g. continuwuity), but don't have the maturity of Synapse (or the commercially supported distribution that Element provides). And even then, there's still a lot of headroom for speeding up and shrinking things - it should be very very doable to run Matrix on a tiny host like an RPi.
It's not a perfect analogy but I think of it as being similar to the evolution of DVCS systems. There's nothing intrinsically heavy or hard about replicating DAGs of source code between hosts, but Monotone was pretty slow and clunky while Git showed that a smarter implementation could be more than performant enough. The race is on to build the equivalent for Matrix.