Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Decision

Description

Problem/Issue

The passwords can be seen by anyone who has access to the database. This is a huge security risk.
DecisionUsing Argon2, we can hash the passwords of users, so that a hashed password is stored in the database. This prevents hackers from seeing someone elses password.
AlternativesSHA-512, MD5, PBKDF2, BCrypt, and SCrypt (Millington, 2022)
ArgumentsFrom an a comment in Baeldung (Millington, 2022), I saw Argon2 being suggested. Going to the Supertokens website (Supertokens Team, 2022), I found a tool that detects how safely a password is. With that Supertokens also recommended to use this hashing tool this march, which is quite recent. It uses more resources from your computer, but it makes a stronger password from it. Regterschot Racing required minimum security, that also includes a hashed password.

...

Tablenames and formats are written in italicColumns that contain the primary key are underlined. 

Table
Row
ColumnDatatypeNull / Not NullComments
DriverThis table is responsible for a driver's data. This can be expanded further with a date of birth, length, age or something else.
DriverIDintNot nullThis is a unique identifier for a driver, with which a driver can be tied to races and rounds.
DriverNamevarchar(255)Not nullThe name of the driver in the format lastname, firstname.
DriverRaces

This table links the driver to the driven rounds within a race.
RaceIDintNot nullThis is the unique identifier of the race.
DriverIDintNot nullThis is the unique identifier of the driver.
RoundIDintNot nullThis is the unique identifier of the round.
GraphsThis table contains all data that is required to show a graph. It contains the sensor it is displaying the data for, and the type of graph it is.
GraphIDintNot nullThis is the unique identifier of the graph.
Typevarchar(255)Not null

The type of graph, can be anything from the following:

  • linechart
  • barchart
  • piechart
  • scatterchart
  • columnchart
  • areachart
  • donutchart
  • table
  • gaugechart
SensorIDintNot nullThe unique identifier of the sensor that the graph is displaying the data of.
RaceThis table contains all information relevant to a race.
RaceIDintNot null

The unique identifier of the race.

NumberOfRoundsintNot nullThe number of rounds that the race encompasses.
RaceNamevarchar(255)Not nullThe name of the race.
RoundsThis table contains all information that is needed to define a round.
RoundsIDintNot nullThe unique identifier of the race.
RaceIDintNot nullThe unique identifier of the race that the round belongs to.
TimestampBeginDATETIMENot nullThe starting time of the round.
TimestampEndDATETIMENot nullThe ending time of the round.
SensorsThis table functions as collection of all sensors.
SensorIDintNot nullThe unique identifier of the sensor.
SensorNamevarchar(255)NullThe name of the sensor.
TabGraphsThis table couples all graphs to a specific tab.
TabIDintNot nullThe unique identifier of the tab.
GraphIDintNot nullThe unique identifier of the graph.

Tabs

This table contains all information that is relevant to a Tab.
TabIDintNot nullThe unique identifier of the tab.
TabNamevarchar(255)NullThe name of the tab. The name is set when creating a new tab in the frontend web-application.
RaceIDintNot nullThe unique identifier of the race that the tab belongs to.
UserThis table handles all user data and other data relevant to have users that can interact with the application.
UserIDintNot nullThe unique identifier of the user.
Usernamevarchar(255)Not nullThe unique name of a user that will be on display in the frontend web-application.
Passwordvarchar(255)Not nullThe hashed password of the user that is needed when logging in into the web-application.
UserTabsThis table is responsible for tying all tabs that have been created by a user.
UserIDintNot nullThe unique identifier of the user.
TabIDintNot nullThe unique identifier of the tab.
WheelspeedSensorThis table can be used for any future sensor that is added to the car. This table will need to be copied and its unique third row should be edited to accomodate the right datatype and name for this new sensor.
WheelspeedSensorIDintNot nullThe unique identifier of the specific sensor.
TimestampDATETIMENullThe timestamp when the specific piece of data was received from the sensor.
RPM (data)floatNull

This field contains the spcific data that a sensor sends to this database. For this specific sensor, that data is received as RPM. When a new sensor is added to the API, a new table, just like this one should be created where only the data field should be edited.

Design decisions related to the database

<Describe all design decisions made along the database. This could include the choice of the database management system, the use of certain triggers or stored procedures, special indexes and so on.>

hier moeten nog dingen bij als triggers en uitleg over de keys


Decision 1

Description

Problem/Issue

Throwing all of the different sensors and their data into one big table will quickly create a very clumped and hard-to-read table.
DecisionCreate a different table for every sensor and add a new table that contains all sensor IDs.
Alternatives-
ArgumentsBy dividing data over multiple tables, query time can be shortened significantly and keeps all of our tables in line with the Single Responsibility principle.