Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

[API] Create database model #3

Closed
RubenFern opened this issue Jan 30, 2024 · 3 comments
Closed

[API] Create database model #3

RubenFern opened this issue Jan 30, 2024 · 3 comments
Labels
API This issue is related to the API of the WebApp Backend Related to backend Invalid This issue is no longer valid, most likely outdated or duplicated

Comments

@RubenFern
Copy link
Contributor

Modelos iniciales:

Question - Información de cada pregunta
AuthUser - Información de registro de usuario
User - Estadísticas del jugador
Play - Registro de partidas jugadas por el usuario
Setting - Ajustes de la aplicación, tiempo para responder las preguntas, cantidad de preguntas, scope (ej. Ciudades de Europa, España…)
Follow - Poder agregar a otros usuarios
Group - Los usuarios se agregan a grupos

@Manueluz Manueluz added the Backend Related to backend label Jan 31, 2024
@Manueluz Manueluz changed the title Crear los modelos de la base de datos [API] Create database model Feb 4, 2024
@Manueluz Manueluz added the API This issue is related to the API of the WebApp label Feb 4, 2024
@Manueluz
Copy link
Contributor

Manueluz commented Feb 4, 2024

Initial DB models

  • Question: Stores the data of each question
  • User: Stores the data of the user
  • UserConfig: Stores the configuration of the user
  • UserGame: Stores the data of the previus games of the player
  • FriendList: Stores the list of friends of each user
  • Group: Stores a list of users in the same group
  • InvalidToken: Stores all invalid tokens from de users

Select final database

We should select the final database (Is MongoDB necessary?) i think the two major DBs to consider are MariaDB(Quite familiar) and MongoDB.

I propose MariaDB because it is enough to create the proposed DB models (If it isnt broken dont fix it!) and im also taking into consideration the fact that we are familiar with SQL.

@Manueluz
Copy link
Contributor

Manueluz commented Feb 5, 2024

Final database

After a discussion with the team we`ve decided to use MariaDB as our main database, the main reasons for this choice are that we are not familiar enough with MongoDB and that using a NoSQL database would be overkill (The amount of data we plan on handling is nowhere near big enough to justify MongoDB usage) for the objectives of this application (+ we werent planning to use it in a cluster configuration, leaving one of the main selling points of MongoDB forgotten). Also we support consistency in the data over speed and MariaDB is the database that best suits our goal.

ORM

We are planning to use an Object Relational Mapper with MariaDB to obtain a simple and efficient workflow, the choosen ORM is Sequelize because it is a welll known ORM for NodeJS (So there are more tutorials).

Pros of using an ORM is that speficic databases are abstract to the programmer and that the model desing is as easy as defining a JS class. Main cons are the general performance overhead associated with ORMs and that the choosen ORM is mainly focused on TypeScript.

@Manueluz Manueluz added the Invalid This issue is no longer valid, most likely outdated or duplicated label Feb 20, 2024
@Manueluz
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API This issue is related to the API of the WebApp Backend Related to backend Invalid This issue is no longer valid, most likely outdated or duplicated
Projects
None yet
Development

No branches or pull requests

2 participants