firebase db latency across the web

891 views
Skip to first unread message

Sean H

unread,
Aug 17, 2015, 5:34:50 PM8/17/15
to Firebase Google Group
Hi,

I am taking over an app that currently uses firebase for its login api, and has our DB elsewhere... I want to move our data over to there and was wondering what sort of latency we should be expecting from it?

Currently the app is a follows:

1. iPhone app reaches out to firebase for various generic calls 
2. iPhone app kicks off a process from a separate webapp accessing its db (which I want to move to FB) 


I guess my biggest question is, would their be a noticible difference in latency between having everything in firebase, as opposed to in a db that sits on the same server as the web app?

THanks.

Robert Payne

unread,
Aug 18, 2015, 6:48:35 AM8/18/15
to Firebase Google Group
As far as I know FB is hosted in AWS on US-EAST though this may change now because of the Google acquisition (contact their support team if you want to get specifics for your firebase's node anyways).

With that in mind if get rent a server in a geographically close data center, or as I recommend the same data center if possible the latency should be negligible. The biggest thing you want to do is avoid constant re-connections in your web app backend, most database drivers use connection pools and support "persistent" long connections to avoid the round trip setup time to start making DB queries and Firebase is going to be no different.

Jacob Wenger

unread,
Aug 18, 2015, 9:10:16 AM8/18/15
to fireba...@googlegroups.com
@Robert - We actually are not hosted on AWS, nor are we in the eastern USA. Our realtime database servers currently run on bare metal machines (not VMs) in the central USA. Although, this is due to change in the near future as we continue our migration onto Google Cloud Platform. Most of our other services (Firebase Hosting, Firebase Authentication, etc.) already run on GCP.

@Sean - Robert was right in saying that latencies should be negligible from this side of the world. The best way to figure this out is to just test it though and measure for yourself. I bet you will find something in the low hundreds of milliseconds, if not less. Firebase uses a persistent websocket connection which reduces the amount of times we need to negotiate things like SSL, so the latencies you will see are just the amount of time it takes light to get from your server to our servers and back. So that should be pretty fast! If you have more specific questions about your setup, please reach out to sup...@firebase.com

Cheers,
Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/f7009a14-91c1-4f31-92c0-725c532efd36%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Justin Noel

unread,
Aug 18, 2015, 7:04:15 PM8/18/15
to Firebase Google Group
My app runs on Firebase.  I'm amazed at how fast it generally is.  Most of the time, I'm seeing latencies < 200ms.  I have users in Australia, Turkey, and about 40 other countries which I'm sure Firebase does not have a physical presence in.  I never get any complaints about the data syncing being slow.

However, I have run into a few issues from time to time.  For example, I had to give up on a variation of Kato's famous rate limiting feature - just search for it.  Too many times, I ran into problems with the rate limiting timestamp response being too slow and then the subsequent real post to a firebase node being rejected because it wasn't within the required time limit.  I've rolled a different solution that doesn't require this double posting.

Other than that one issue and very rare query/network slowdowns, I'm thrilled with the network efficiency of Firebase.  When I had the app running on my own server stack (with a very professionally hosted MongoDB provider), I rarely saw latency less than 500ms.  This was primarily due to : 1) overhead of HTTP for each request 2) I only had loads balanced across 2 access points to the API - all U.S. based.

I don't think the average "full stack" developer is going to be able to improve on what Firebase provides.  If you have the opportunity to move the db to Firebase, I'd jump on it in an instant.
Reply all
Reply to author
Forward
0 new messages