-
Notifications
You must be signed in to change notification settings - Fork 6
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
Show the number of incomplete task in the project's list #9
Comments
What's the best way to implement this? I understand OpenTask is very simple and doesn't need advanced or optimized solutions, but the goal of the project itself is to discuss and learn good ways to solve problems, not just solve the problems in any possible way. Currently, we only have to query the Option A: We could query the Upside: Simple to implement, and we don't need to worry about data mutations (creating or deleting tasks, completing tasks, reverting completed tasks to incomplete, etc) as we'd always fetch a fresh list of projects and tasks to render the number of incomplete tasks. Downside: Not optimized. We need to query the Option B: We keep an updated Upside: Very optimized to query data. Even though we'd need to query the Downside: Complex to implement at the app level. We need to keep Implementing it as a Postgres function/stored procedure would probably be simpler, but I avoid them as much as possible. I believe we must keep all business logic in the application and only resort to any other way, like SPs, when we absolutely have to. Of the two options above, I prefer Option A. Do you know a simple alternative? Please share it with us. |
In my opinion if we couldn't have have the value calculated in database as triggrer or procedure should be the best in terms of performance. But my first approach would be "Option A" but not querying
|
Discussed in #8
Originally posted by p4bl1t0 January 26, 2024
In a first sprint could be something like this:
The text was updated successfully, but these errors were encountered: