The fediverse works by propagating statuses a set of standard protocols: https://en.wikipedia.org/wiki/OStatus https://en.wikipedia.org/wiki/ActivityPub
Typical Mastodon instances have one or more frontends (Ruby on Rails) backed by a PostgreSQL database (possibly replicated). Several cloud providers offer managed PostgreSQL instances which mitigate the SPOF of using an RDBMS backend.
Accounts of users are bound to the instance where they were created, but recently Mastodon added a data export function that could be used to move an account to a different instance. I doubt you'd retain your followers in this case.
Unboundling user identity from instances sounds like a difficult researh problem, given that users can upload considerable amounts of data.