Real-Dev-Squad / todo-action-items

A running list of todo items for Real Dev Squad site
MIT License
4 stars 9 forks source link

Discord Service Implementation #235

Open joyguptaa opened 5 months ago

joyguptaa commented 5 months ago

Parent Issue

References

Issue Description

This issue focuses on how we are approaching to implement the Discord service without affecting the current user flow and features. So, we will discuss everything from development to releasing & rollback strategies.

Tech Stack

  1. Coding Language: GoLang
  2. Queue: RabbitMQ
  3. Containerisation: Docker Image
  4. Deployment : ECS (Not Sure)

Developement

The Discord service is going to be developed in Golang. The idea is to divide the entire service into 2 parts, which are listed below.

  1. A service that accepts requests from the outside world and then acts as a queue producer. It will be responsible for inserting tasks into the queue along with all the data required for consumption.
  2. A consumer must be there which should keep on looking tasks from the queue and should work independently with the server as it only interacts with the queue.

Must Have

Name Estimation (in hours)
Figure out max threshold of queue 3
List down all the tasks that currently discord-slash-command handles 4
Define Priority for each Task 2
Figure out how are we going to communicate among different services 4
List down API rate limits, globally and route specific 6
List out ways we can send alerts, if queue goes down, as discord bot has vast dependency 6
Design Doc for Implementation 6
Figure out release strategy 2
Also tackle and mention roll back strategy 4
Connect with @prakashchoudhary07 regarding deployment strategy 4
Actual Implementation 40
Total 81

Phase 1

Phase 2 : 24 Sept

Phase 3 : 6 - 10 Oct

Good to have

  1. Figure out why the order of messages gets changed Screenshot 2024-06-12 at 11 07 39 PM

Current Behavior

Currently, we are not managing API rate limits globally. As a result, our system may fail at any time, for example, if it takes on 2 tasks simultaneously. Therefore, as an end user, I need to ensure that the next set of tasks is delayed.

Expected Behavior

Expecting API rate limits to be implemented globally. Failure to do so may result in system failure, particularly if it handles multiple tasks simultaneously. Therefore, as an end user, I should not worry about API rate limits, our system should be smart enough to handle it on its own. Also it should always prioritise tasks with high priority over low priority tasks.

Severity/Priority

Checklist

tejaskh3 commented 2 months ago

I have gone through this issue, just want to clarify, will we deprecate discord-slash-commands after creating this?

joyguptaa commented 2 months ago

I have gone through this issue; I just want to clarify: Will we deprecate discord-slash-commands after creating this?

No, discord-slash-command is going there as we need some service to let our bot interact with. It is just instead of other services (CRON, website-backend) telling discord-service what to do we will have a single service telling discord service what to do and when to do it (by making sure of API rate limiting)

joyguptaa commented 1 month ago

Doc Links :