There is no such thing as decentralized messaging on iOS for this reason.
The matrix developers run a push service, which all servers have to talk to to push notifications to their iOS app, even if you run your own instance.
[ EDIT: The following statement is false! Changes in APNS have rendered my previous understanding out of date. ] This means that both the push server operator, as well as Apple, can see the content of all of the push notification messages, thereby bypassing the e2e encryption as well.
This isn't really true: there are lots of Matrix iOS clients out there, and each run their own separate push server. Only Element iOS's push server is run by the 'matrix developers', and if you are worried about that then (if you are an iOS developer) you can build your own copy of Element iOS pointed at your own push server.
> This means that both the push server operator, as well as Apple, can see the content of all of the push notification messages, thereby bypassing the e2e encryption as well.
This is completely incorrect. By definition, the server can't see the contents of end-to-end encrypted messages, and we don't send push contents (encrypted or otherwise) to the push gateway anyway. Instead, the push notification is a single flag sent to the client to tell it to wake up, which then runs a Push Extension (on iOS) to talk to the Matrix server and do E2EE in order to display the notification body (if desired). It's become particularly painful since iOS 13 thanks to https://appleinsider.com/articles/19/09/05/secure-messaging-....
As a longish time Matrix user I've never experienced scalability issues due to federation. The federation actually works pretty well. Scalability from Matrix comes/came due to the fact that some servers were too popular. Though that is actively being worked on: https://matrix.org/blog/2020/11/03/how-we-fixed-synapses-sca...
Recommended specs will include 16GB RAM only for synapse, SSD storage, etc.
If someone wants to self-host, start with Prosody and XMPP, not with Matrix.
What? If you want a server for 200+ users, yes maybe. But 2GB of RAM is plenty for hosting a few active users federating in large chats.
If you do want to set up your own server I wrote a guide when I learned how to do it with Google cloud instances: https://munfred.com/matrix
Also easy to self-host a server, if you need full control:
$ mkdir -p ~/synapse
$ pip3.6 install --user jinja2 matrix-synapse
$ cd ~/synapse
$ python3.6 -m synapse.app.homeserver \ --server-name my.domain.name \ --config-path homeserver.yaml \ --generate-config \ --report-stats=no