Design a 'Nearby Friends' service.

Code Playground
JavaScript (V8)
Loading...
Console Output
// Output will appear here...
// For React: ReactDOM.createRoot(rootElement).render(<App />);
Recommended Answer

System Design Scenario:

1. Challenge: Dynamic locations of many friends.

2. Solution:

* Users share location only when app is open (mostly).

* Redis Geospatial commands (GEOADD, GEORADIUS).

* Or use ephemeral subscriptions: User A subscribes to updates in Grid ID X.