...
Design Sub-System B (and so on)
…
Database Design
<. If your system uses relational databases, make sure you provide a physical datamodel here.>
...
This is the database setup we will use for the RegterschotRacing API. A ful ldescription of every tables usage and datatypes can be found below.
All green boxes will be made by Smalltalk in order to provide a sound foundation to build an API on. The two red boxes could be future expansions that are out of our current scope. These have been placed here as an example to provide future developers with a stepping stone. These expansions would allow for the creation of 'Raceteams', which could give the API the functionality to be used by other raceteams, each with their own crew and cars. The sensors have been tied to the racecar, as all sensors should be in a racecar.
Database Glossary
Tablenames and formats are written in italic.
Table | Row | Datatype | Null / Not Null | Comments |
---|---|---|---|---|
Driver | This table is responsible for a driver's data. This can be expanded further with a date of birth, length, age or something else. | |||
DriverID | int | Not null | This is a unique identifier for a driver, with which a driver can be tied to races and rounds. | |
DriverName | varchar(255) | Not null | The name of the driver in the format lastname, firstname. | |
DriverRaces | This table links the driver to the driven rounds within a race. | |||
RaceID | int | Not null | This is the unique identifier of the race. | |
DriverID | int | Not null | This is the unique identifier of the driver. | |
RoundID | int | Not null | This is the unique identifier of the round. | |
Graphs | This 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. | |||
GraphID | int | Not null | This is the unique identifier of the graph. | |
Type | varchar(255) | Not null | The type of graph, can be anything from the following:
| |
SensorID | int | Not null | The unique identifier of the sensor that the graph is displaying the data of. | |
Race | This table contains all information relevant to a race. | |||
RaceID | int | Not null | The unique identifier of the race. | |
NumberOfRounds | int | Not null | The number of rounds that the race encompasses. | |
RaceName | varchar(255) | Not null | The name of the race. | |
Rounds | RoundsID | int | Not null | The unique identifier of the race. |
RaceID | int | Not null | The unique identifier of the race that the round belongs to. | |
TimestampBegin | DATETIME | Not null | The starting time of the round. | |
TimestampEnd | DATETIME | Not null | The ending time of the round. | |
Sensors | SensorID | int | Not null | The unique identifier of the sensor. |
SensorName | varchar(255) | Null | The name of the sensor. | |
TabGraphs | TabID | int | Not null | |
GraphID | int | Not null | ||
Tabs | TabID | int | Not null | |
TabName | varchar(255) | Null | ||
RaceID | int | Not null | ||
User | UserID | int | Not null | |
Username | varchar(255) | Not null | ||
Password | varchar(255) | Not null | ||
UserTabs | UserID | int | Not null | |
TabID | int | Not null | ||
WheelspeedSensor | WheelspeedSensorID | int | Not null | |
Timestamp | DATETIME | Null | ||
RPM | float | Null |
Design decisions related to the database
...