DEV Community

Discussion on: ā–²šŸ”„ Getting started with Next.js, ZEIT Now, and Firebase

Collapse
 
charliewilco profile image
charlieāš”

what's the value of using firebase functions versus api routes in next.js?

Collapse
 
benzguo profile image
bg

Good question!

I havenā€™t worked with next.js / zeitā€™s functions much yet - I hear the cold boot times are faster, but havenā€™t done a direct comparison with firebase.

Since Iā€™m using firebase auth & firestore already, itā€™s kinda nice to have functions in the same console. Just anecdotally, it seems like function logs update faster using Firebase, and the console feels more mature than Zeitā€™s.

Collapse
 
dwoodwardgb profile image
David Woodward

Going with cloud functions / firebase over next.js's functions would be ideal if you are heavily invested in firebase already but still want to use next. Firebase is nice because they have one of the most generous / useful free-tier's for authentication. They also tend to require a little bit less boilerplate than AWS.

Collapse
 
dazuaz profile image
dazuaz

Not an expert but I think it is also relevant that Zeit functions are not in the same datacenter and if you need to call firestore from a function it would add that latency. Additionally, you would miss out some functionality like Firestore and Auth Triggers