Matrix - The Decentralized Alternative to Discord
Tags: programming, productivity, web3, webdev
Published: 2023-05-06 16:57:02

## Why is Everyone Looking to Replace Discord?
Discord originally started out as a free alternative to Skype, TeamSpeak and other notable apps, and over the years has pioneered most of expected features for real time communication. However, now that the expectations have been mostly established, Discord is starting to implement more bloat for its premium users, and making decisions more inline with the shareholder's demands vs the user's demands.


![discord logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cg120rivakelvs20orkq.png)


As of recently, a large chunk of the Discord community is upset because usernames will behave more like Twitter handles in that the usernames must be unique. https://discord.com/blog/usernames

Generally, people are growing tired of sites with unique usernames because they have to manage too many accounts.  There is no guarantee that your username will be available on another platform. Sharing your username becomes somewhat of a burden because you have to look it up.

## Why Email Will Not Go Away
The full conversation of what makes social platforms go mainstream is the ability to share and connect with essentially anyone on the fly.  Email has a core feature which many social platforms disregard. That feature is domains!

There are too many people named John, Sally, Mike, and Sue.  With email, this problem is mitigated through domain specific email addresses. If you need to contact John from accounting, you might see an email like `John@accounting.acme.com`

Yet on social platforms like Twitter and Instagram, the name is essentially in a global domain. So you are trying to create a name that is unique across BILLIONS of accounts! 

## What is Matrix?
Matrix tries to fix the name collision problem that is present on modern social platforms. Rather than hosting the platform on a single server, Matrix defines a set of protocols which must be implemented by social platform clients.


![matrix logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v2elouvml2a4u1tgcn50.png)



This low level design allows any business to host a server like they would with email. There is free account hosting through `Matrix.org` and `Mozilla.org`, but there is nothing stopping you from hosting your account on `Acme.com`

When you create a Matrix account via free hosting or through a custom server you can interact with the rest of the world just like email (privately or publicly). You can easily add `@john:matrix.org` or `@john:mozilla.org` or `@john:acme.com`. Then we can all chat using IM or VOIP under the same "room", encrypted, decrypted, publicly, or privately. It does not matter what domain you are apart of or what client you use.

## How to Approach Matrix as a Consumer
Again think of Matrix more of like modern email rather than Discord. When you check your email, you use an email client. You can use the built in client on your phone, use a web based client like Gmail, or download a dedicated app like Outlook or Thunderbird.

So when your friends want to use Matrix as a communication platform, it does not matter what app you use. You can download any app you want, all you need is their identifier like `@john:acme.com`. 

In the future we may end up asking, "What is your matrix?" vs "What is your email?"

## Immediate Pitfalls
Since Matrix is a standard for RealTime communication, it is up to the client to implement features. The creators of the client choose what is hot and what is not. For example, some clients do not implement VOIP, some do not provide mobile apps, some are purely text based, etc.


![cinny.in ui](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o26q1v7i1nlgvs641per.png)



When you think about it like email, client's with lacking features is not a big problem, and more of a competitive advantage. People like Outlook and Gmail for all their bells and whistles, but some people like and will purchase something with less features.


![Matrix client comparison](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cg43tmzw9erj8b0o77kj.png)

## Programming a client from scratch
It is up to developers to bring better features and user experience to matrix. Matrix provides an SDK for interacting with the network protocols. 

Currently there are SDKs written in JavaScript, Rust, Go, Python, Java, C++, and other popular languages. 

Since the underlying protocols are network based, any language should suffice.

## Building a server from scratch
Like implementing a client, the server is just a series of protocols that dispatch data to the client. In theory you can write your own server from scratch as long as the correct protocol is followed. 

For developers looking to flush out a quick server for their business or domain, then you should look into Synapse which is the official Library for routing Matrix protocols.

Currently packages are available through Debian, but they also provide a neatly wrapped Docker container for "one-click" installs.

## Opinion
Matrix seems to be the future for real time communication. As people begin to adopt Matrix like they adopted POP3, IMAP, and SMTP. Less of our communication will depend on the stability of C-suite decision making, and playing field is leveled for businesses looking to deploy RealTime communication platforms.

## Conclusion
I'm looking forward to seeing more of Matrix but I am a little skeptical about people adopting it as a new technology in the near future. I hope that I am wrong and that Matrix becomes the technology that finally replaces email.