Last Friday (15th June 2018), I spoke at the Durban Azure User Group hosted by Azure MVP Lawrance Reddy at Educor Datacentre in Westville. My topic was how Azure Services can be used in automating the current toll road infrastructure to solve some of the inherent downsides of this manual approach.

Consider the toll road system in your country/region. Thousands of drivers enter the various toll booths, wait a while, while their vehicle’s details are captured and payment is made, then the drivers are allowed to pass through.

If you are living in an area that is a holiday destination during festive periods like Durban, South Africa, you can expect a high volume of traffic at the toll roads between Johannesburg and Durban.

In order for Durban businesses/communities to better prepare for the influx of visitors (increasing product stock to cater for the visitors, etc), the government would want to know how much visitors are we getting during peak times or anytime of the year really.

The current state of toll systems run manually – meaning that as vehicles enter the toll booth, their details are captured and payment is made and they drive on towards their destinations.

Let’s assess the downsides of this manual approach.

  1. As a driver, I want to get to my destination as quickly as possible. And stopping at a toll road for 5 minutes (longer if you include waiting in line if the toll is busy) is not the best experience in the world.
  2. Toll roads need to be efficient and, at the same time, data will need to be captured accurately. Since most drivers will want to spend less time at the toll booth, sacrifices are made to data integrity in order for efficiency to be increased (the least amount of data that can be captured is now the norm).
  3. With the lack of accurate data, good business decisions cannot be made.

Now, the Government in your country/region assigns you the task of providing some data/analytics to them based on the toll system. They want to know the following:

  1. How many vehicles are passing the toll road every 3-5 minutes?
  2. They also want to know every time an unregistered or expired vehicle passes the toll road.

Imagine achieving this in the current system.

We will have to collect all the data from the toll road; that data can be assumed to be unreliable, since data capture, when it’s not audited, cannot be verified as accurate. Even if the data is accurate, it will still need to be re-captured from file to processing software and analysed – involving months to even a year!

How can we achieve our goals with Microsoft technologies?

If we picture the vehicles entering and leaving the toll road as a constant stream of data, the obvious technology we can use is Stream Analytics.

The next question is how to we get the data to Stream Analytics as quickly as possible while minimizing the wait time of the drivers? That is where IoT devices placed in the right places can scan vehicles registration plates, make and model of the vehicles and send the data to Stream Analytics via Event Hubs.

That solves our inbound data problems, but what about processing that data?

One of the capabilities of Stream Analytics is that we could stream data on top of queries that perform analytics in real-time and the results from those queries gets output to a storage of our choice. Since the output of the queries does not have a relational structure, we could then use Azure’s Cosmos DB (which is an infinite storage and planetary scale No-SQL database).

How do we get notified of the results?

Since we want to get updates of the number of vehicles passing the toll every 3-5 minutes, we ideally want to see this as a real-time graph as time goes by. For this we could have an Azure Function listening on the collection in Cosmos DB that has the data for incoming and outgoing vehicles and track the number of vehicles in Application Insights.

Also we need to send notifications of unregistered or expired vehicles. This as well, we can use an Azure Function that listens on the collection in Cosmos DB that tracks the unregistered vehicles (Remember the IoT devices? They can call a separate services that checks if vehicles are unregistered or expired). Notifications can be sent via email using SendGrid in Azure.

Conclusion

This was the first time I spoke at a public event outside of immedia, which, after it all, was and still is, personally rewarding for many reasons. As a software developer, it’s natural to work in isolation as well as in a team. Personally, although working in a team is great, it doesn’t provide the fulfillment in life that can be achieved by collaboration and the boundless sharing of knowledge within the community.

One of my passions is to get my hands on the cutting-edge technologies and becoming an expert in my craft while sharing my knowledge in the community.

At immedia, we encourage sharing knowledge so that the next generation is better equipped than the previous. Some of the ways we share knowledge is hosting school sessions which is not tied to any particular technology or discipline such as Summer School, which is a way to give back to the community as well as providing students (also anyone that’s keen about technology) with some real-world experience working in a very dynamic company.

Comments and feedback will be highly appreciated; tweet me!