Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust rewrite #67

Open
Douile opened this issue Jul 6, 2023 · 0 comments
Open

Rust rewrite #67

Douile opened this issue Jul 6, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request rust Pull requests that update Rust code
Milestone

Comments

@Douile
Copy link
Member

Douile commented Jul 6, 2023

Rewrite entire bot in rust using the serenity library for much improved resource efficiency.

This will involve some re-architecture.

  • The bot client will no longer connect to the scheduler: status updates now exclusively use HTTP API endpoints meaning they do not need an active gateway connection.
    • A seperate updater program will run that connects to scheduler and just sends updates
    • This program will be built with sharding in mind, hence need to add way to easily distribute bot configuration between them (rewrite scheduler protocol)
    • Possibly swap out JSON for more efficient machine parsable format
    • Possibly add TLS support for scheduler
    • This depends on https://github.com/gamedig/rust-gamedig to be ready (it mostly is)
  • Bot client will be reduced to most basic functionality: recieve slash command, update database, generate message.
    • Database updates will be optimised by creating specific queries for each specific use case instead of updating each status as its own unit.
    • Hopefully take advantage of new discord features like buttons and modals
  • Database changes
    • db is central point of reference for all components therefore it might be the best place to store the bot configuration
    • statuses table could be optimised, better indexes, remove data for functionality thats not really used
      • player change list (stores entire response json)
      • last server title (stores entire response json)
    • if changing database schema should add unit tests to confirm that migration will work

Other tasks

  • create a component diagram of this architecture
  • get docs up to scratch, especially for slash commands as regular commands are being removed
  • support internationalization out the gate
  • performance metrics so benefit of rewrite can be measured
@Douile Douile added enhancement New feature or request rust Pull requests that update Rust code labels Jul 6, 2023
@Douile Douile added this to the Version 3.0 milestone Jul 6, 2023
@Douile Douile self-assigned this Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rust Pull requests that update Rust code
Projects
None yet
Development

No branches or pull requests

1 participant