The Rise of Drones for Commercial Use

Drones are revolutionizing the industrial landscape. Data from Grand View Research shows that the commercial drone market was valued at $5.80 billion in 2018 and is projected to grow at a CAGR of…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Making Share My Trip Feature much more robust.

Working with one of the top urban mobility providers in Germany was definitely a High Point in my career. A lot of learning and unlearning happens on every career switch. One of them for me was refactoring or rewriting the Share My Trip feature.

What is the Share My Trip feature?

Whoever takes a ride in the App, can share the entire Trip route, plus information about the vehicle they are riding on via a Web URL. This is normally used to inform someone expecting your arrival about your current location. However, this can be also regarded as a Security feature in our fast-moving world.

The old architecture was a microservice serving users real-time data collected from multiple data sources. The ratio of cons to pros was much higher in this design. Some of the cons caught my eyes and are listed below.

Increasing the chances of “Distributed Denial of Service Attack(DDoS)”.

Since the URL is public which queries the big legacy monolith database with a lot of table joins, external driver service API calls, and who knows how many more things are going to be added there in the future. I would argue it is easy to trigger a DDoS Attack.

Inefficient Resource Usage.

Location Service stores the data in Distributed Redis Clusters and Redis eats nothing but the memory itself. As a company with thousands of transports on the road, we are talking about location updates at the rate of100k/min. Some features like ShareMyTrip making use of this resource every time is an Inefficient Resource Usage.

Questioning “Availablity” and “Reliability” at the same time.

Making our service available to our end users 99.9% percent of the time and being reliable to our end-users depends on the health of our mothership(the legacy database), a lot of microservices, and the monolith service which connects to the database.

The new architecture works purely based on Events. A hybrid model of Pub/Sub model and Producer/Consumer model is used.

New Arch

Stack:

Database - Mongo

Why? Mongo database helps us to easily mitigate schema changes from a lot of independent services. Similarly helps us to maintain a TTL for each booking.

Service - Spring boot service.

Producer/Consumer - Rabbimq.

Pub/Sub - Redis.

Understanding this would be easy if I starts explaining a User Journey.

Learnings:

Add a comment

Related posts:

Introduction to Nervos Network

During DevCon4 in Prague, Nervos Network and Celer Network co-hosted another successful edition of The Future of Layer 2 panel. This time, researchers and engineers from 15 projects gathered at…

Kittysires

There has been some new features and a bit of changes since last time I posted about heaven.cat on Medium. So I thought it would be nice to go through what these are and how to use them. If you’re…

Merry Christmas To All The Lonely People

Many Christians spent Christmas alone. We were told to shelter in place in many parts of our country for the Christmas 2020 season. That means many people celebrated the holiday alone that year…