How Delivery Live Tracking Works?

Anurup Millan
2 min readSep 20, 2023

--

When I started my development career, I used to think how live delivery tracking is used by apps like #uber #swiggy #zomato #ola works.

Do they store the latitudes and longitudes of the #delivery person in the #database. every second and is it also being fetched by the user app (#frontend ) every single second? But that would burnout the database and the load on the servers will be so huge that the servers will probably crash.

So after working with many hyperlocal #startups , and research, I came across the solution. And that solution is #websockets.

Let me explain how websockets work?

Traditionally, when we were using #http protocol for #restAPI , the client side (frontend) asks the server, “Hey Server, do you have any new message or information for me.” And the server replies to that request.

Now if we use http protocol for live tracking the frontend will be asking the server every second if there is any new information. And the server has to answer “No” every single second.

Now in websockets or wss protocol, the client (frontend ) and server connects only once which is known as the handshake. Now the frontend wont be asking questions to the server every single second, but instead, the server will automatically inform the frontend if any new information comes.

Now how are websockets used in live tracking?

A handshake takes place between the customer and the server. Also another handshake takes place between the delivery person and the server.

The location coordinates of the delivery person is updated every single second to the server and the server sends this information to the client immediately as soon as new coordinates are received. And the customer can view the realtime location of the delivery person.

This process takes place without the use of database which is great.

In the next post I will explain how the same can be achieved by using other services like #kafka , #webRTC etc. So make sure you #follow me on Medium.

--

--

Anurup Millan
0 Followers

A Software Consultant who loves developing custom software which can operate on a large scale. Loves to work with Python , Django, Flutter and React.