Question: As a Computer Science student, I was recently introduced to process scheduling and how the processes are commuted to share the systems resources.

I am considering creating an iOS app which uses users position to notify them about nearby events and I'll use Firebase frameworks. The thing is, this is more of a hobby for now and I am not willing to spend any money unless I see the app growing and I would like to know if it is possible to commute user Logins so that no more than 100 users are logged in at a time and so that users don't have to log in every time they open the app. Is this possible or even legal?

```
pseudo-code

maxUsers = 100
currentUsers = 0

if(user_requests_login){
    if(currentUsers < maxUsers){
        logIn()
    currentUsers++
}
else
    wait_on_logout    //semaphore like wait (until currentUsersDecreases)
}

if(user_is_idle){
    logOut()            //keeping track of users info so that we can logIn again without users typing in credentials (like a cookie?)
    currentUsers--
    //another user can now logIn 
}

```

Answer: 
You seem confused about the limits on Firebase's free/spark plan. There is no limit to how many users can be signed in to Firebase, on the free plan or either of the paid plans. 

But there is a limit on how many users can be connected to the Firebase Realtime Database at any one moment. On the free/spark plan that limit is 100.
yes it is possible to schedule logins in firebase apps. it will depend on your app logic. you set a maximumUser variable and check with that before signing a user in and when the maximum is reach, disable the signin function or button.
you can also use sessions to keep track of the users currently loged in