As of #2, support was added for archiving text channels instead of needing to move them to the Archive category on the Discord. The system currently dumps messages into a text file and uploads it, which has some downsides
- The requests to fetch all messages in the channel take a very long time e.g. (archiving #developer-chat, which has ~110,000 messages, would take maybe 20 minutes).
- There's no way to make snapshots of channels, or take a data range slice without having to redo all the queries.
I propose we mirror Discord's database by simply storing messages received through the gateway in their raw form in PostgreSQL. This would allow us to compute the above things on the fly, making response times a lot snappier.
We can use either TypeORM or Objection.JS - the former is designed to work with TS, so is probably better given our environment.
As of #2, support was added for archiving text channels instead of needing to move them to the
Archivecategory on the Discord. The system currently dumps messages into a text file and uploads it, which has some downsidesI propose we mirror Discord's database by simply storing messages received through the gateway in their raw form in PostgreSQL. This would allow us to compute the above things on the fly, making response times a lot snappier.
We can use either TypeORM or Objection.JS - the former is designed to work with TS, so is probably better given our environment.