Dan
Dan

Reputation: 453

Firebase Concurrent Connection Usage

What our application does
For www.url1.com
1. There will be a admin who presents(slides) something to users from www.url1.com.
2. All users (there can be more than 100k+ at the same time) will access same URL to be on the same slide.
3. When admin clicks next, all users should see next slide.

Same can be with www.url2.com

We have implemented this and is working perfectly for 50 users.

My question is, is there any way that only admin will write and read data to firebase? we will store the firebase data in our database and users will read that data.

Upvotes: 0

Views: 195

Answers (1)

Dan Prince
Dan Prince

Reputation: 29989

You will need to implement some kind of authentication for your administrators. Thankfully, the Firebase team made this very easy for us.

Have a look at: https://www.firebase.com/docs/security/authentication.html

And more specifically, you will probably want to read: https://www.firebase.com/docs/security/simple-login-email-password.html

The Firebase Simple-Login library allows you to create accounts using Forge and then authenticate users over Firebase.

Next you need to update your security rules within Forge so that only authenticated users (admins) can write values, whilst anyone can read those values.

This can be achieved with a set of security rules that look like this:

{
  "slide-number": {
    ".read": true,
    ".write": "auth !== null"  
  }
}

This allows global access to reading the value within your slide-number child, but limits writing to only authenticated users.

Upvotes: 1

Related Questions