Firebase provides flexible security rules with a JavaScript-like syntax, as this helps to structure our data and index the frequently used data. Security rules are integrated with Firebase authentication, which helps to define read and write access based on the user. In this chapter, we will add security rules for users and chat nodes to our Firebase database. Firebase security rules provide a nice simulator to check new rules before releasing them into production. We will also index our user's and their friends data for faster queries. Finally, we will deploy our application to the Firebase server. We will set up a different deployment environment so that we can test our application in the staging server and then deploy the application to the production server.
In this chapter, we will cover the following topics:
- Introducing Firebase security
- Adding security rules for users
- Adding security rules for chat messages
- Indexing users and their friends
- Setting...