educative.io

How is the region represented

a. Sharding based on regions: We can divide our places into regions (like zip codes), such that all places belonging to a region will be stored on a fixed node. To store a place we will find the server through its region and, similarly, while querying for nearby places we will ask the region server that contains user’s location. This approach has a couple of issues:
how is the region represented. do we just use longitude and latitude?

Hi @Dewey_Munoz!
There can be multiple ways to represent regions. As specified in the text, an approach (and a good one) can be using the Zip code of the region. So essentially, all the users in the same zip code will be stored on the same fixed node. Using latitude and longitude will not be the optimum solution unless we specify a range of latitudes and longitudes and store all users that fall within that range on the same node. Similarly, we can also go with simply using a region name, depending on how much area we are looking to cover for a single fixed node.

Hope this helps!