Skip to content

Database Management System

baltasarb edited this page Jul 27, 2019 · 2 revisions

Table of Contents

Conceptual Model

dbms-structure

Person

The entity Person represents a single user in the database.

Route

Entity that stores every information required to represent a Route. Special consideration was taken into the making of this entity as a Route must have large sets of coordinates, representing the path that it undergoes.

GoogleAuthentication

Google Authentication is the entity that stores the user unique identifier in the Google platform, the subject. In the future there will be multiple entities with different forms of authentication, hence the name GoogleAuthentication of the entity. It provides scalability to further augment the authentication process, which can be done with a new entity FacebookAuthentication for example.

Authentication

This entity is used to store authentication metadata regarding each database user. The tokens have an expiration time, and because of it their creation date is required as well as their expiration date.

Category

The category entity defines a route in a broader sense. It is used to filter the amount of routes being searched by a user. It can be one of the several: Sea, Sports, Cultural, amongst others. Each route must be assigned at least one category.

PointOfInterest

A route might contain geographic points of interest along its path, this is the entity that represents them.

Image

The image entity represents the image that is associated with the route, namely it’s cover image. It is characterized by a reference that allows the image’s URI to be fetched.

Physical Model

The physical model can be seen in a full in the database documentation, the following subsections discuss some of the table fields considered important.

physical-model

Person

The table person has only two fields, the identifier of the person, generated by the database and the person’s rating. A user can have multiple entries on the Authentication table to enable multiple device registration, but only a single Google Authentication entry as the google account is unique.

Route

The route table has amongst others, a field called points. This field is of type JSON, and is used to store sets of geographic coordinates. The field is a JSON array of point objects and has the following structure:

[
    {
        "latitude": double , 
        "longitude": double
    }, 
    . . .
]

This structure allows the mapping of multiple points to a single route. Two other very important fields are the Booleans ordered and circular. The field ordered is used to store if a route should start only at it’s first geographic point or if the order of which a user can undergo is not defined. The circular parameter is used to verify if a route ends where it starts, because if that is the case, then the route can be started by the user in any of the route’s geographic points.

GoogleAuthentication

The google authentication table is used to store google account information, more specifically the subject which is primary key. Only one google account per user is allowed.

Authentication

The authentication table stores the user credentials generated by the Social Routing Service. It contains the access token, the refresh token, the date of creation and the expiration date of the access token as well as the person identifier. The primary key of the table is the refresh token, as a single person can have multiple entries on this table, to allow multiple devices to be logged in while maintaining the same account.

Category

The category entity characterizes a route in a broader sense. It is used to filter the amount of routes being searched by a user. It can be one of the several: Sea, Sports, Cultural, amongst others. The categories available are manually inserted to the database. Each route must be assigned at least one category.

PointOfInterest

A point of interest is a pair of geographic coordinates (latitude and longitude) and it’s reference to the google platform.

Image

The table image contains a single field which is it’s primary key, a reference. This is the image’s unique identifier in the google platform.