Clarify the Firebase connections

后端 未结 2 722
灰色年华
灰色年华 2020-11-28 23:23

I am a little confused about the Firebase pricing model, special concern is the connections or more precisely concurrent connections.

Let\'s have an example of a mo

2条回答
  •  春和景丽
    2020-11-29 00:02

    In your first scenario - the short answer is yes. As long as your users keep the screen on where you have a Firebase connection that allows them to comment/read comments - you will have one concurrent connection per screen.

    In your second scenario - this depends on how you develop your app. The Firebase API does provide you with the goOffline and goOnline methods (https://www.firebase.com/docs/ios-api/Classes/Firebase.html#class_methods) which give you control over your connection. If you want to go offline for 5 minutes, then briefly come back online to check scores and then go offline again, then you'd only hold a connection for a short duration.

    Concurrent connections are just that - connections established at the same time. So if you have 3 people using your app to check scores, but user 1's app goes online at 12:00 PM and the connection lasts for 5 seconds, then user 2's app goes online at 12:01 PM for 5 seconds, and user 3's app goes online at 12:02 PM for 5 seconds then you've only ever had 1 concurrent connection.

    If on the other hand, all 3 users' apps go online at 12:00 PM for 5 seconds then you'll have 3 concurrent connections.

    You could potentially use this same goOffline/goOnline strategy with your first scenario, but that may detract from the experience if your users are expecting to be chatting about a game in near real-time.

提交回复
热议问题