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

Evaluate backend stack for Community Features #330

Closed
Tracked by #289
dennyabrain opened this issue Aug 18, 2023 · 3 comments
Closed
Tracked by #289

Evaluate backend stack for Community Features #330

dennyabrain opened this issue Aug 18, 2023 · 3 comments
Assignees
Labels
level: ticket: spike Timeboxed exploratory tasks with a clearly defined outcome role:backend spike:3day stale track: P2 Product track: tool for abuse collection

Comments

@dennyabrain
Copy link
Contributor

dennyabrain commented Aug 18, 2023

This is a spike to evaluate two possible backend tech stacks for this feature :

  1. Sequelize : This is an ORM for SQL databases. Its already a part of the api-server codebase.
  2. Pocketbase : This is a fairly new software but I see potential for use at tattle for initial prototypes that is easy to manage (infrastructure wise) and cheap.

This ticket entails creating backend REST API servers using both these tools.

Here's the wip schema to be implemented as part of this exercise. This is not the final lexicon. Its only for evaluation purpose. Expect this to change eventually

field type values
label string
category multiple choice gender,religion,caste,sexual orientation,ethnicity,regional,political affiliation, others
meaning string
appropriated boolean true,false
appropriation_context string

You can find some sample entries for this schema to work with here

The expected outcome of this spike is to have two working api servers and showcase it to the team. You will also be expected to explain the pain points and good features of each and make recommendations for #316

@dennyabrain dennyabrain added level: ticket: spike Timeboxed exploratory tasks with a clearly defined outcome spike:3day track: P2 Product track: tool for abuse collection labels Aug 18, 2023
@dennyabrain
Copy link
Contributor Author

This is now being re-evaluates as a spike:4day

@aatmanvaidya
Copy link
Collaborator

aatmanvaidya commented Aug 26, 2023

My thoughts and suggestions: -

PocketBase

PRO's

  1. Easy to use, no backend, essentially. Code can be written in frontend -> All the backend + database can be run with a single command.
  2. Single line of code for CRUD API calls. API calls are also shown in the pocketbase interface.
  3. Inbuilt user authentication, file storage, and has an admin dashboard.
  4. Supports docker deployment. (1, 2, 3)

CON's

  1. It may not be suitable for complex or custom use cases that require more than CRUD. (I know that's not our need, but just listing it down). For instance, we might not be able to do complex database queries as well (certain joins, relations etc).
  2. I think it doesn't have a large community or documentation as compared to other popular backend frameworks.

Sequelize

PRO's

  1. Uli already uses Sequelize
  2. More flexible and customizable than pocketbase. Can you any SQL database (mySQL, postgres etc), while pocketbase just uses SQL Lite.
  3. We can define our own models, associations, validations, scopes, hooks, etc. We can also write raw SQL queries if needed.

CON's

  1. Code has to be written for everything -> models, migrations, queries, etc.
  2. It may not have some features that PocketBase offers out of the box, such as authentication, file storage etc, other libraries are needed for this.

If we want to use sequelize and mySQL for the slur crowdsourcing feature. Based on the data description, here is a sample database diagram that could be followed.

We can have two tables SLUR and CATEGORIES, to store respective data. There will be a many-to-many relationship between both these tables.


database

My Suggestion

I have not thoroughly explored and understood the backend code for Uli (api-server). Keeping that in mind, here is my suggestion.

It would make sense to use Sequelize as the entire backend is already written using that. The crowd-sourcing feature would be easy to integrate as we just have to enable CRUD operations. As pocket base would be an extra installation (even inside docker), leading to more dependencies.

If we want to add an authentication, too, and if we would need extra dependencies for Sequelize, then pocket base is the way to go!

Copy link

github-actions bot commented Dec 1, 2023

This issue is stale because it has been open for 30 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level: ticket: spike Timeboxed exploratory tasks with a clearly defined outcome role:backend spike:3day stale track: P2 Product track: tool for abuse collection
Projects
No open projects
Status: Done
Status: Done
Development

No branches or pull requests

2 participants