DEV Community

Cover image for Why firebase was not the right fit for my app
Florian Vallen
Florian Vallen

Posted on

Why firebase was not the right fit for my app

For a new next.js project I tried out firebase. It was heavily advertised by one of my favourite youtubers fireship. Coming more from a relational background I was really curious about a document oriented database approach and how firebase would help me to progress quickly.

The idea for the app was a simple interface that lists trips of users in a similar fashion to the Airbnb listings ui which includes a map that lists the listings as an overlay over the map.

I really love the idea of Backend as a service as it helps to quickly get your frontend to work seamlessly and secure with authentication and storing the data. Yet, there were some issues that quickly made me realise that firebase was not the right fit for this app. Here's why:

1. Query Limitations

In order to show the trips on the map, I'd have to check if the latitude and the longitude is within the bounds of the google maps view. It turns out that this is not possible in firebase:

You can perform range (<, <=, >, >=) or not equals (!=) comparisons only on a single field

Inequality operations on latitude AND longitude of the trips is only possible on either latitude or longitude, the rest of the filtering would have to be dealt with by the client. Everyone who starts a project with firebase should keep in mind that filtering on more than one field is not going to be possible.

2. Pagination

Since you can't query the total amount of documents within a collection, it's not possible to show the number of pages. It's only possible to show the next and the previous page. Pagination feels strangely complicated in firebase. It's not really a deal breaker for me, but makes searching through a set of data a little less user friendly.

Top comments (0)