I switched from a parse server to firebase for my new project, but reached a point in the project where I begin to think that this is a bad idea.
Basically, I create an application where people can publish information about concerts in their city.
My first task was to filter events, so the user only receives events in his hometown. I did this by structuring the data after the cities:
{ concerts: { "New york": { ..., ... }, "Chicago": { ..., ... } } }
Then I suggest that I need another filter for the type of concert, such as rock, pop, etc. Therefore, although I did another restructuring. However, probably there should be another 5-10 filters, and it will be very difficult to properly structure the database.
I have at least a few requests , but this was not allowed:
firebase.database().ref("concerts") .orderByChild("type").equalTo("rock") .orderByChild("length").equalTo("2") .orderByChild("artist").equalTo("beatles")
I thought about extracting everything from the server, and then filtered the result in the client. I see, however, two problems with this:
- There may be a lot of unnecessary download data.
- Some concerts will be blocked only for certain users (for example, users who have traveled to at least 10 other concerts), and there may be a security aspect by pulling these concerts home so that the user cannot see them.
I was thinking of combining filters to create query keys such as this , but with over 10 filters it will become complicated.
Is there a solution for this or should I forget about firebase for this use case?
Thank you in advance