Service Oriented Architecture

The goal of a Service Oriented Architecture (SOA) is to understand the service oriented architecture, understand Web services and understand the underlying issues of the development of distributed applications.

Descriptive part

General project description

We were requested to develop a Web application (Proof-of-Concept) for managing  INSA's rooms . This application must allow automatic closing windows, doors, turning on heating, turning off lights ... etc. This application relies on software services, sensors, and actuators. The goal is to retrieve data from sensors and analyze them to enable taking decisions. 

Through software services (microservices), the application retrieves data of sensors (temperature, presence, ...), and according to the values of the retrieved data, actions on actuators can be triggered. The application is based on microservices and implements the followings scenarios.

Scenarios

  1. As a student, I want the system to detect my presence in the room and measure the temperature and turn on the heaters when it is cold
  2. As a student, I want the system to detect my presence in the room and measure the temperature and turn on the air conditioning when it is hot
  3. As an administrator, I would like to retrieve the value of any presence/CO2 sensor of any rooms so that the system switches on the alarm (risk of fire departure) automatically
  4. As a teacher, I want the system to detect my presence in the room and measure the CO2 level and open the windows and doors in case of high CO2 level to ventilate
  5. As a teacher, I want the system to detect my presence and turn on the lights if the brightness value is low
  6. As a teacher, I want the system to detect my absence and turn OFF the lights if the brightness value is high
  7. As an administrator, I would like to get incident and activity reports so that I could do statistic about periodic events and incidents

Microservices created

Each sensor and actuator is a micro service and thus, we have identified 3 categories of microservices: Sensors, Actuators and others.

Sensors

Temperature

Presence

CO2-Humidity

Light

Actuators

AC - Heater

Doors

Windows

Alarms

Lights

Others

Controller

Database

Clock

We use the presence sensor to determine if we should activate an actuator or not. For instance, we won’t turn on the lights if no one is in the room. Every scenario are led by the presence sensor. For now, doors and windows are controlled together. The most important microservices is the controller that will managed every scenarios.

Global architecture

Respectively, each actuators and sensors share the following architecture. If you want to know the details about how each sensor and actuator are controlled you can check my report on my Github page (link available below). 

Tests

We use a simple node-red flow to tests our scenarios. Between each scenarios we reset our sensors. We defined 5 scenarios in our flow:

  1. We set CO2 level to 3000ppm and the presence to false —> it should trigger the alarm
  2. We set CO2 level to 3000ppm and the presence to true —> doors and windows should be open
  3. We set the temperature to 10° and the presence to true —> Heater should be on and AC off
  4. We set the temperature to 29° and the presence to true —> AC should be on and heater off
  5. We set the lights sensors to 30% and the presence to true —> lights should be on

Here is the node-red flow we use for our tests.

We also made a demonstration video available along the flow in my Github repo. 

Technical part

This section describes the context of the subject, my accomplishments and a summary of the skills I have acquired.

Presentation

The course runs from November to January and is evaluated in the form of a project. I realized this project in collaboration with GENEAU Téo and KHALED Walid.

The work done during this project is to be put in parallel with Software Engineering which approaches the project organization with Jira. The biggest problem for this project is its very uneven distribution in the time schedule, which makes the work very difficult. This subject is evaluated by a report that you can find below.

Observations

Before the practical works for the project, there are tutorials allowing us to learn the concepts. These tutorials are very well guided and therefore carried out and allowed me to progress very quickly because almost all the problems I encountered were referenced in the tutorial.

To go back to the schedule, we had two sessions placed less than a day apart and another one three weeks later, all in four practical work sessions. Moreover, this last session is placed just before the portfolio oral.

Despite this big problem, I was still able to understand all the concepts of the course.

Skills  used

This subject uses the courses and projects in Java realized in the last years but more mainly in the courses of the subject themselves.

Review

I am now able to set up microservices and deploy them on servers. I know how to start from scenarios and to imagine an application responding to these scenarios.

Analytical Part

This section presents a comprehensive analysis of all the knowledge and skills acquired during this experiences

Skills matrix

Know how to define a Service Oriented Architecture

Deploy an SOA with web services

Deploy and configure an SOA using SOAP

Deploy and configure an SOA using REST

Integrate a process manager in an SOA

See related work

Click on the button below to visit my GitHub Repo.