DrivingApp System Architecture

The architecture of the DrivingApp system is composed of two layers: the fronted and the backend. The following image shows the components of the architecture in each of its layers.

Arquitectura del sistema DrivingApp

Fronted

The Frontend layer of the DrivingApp system contains the end-user applications. The architecture shows in the Fronted layer the mobile application DrivingApp, however if you want to add another application to this project, you can include it within the Frontend layer.

The mobile application DrivingApp constantly sends (1) to the Orion ContextBroker the device data, and the alert entities created by the user of the application. In addition, the DrivingApp application uses (2) the services of DrivingApp Service to perform queries functions and data models administration.

Backend

The Backend layer is composed by the services and DBMS that the DrivingApp application uses. The services can be broadly classified into three types: the QuantumLeap environment services, the specific use services for the DrivingApp application and the IDM-Keyrock authentication service.

Services QuantumLeap Environment

The QuantumLeap environment is a set of services that allow you to store FIWARE-NGSIv2 data in time series, and represent them graphically to facilitate their monitoring. The services that make up the QuantumLeap environment are described below.

Orion ContextBroker

The Orion ContextBroker is a C ++ implementation of the NGSIv2 REST API developed as part of the FIWARE platform. This component allows managing the entire life cycle of the context information and its availability; including updates, queries, registrations and subscriptions. Using the Orion ContextBroker, it is possible to create context elements and manage them through updates and queries. In addition, with the Orion ContextBroker it is possible to subscribe applications to changes in the context information; e.g, when new context information is created or updated, applications receive notification. The Orion ContextBroker stores the context information in a MongoDB database. The usage scenarios and the functions of the Orion ContextBroker are described in the official documentation of this component, which you can consult in the following link.

The Orion ContextBroker manages the context information of the devices of DrivingApp users application, and also the alerts generated by these users (2). The device context and alert information stored in the Orion ContextBroker is constantly queried (3) by DrivingApp Service.

The Orion ContextBroker establishes communication (4) with the QuantumLeap API to send the data of the Device and Alert entities registered in the Orion. The communication between the Orion ContextBroker and the QuantumLeap API is configured through two subscriptions, one for the Device entities and another for the Alert entities. Each of these subscriptions indicates: the address of the QuantumLeap API to which the Orion ContextBroker sends the entity, and the specific attributes of the entity to store them in the CrateDB database. To learn more about subscriptions, you can consult the Subscriptions section of the Orion ContextBroker documentation.

The Orion ContextBroker notifies (5) to Notifications Service when a new alert entity is created. The notification sent by the Orion ContextBroker to the Notification Sevice service is configured through the creation of a subscription, this indicates: the type of entities to which the subscription applies (entities of type Alert), the address of Notifications Service and the attributes that entities of type Alert must contain.

QuantumLeap API

QuantumLeap API is the first implementation of an API written in Python that supports the storage of FIWARE-NGSIv2 data in a time series database. If you want to learn more about QuantumLeap you can check their official documentation on this link.

The QuantumLeap API receives the data notified by the Orion ContextBroker and converts it to the data types supported by CrateDB, for its torage in the database.

CrateDB

CrateDB is a distributed SQL database management system, and integrates a data store oriented to searchable documents. It is open source and written in Java. To know more about CrateDB you can consult its documentation in the following link.

Grafana

Grafana is a web application that serves to monitor large data sets, through the creation of graphics that interpret in real time the data obtained from various data sources. To learn more about Grafana, consult its official documentation at the following link.

DrivingApp Specific services

The services designed to use the DrivingApp are two web services described briefly below.

DrivingApp Service

DrivingApp Service is a web service that manipulates the public and private data models of the mobile application, in addition to providing query services. For more information, visit the section Web Services.

Notifications Service

Notifications Service is a web service that manipulates the information of the Alert entities sent by the Orion ContextBroker through the notification of a subscription. For more information visit the section Web Services.

FIWARE Authentication Service

The IDM-Keyrock is a generic FIWARE enabler that offers management tools to support the user's lifecycle functions such as: access to networks, services and applications, including secure and private user authentication to devices, networks and services. In addition, Identity Management is used to authorize foreign services to access personal data stored in a secure environment. In general, the owner of the data must give his consent to access the data; this also implies the authentication of the user. For more information on this component, consult the documentation on this link.