Sciencedirect Sciencedirect
Sciencedirect Sciencedirect
Sciencedirect Sciencedirect
com
ScienceDirect
Available online at www.sciencedirect.com
Transportation Research Procedia 00 (2017) 000–000
www.elsevier.com/locate/procedia
ScienceDirect
Transportation Research Procedia 27 (2017) 873–880
www.elsevier.com/locate/procedia
20th EURO Working Group on Transportation Meeting, EWGT 2017, 4-6 September 2017,
Budapest, Hungary
Abstract
The transportation of dangerous goods represents one of the most critical risks particularly in urban areas. For example, every day
large quantities of hazardous substances are transported by roads or railways inside areas with high density of population. Thus, to
ensure urban and public safety the first challenge that we tackle is to find an environmental information system, which is able to
provide risk management and monitoring. Moreover, it can capture urban transportation dynamics and offer specific services,
visualization, analyses and evaluation of the hazmat risk in various high-risk zones. In addition, due to wireless technologies and
real time intelligent sensors, the risk of dangerous goods can be carried out in real time. In this work, we adopt a microservices
based architecture to have a real-time environmental sensors system that have highly scalable applications on cloud environment.
By definition, this architecture consists of a set of loosely coupled and independently deployable services. In addition, the proposed
system is conducted with a smart data collector, visualization abilities and a variety of distributed sensors in order to enhance the
hazmat transportation network monitoring. Finally, we show how to integrate efficiently into the system prototype the hazmat
routing container embedded microservice, and illustrate the orchestration with other microservices to improve this system with
hazmat routing capabilities using various routing algorithms particularly bi-directional A* algorithm. This work constitutes the
first step to build the Hazmat planning aid system that provides valuable data and knowledge to urban planner and decision makers
© 2017 The Authors. Published by Elsevier B.V.
© 2017 The Authors. Published by Elsevier B.V.
Peer-review
Peer-review under
under responsibility
responsibility of
of the
the scientific
scientific committee
committee of
of the
the 20th
20th EURO Working Group
EURO Working Group on
on Transportation
Transportation Meeting.
Meeting.
Keywords: transportation of dangerous goods, environmental information system, microservices based architecture, smart data collector, hazmat
transportation network monitoring, pgrouting bidirectional A* algorithm;
1. Introduction
Accidents represent an event caused by the damage to a chemical plant, transport vehicle, and storage of hazardous
substances. Hazardous materials or dangerous goods include explosives, gasses, flammable liquids and solids,
oxidizing substances, poisonous and infectious substances, radioactive materials, corrosive substances, and hazardous
wastes. Accidents involving the transportation of hazmat can result from different causes and lead to severe
consequences characterized by fatalities, injuries, evacuation, property damage, environmental degradation and traffic
disruption. Therefore, it is relevant, important and necessary to work towards identifying, predicting and minimizing
the risk of incidents in the transportation of dangerous goods and their potential consequences. The transportation of
dangerous goods currently confronts a large number of problems. Such as: i) Lack knowledge of the position, the
nature and characteristics of the goods transported, and the risks associated with them; ii) No systematic data on
incidents involving the transport of dangerous goods; iii) Late and incorrect information, concerning the application
and control of rules and regulations of hazardous transportation; iv) No Continuous regulatory monitoring. All these
facts emphasize the necessity to specify and prototype a real-time environmental system for hazmat transportation,
which can track in real time hazmat vehicles and provides information, knowledge and services that helps decisions
makers and urban planners to supervise hazmat transportation and to better reduce the risk of moving hazardous
materials. This work focuses on providing as single system various cooperating services such as real-time hazmat
monitoring, risk-knowledge, hazmat routing, and transportation document, in order to provide more effective and
reliable transport problem solutions aimed at monitoring dangerous goods transportation in Mohammedia City. The
global system is designed as a microservice based architecture as defined in (Daya, 2016). It is an architecture style,
in which large complex software applications are composed of one or more services. Microservice can be deployed
independently of one another and are loosely coupled. Each of these microservices focuses on completing one task
only and does that one task really well. Moreover, this type of architecture can allow building a large-scale system
capable of evolving and adopting new standards and services. The rest of the paper is organized as follows: in Section
2, we begin with highlights related work specifically within the context of hazmat transportation management and
microservice-based architectures. Section 3 presents an overview of microservice architectures before describing in
detail the proposed system in section 4. Sections 5 gives the main technical part of the paper and describes the
architecture implementation of the prototype, in addition to the performance evaluations. We conclude the paper in
Section 6 and address areas of future work.
2. Related works
The transportation of dangerous goods is one of the most complex and most safety requiring transportation
technologies. Many researchers have studied transportation monitoring, tracking and vehicle routing problems. In
(Boulmakoul, 1999) the authors give general specifications for a monitoring system for the transportation of hazardous
materials. The paper (Planas, 2008) presents a monitoring and intervention system for the transportation of dangerous
goods based on systems used in air traffic control. This system aims to provide civil security centers with real-time
knowledge of the position and contents of dangerous vehicles. An open architecture for real time GPS data collection
in addition to its performance and scalability tests is explained in (Laarabi, 2012). (Erkut E. T., 2007) . The authors
of (Yılmaz, 2016) give a literature survey about the hazmat transportation articles classified according to risk, routing
and scheduling, emergency response, network design and accident analysis.
As microservice is relatively a new concept, there are a few works in the field of microservices-based architecture.
Basic information about the microservice approach is provided in (Newman, 2015). With lots of examples and
practical advice, this book takes a holistic view of the topics that system architects and administrators must consider
when building, managing, and evolving microservice architectures. In (Familiar B. , 2015), Familiar provides a
working definition of microservices and contrasts this approach with traditional monolithic layered architecture. Daya
in (Daya, 2016) gives a broad understanding of this increasingly popular architectural style, and provides some
examples of the way to develop applications using the microservices approach.
3. Microservices-based Architecture
In general, the objective of environmental information systems is to facilitate the collection, organization, storage,
analysis, and publication of information related to an interesting phenomenon (the hazmat transportation in our case).
These types of systems deal with geospatial information and services. They allow the user to store, query and process
environmental information and visualize it in maps, diagrams and reports. From the point of view of system theory,
environmental information systems are autonomous components, which provides different functionalities in a
cooperating way. The proposed system, as an environmental information system, can be viewed as a collection of
Ghyzlane Cherradi et al. / Transportation Research Procedia 27 (2017) 873–880 875
Cherradi et al. / Transportation Research Procedia 00 (2017) 000–000 3
various services, integrated with each other to form a cohesive and flexible system. Providing sophisticated data
storage, management and interface functionality, the hazmat monitoring is one of the core components of the proposed
system. Based on GPS and GIS technology, this component gives real-time knowledge of the position and contents
of vehicles. The incidents and accidents are clear indicators and should be therefore investigated to determine the
hazards that played a role in a threat. Thus, it is necessary to use a historical component in addition to a data collection
module. The historical data is based on accident and incident investigation and analysis in order to discover all facts
pertinent to a past incident or accident, and identify opportunities for improvements meant to avoid future similar
accidents. Each hazard that is identified must be evaluated and classified. This process requires a documentation and
regulation component, which facilitates the recovery of characteristics and regulations of these dangerous goods.
Moreover, the choice of optimal routes for hazardous substance transportation is one of the preventive measures to
minimize possible risk. Therefore, it is necessary to integrate a hazmat routing component that can provide optimal
road of hazardous materials where optimality in this case means a minimum risk of transport route.
The microservices-based architecture is a best-practice approach for realizing such system requirements. It can be
defined as an approach to developing a single application as a suite of small services; each running in its own process
and communicating with lightweight mechanisms (Newman, 2015). The key characteristics of the microservice
architecture relevant to the context of this work are described below.
Componentization via Services: software componentization is a practice that break software system down
into smaller easily identifiable pieces. Microservice-based architecture achieves the componentization via
breaking systems down into microservices, which are capable of running independently and are responsible
for its own data. In other words, the system is distributed as components exposed as a microservice running as
its own process. These microservices can talk to each other but are not dependent on others. A microservice is
independently replaceable and independently upgradable (Newman, 2015).
Decentralized Data Management: The proposed system databases are heterogeneous; they are spatial,
relational and document database. Therefore, there is no unifying schema in a central database. Microservices
architectures are distributed systems with decentralised data management. This means that every service has
its own, independent, storage subsystem that is isolated from other services (Namiot, 2014).
Technology Heterogeneity: With a system composed of multiple, collaborating services, we can decide to
use different technologies that are most suitable for each one (Abbott, 2009). Consequently, microservices
architectures are usually heterogeneous with regard to operating systems, programming languages, and data
stores. This use of multiple languages, frameworks and technologies for individual service, it is also known as
polyglot programming approach, which gives benefits such as scalability and interoperability.
Evolutionary Design: The change has historically been difficult to anticipate and expensive to retrofit;
consider that over time, more capabilities can be migrated. The use of microservices-based architecture will
permit to add new user experiences and new business capabilities (Familiar B. , 2015).
The objective of the proposed system is to monitor and control the transportation of hazardous materials. Such like
materials are transported regularly on the roads and whenever they are involved in an accident, they could cause
serious consequences for road users, surrounding communities, infrastructure and the environment. Furthermore, the
term “Internet of Things (IoT)” is related to the integration of the physical world with the virtual world of the Internet.
There are various physical objects, one wants to be able to track, to monitor and to interact with. The hazmat transport
vehicles can be considered as one of these objects. Apply the key technology of IoT to hazmat transportation can
improve system reliability and transport safety (WANG, 2009). We used the global positioning system (GPS)
technology, wireless sensor networks (WSN), geographic information system (GIS), in addition to IoT technologies,
to achieve real-time monitoring and tracking of hazardous materials.
4876 Ghyzlane
Cherradi Cherradi
et al. et al. / Transportation
/ Transportation Research
Research Procedia 00 Procedia 27 (2017) 873–880
(2017) 000–000
The whole system is built based on micro-services architecture over a cloud environment and provide the following
services (see figure1): 1) Pre-transportation: preparing and sending shipping paper, instructions in writing, and
emergency response information into document management microservice. This ensures accurate communication,
avoids misunderstanding and reduces waiting time. 2) Routing: we use a GIS database with risk costs and the
pgRouting extension, in view of finding the least-risky routes for HAZMAT shipments. 3) Monitoring and Tracking:
based on GIS web map and GPS, the system can visualize the vehicle moving on the map with all the important data
and parameters right alongside it. 4) Data collection: this microservice communicates with in-vehicle sensors and
collects sensor data (such us real-time information about goods, driver and vehicle, etc.). Once the data received, the
microservice stores the row data onto the database. 5) Substance and risk knowledge: that permits to retrieve
hazardous material description stored in the hazmat database. The hazmat information concerns the product
identification, the nature of the danger, the physical and chemical properties, security instructions and transportation
conditions, etc. 6) Transport documentation: the documentation is crucial for shipping dangerous goods by road.
Therefore, providing in time the appropriate documentation for appropriate authority can dramatically reduce the time
and error rate to a minimum. 7) Historical information: based on historical data storage, the history service can
achieve the historical query and track playback, thus can improve the reliability of the system. Finally, the following
sub-sections will explain in detail the main microservices providing by the proposed system. 8) Alert and Query
information: Warning and alert notification in the case of dangerous situations can prevent accidents by allowing the
protective and preventive measures to be taken.
The collection of data is one of the basic requirement for any information system. It is unquestionable that hazmat
data is the primary source for any kind of hazmat transportation projects and necessarily the data should be reliable
and precise. Hence, the more meaningful data is obtained, the more knowledge that can be provided. Moreover, the
Internet of Things (IoT) is a paradigm that allows smart devices to be connected to the Internet. Such devices can be
sensors, which are able to operate and transmit data to other systems. The Wireless Sensor Networks (WSNs) are one
of the most important elements in the IoT paradigm, mainly used to collect and route data from the environment to
the end users. In this section, we propose a solution to collect and transfer data efficiently, using a bandwidth-efficient
and energy-efficient protocol capable of providing a simple, reliable stream of data, such as Message Queue Telemetry
Transport (MQTT) protocol, which is an open and lightweight publish/subscribe protocol designed specifically for
machine-to-machine and mobile applications. It is optimized for communications over networks where bandwidth is
at a premium or where the network connection could be intermittent (Stanford-Clark, 2013). The main feature of
MQTT is publish / subscribe structure. In this architecture, a client (subscriber) needing data registers its interests with
Ghyzlane Cherradi et al. / Transportation Research Procedia 27 (2017) 873–880 877
Cherradi et al. / Transportation Research Procedia 00 (2017) 000–000 5
a server (broker). The client (publisher) producing data sends the data to a broker and this broker forwards the
incoming data directly to the subscribers (Eugster, 2003).
Fig. 2. Data-collection microservice architecture Fig. 3. Main function flow diagram of the proposal solution.
The architecture shown in figure. 2 is designed for describing our data collection solution. It is classified into : 1)
IoT devices: represent the sensor layer in an IoT infrastructure, which is responsible for obtaining the various types
static/dynamic information of the real world through various types of sensors. 2) MQTT broker: primarily
responsible for receiving all messages, filtering them, decide who is interested in it and then sending the message to
all subscribed clients. We use the open source Mosquitto server as a broker for MQTT communication. 3) MQTT
subscriber server: When the sensing data is published from the broker, the MQTT Client (Node.js server) is
configured to subscribe to these data and store them in the data server (MongoDB). 4) Clients: Represent the
application layer in an IoT infrastructure, which exploits the collected data to provide a continuous monitoring of
hazmat vehicles. The figure 3 presents the sequence diagram of our proposal data-collection solution: Starting from
the vehicle, using the GPS satellite navigation system for receiving the position of the vehicle, the position and the
vehicle ID are transmitted in addition to in-vehicle sensors data to the MQTT broker using MQTT protocol over GPRS
network. The Node.js server first asks the Mosquitto server to subscribe to the data it wants to store in the data server.
Once the data is published and forwarded, the node.js server stores it in Mongodb database. When the client requests
for non-real-time data, the Node.js server sends the requested data, after checking and extracting it from the data
server. For the real-time data request, the client asks Mosquitto server to subscribe to the specific topic. Then, the
Mosquitto server sends the data to the subscribing clients. A client web-mapping application based on many benefits
of GIS was developed to show knowledge (non real-time data) and movements (real-time data received) of transported
materials that can enable possible accident.
Information such as the quantity, description of the goods, and the condition in which they were when shipped are
crucial for hazmat transportation management. This information gives the control authority a risk knowledge
information in order to produce decisions. Using a risk knowledge database, the proposed system provides static
hazmat data (substance identification, Physico-chemical properties and recommended emergency treatment), in
addition to the digital form of transport documentation for facilitating its control.
To assess the best routes for the transport of dangerous goods, a microservice based on a combination of the
geographical information system (GIS) with the spatial database and the pgRouting bi-directional A* algorithm was
878 Ghyzlane Cherradi et al. / Transportation Research Procedia 27 (2017) 873–880
6 Cherradi et al. / Transportation Research Procedia 00 (2017) 000–000
proposed. It aims to manage, treat, and represent geographical data related to the evaluation of the risk of transport on
a road network. Two kinds of data are needed as input for the proposed service:
• Spatial data, which represents the transportation network as a collection of arcs with nodes loaded from OSM
(OpenStreetMap) through QGIS (QGIS User Guide) server and stored in spatial database PostgreSQL/PostGIS.
• Attribute data, which represents the values of risk on an arc. However, these values are calculated as the product
of both the probability and the consequence of the undesirable event (Erkut E. &., 1998).
The figure 4 illustrates an overview of the proposed system workflow. Firstly, the clients send a routing query that
contains a source and a destination to the routing server by a web-mapping application. Secondly, on the routing server
side, the server connects to the PostgreSQL/PostGIS and pgRouting bi-directional A* algorithm is executed, with the
risk value taken as the criteria for optimization. Finally, the routing result sends back to the clients. The client side
application was built using AngularJs, leaflet and scripted using JavaScript.
5. The prototype
In this section, we describe our prototype that is capable of providing a website with a user interface allowing end-
users to exploit the internal requirements, which are developed as a distributed system of lightweight, narrowly
focused, independent services. The figure 5 shows the architecture implementation of the prototype.
In this implementation, we use an API gateway, in order to provide a unified single entry point for external
consumers that is independent of the number and composition of internal microservices. It is responsible for request
routing, composition, and protocol translation. All requests from clients first go through the API Gateway. It then
routes requests to the appropriate microservice (Gateway, 2016). The API Gateway feature includes two main
interfaces REST and MQTT for supports REST and MQTT (using Mosquitto broker) communications. The Web
front-end server is written in Node.js enhanced with Express web application framework at server side, and angular.js
for the client side. Moreover, we use an event-based bi-directional communication layer for real-time web applications
namely socket.io. Microservice architecture requires an adequate ecosystem that permits to obtain all the desired
benefits. Indeed, microservices architecture increases the complexity of the system, which becomes a distributed
system. However, multiple micro-services on the same machine running without proper isolation may affect too much
the functioning and performance of each microservice. On the other hand, virtual machines for each microservice may
be too heavyweight as a solution (Mozaffari, 2016). Container technology, and Docker (Docker, 2015) in particular,
offer an isolated environment to run each microservice. This brings a new opportunity for building microservices. The
services can be wrapped into containers with relatively small overhead, and, being virtually independent from each
other. They can be managed as separate components (Familiar B. , 2015). This technology is extensible and works
with other software development tools to realize a scalable build of microservices. This work employs Docker Engine,
Docker Machine, Docker Compose and Kubernetes (Vohra, 2016) to realize the scalability of the Microservice
Architecture. Kubernetes is a container orchestration middleware released by Google (Burns, 2016). It aims to provide
an environment to schedule, deploy and manage groups of containers on a cluster of physical or virtual machines.
Each container is uniquely addressable using an IP address and communicate using apache Kafka. The system was
running on Ubuntu 16.04 operating system.
The test starts with a minimum of 50 publishers, and tries to reach 750 publishers. The message rate is set to 1000
message per second per publisher. For example, 50 publishers produce 50 000 messages per second through 50 MQTT
connections. The message payload size is fixed and set to 100 bytes. The time consumed for collecting messages
varies between 13.07s when collecting 50 000 messages from 50 publishers and 100 s when collecting 700 000
messages from 700 publishers. The figure 6 describes the number of messages per second when connecting 50, 100,
150, 200, until 700 simultaneous publishers.
Fig. 6. Data collection system test using 1000 messages from each publisher
The table 1, summarizes the performance test result for the node.js server, broker server, and the data sever containers,
when collecting 100 000 messages from 100 publishers.
880 Ghyzlane Cherradi et al. / Transportation Research Procedia 27 (2017) 873–880
8 Cherradi et al. / Transportation Research Procedia 00 (2017) 000–000
Acknowledgement
This work was partially funded by the CNRST project in the priority areas of scientific research and technological
development "Spatio-temporal data warehouse and strategic transport of dangerous goods»
The main objective of this work is to provide a system for Hazmat transportation management based on microservices
oriented architecture. A data collection solution is proposed to facilitate data transfer between vehicles and IT
infrastructure. In addition, the routing microservices is built based on the pgRouting bi-directional A* algorithm with
the risk value taken as the criteria for optimization. This affords the calculation of the least-risky routes for hazmat
shipments. Moreover, the system is entirely developed based on an open source software, and its open architecture
makes easy the integration of various services and scenarios. In the future works, we plan to integrate more useful
services; and thus to build a Hazmat planning aid system that provides the necessary tools to get emergency response
in order to improve the safety of dangerous goods transportation.
References
Abbott, M. L., & Fisher, M. T. (2009). The art of scalability: Scalable web architecture, processes, and organizations for the modern enterprise.
Pearson Education.
Boulmakoul, A., Laurini, R., Servigne, S., & Idrissi, M. J. (1999). First specifications of a telegeomonitoring system for the transportation of
hazardous materials. Computers, Environment and Urban Systems, 23(4), 259-270.
Boulmakoul, A., Laurini, R., & Zeitouni, K. (2001). Spatial monitoring and routing system for the transportation of hazardous materials. In
Environmental information systems in industry and public administration (pp. 227-236). IGI Global.
Burns, B., Grant, B., Oppenheimer, D., Brewer, E., & Wilkes, J. (2016). Borg, omega, and kubernetes. Communications of the ACM, 59(5), 50-
57.
Daya, S., Van Duy, N., Eati, K., Ferreira, C. M., Glozic, D., Gucer, V., ... & Narain, S. (2016). Microservices from Theory to Practice: Creating
Applications in IBM Bluemix Using the Microservices Approach. IBM Redbooks.
Docker. (2015). available at: https://www.docker.com/
Erkut, E., & Verter, V. (1998). Modeling of transport risk for hazardous materials. Operations research, 46(5), 625-642.
Erkut, E., Tjandra, S. A., & Verter, V. (2007). Hazardous materials transportation. Handbooks in operations research and management science,
14, 539-621.
Eugster, P. T., Felber, P. A., Guerraoui, R., & Kermarrec, A. M. (2003). The many faces of publish/subscribe. ACM computing surveys (CSUR),
35(2), 114-131.
Familiar, B. (2015). Microservices, IoT and Azure: Leveraging DevOps and Microservice Architecture to deliver SaaS Solutions. Apress.
Farcic, V. (2016). The DevOps 2.0 toolkit: automating the continuous deployment pipeline with containerized microservices..
Gateway, I. (2016). IoT Gateway.
Laarabi, M. H., Sacile, R., & Boulmakoul, A. (2012). Road dangerous goods transport: Open architecture, performance, and scalability of a real-
time gps data collection. In International Workshop on Innovation & New Trends in Information Systems (INTIS 2012) (p. 57).
Luong, N. C., Hoang, D. T., Wang, P., Niyato, D., Kim, D. I., & Han, Z. (2016). Data collection and wireless communication in Internet of
Things (IoT) using economic analysis and pricing models: A survey. IEEE Communications Surveys & Tutorials, 18(4), 2546-2590.
Mozaffari, B. (2016). Microservice Architecture Building microservices with JBoss EAP 7. Red hat.
Mosquitto. (2012). Available at http://mosquitto.org.
Namiot, D., & Sneps-Sneppe, M. (2014). On iot programming. International Journal of Open Information Technologies, 2(10).
Newman, S. (2015). Building microservices. "O'Reilly Media, Inc.".
Planas, E., Pastor, E., Presutto, F., & Tixier, J. (2008). Results of the MITRA project: Monitoring and intervention for the transportation of
dangerous goods. Journal of hazardous materials, 152(2), 516-526.
PostGIS 2.3.3dev Manual. Available at http://postgis.net/documentation/.
QGIS User Guide. (s.d.). Available at http://www.qgis.org/en/docs.
Stanford-Clark, A., & Truong, H. L. (2013). Mqtt for sensor networks (mqtt-sn) protocol specification. International business machines (IBM)
Corporation version, 1.
Vohra, D. (2016). Kubernetes microservices with Docker. Apress.
WANG, K. L., ZHONG, H. L., & ZHANG, Z. Y. (2009). Research on Dangerous Articles Transportation System Based on RFID/GPS/GPRS [J].
Logistics Technology, 4, 042.
YILMAZ, Z., EROL, S., & APLAK, H. S. (2016). Transportation of hazardous materials (hazmat) a literature survey. Pamukkale University
Journal of Engineering Sciences, 22(1).