Let’s get into the database schema details for designing yelp.
LocationInfo |
locationID |
locationName |
latitude |
longitude |
description |
category |
locationImageUrl |
reviewLocation |
locationID |
reviewID |
*userReview
|
userID |
reviewID |
reviews |
reviewID |
userID |
reviewText |
reviewImageUrlList |
rating |
userProfile |
userID |
name |
email |
mobileNum |
profileImageUrl |
a) One more thing to take care of is how to store the rating information for a location so that it’s efficient while displaying locationList?
While displaying a list of locations, it’s not wise to go through the whole review table to calculate the average rating of a location. I would fetch it from some pre-calculated data store.
b) How to store images such that if we decide to change my cloud storage in the future, it is easier for us to migrate?
Feel free to suggest proper table names and column names. Please provide your input on either or both the points.