I have an issue. I'm using firebase to build an application, I have a list of Car
object store in firebase and another object User
which also have userCars
property in which I store only Car's id
cars: [
1: {},
2: {},
...
],
users: [
1: {
userCars: [1, 2]
}
]
Sometimes, I want to fetch a list of cars of a user.
Using Firebase Realtime Database: I have to fetch a list of car_id then for each car_id, I have to call
once
to fetch the car's data, the combine together to return (=> If I have 10 cars, it look likes I call 10 request)Using Firebase Cloud Function: I will write an API & do exactly the same thing, the only difference is: I suppose when running on Cloud,
once
will run faster because that is on internal network.
Which option should I use? And do you know any document about how realtime database work when we make many requests at the same time.