generated from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 0
ADR 08 ‐ Questions Database Functioning
Pablo García-Ovies Pérez edited this page Apr 7, 2024
·
1 revision
- Proposed
- Accepted
- Superseded
We have to decide how the questions service is being implemented.
As we don't want questions to be repeated, we will implement the /question
route, removing the questions extracted from the DB. Besides, from now on, we will establish two thresholds:
- high threshold will establish the minimum amount of questions stored. Every time a question is requested, leaving the question count below that, it will asynchronously generate more questions.
- low threshold will establish a limit to the number of questions in the DB from which we will not delete the questions extracted. We will risk repeating some questions, but we'd rather assume that than completely emptying the collection.
- special case when 0 questions are available, in which we have to synchronously generate a pair of questions before keeping generating until we reach the high threshold asynchronously.
Everytime we have to generate questions we try to get above the high threshold leaving a little margin.
It would be great, in a future, to study weather we can generate questions whenever the service is inactive or not getting a lot of requests.
-
Benefits:
- Never lacking questions: As we will never remove the last questions, the requests will always be satisfied.
- Lower response time: Requests do not require a Wikidata query to be performed, so the service will be much faster.
- Low probability of repetition: As we are leaving a margin between the amount of questions at which we generate more and the amount at which we stop deleting, there will only be a low probability of repeating the same question for the same user in cases of high demand for questions.
-
Trade-offs:
- Not keeping track of all the questions done: As we delete the questions, we will not be able to establish any tracking of them.
- Probability of repetition: It is low, yes, but it still exists.
We will implement and test the service functioning this way.