r/howdidtheycodeit • ProProgrammer • Sep 30 '21

How does Uber/Lyft continuously track drivers and their locations relative to the user searching for a ride?

37 Upvotes

17 comments sorted by

View all comments

Show parent comment

1

u/spacemudd Oct 02 '21

My reasonings are:

Why would you have a separate socket designated per block?

If an issue occures on the American servers, Australian users wouldn't be affected.

The load can be managed per region/area.

There is less risk in managing your business service.

You could just have multiple instances (maybe using Docker with ECS) sitting behind a load balancer.

Keeping global traffic going into 1 websocket instance is a high risk since if it goes down, the entire app is unusable.

You could just have multiple instances (maybe using Docker with ECS) sitting behind a load balancer.

And if we scale it, how can we share the information between those websocket instances? Imagine this scenario:

  1. American driver subscribes to X channel.
  2. American passenger subscribes to Y channel.

Both of these users won't see each other because the scaled instances aren't sharing data.

I literally can’t think of one good reason why you’d have a servers specifically designated to location blocks

FYI, Uber released a blog post how they parition the Earth into hexagonal shapes to group up request/dispatch requests into "grids".

https://eng.uber.com/h3/