I'm learning to work with Firebase and want to understand the differences of setting up their cloud database. From the docs, you can connect to this db through the following:
With the first four options (iOS, Android, Web and Server), you download the Firebase SDK and use that to connect to the database. So in each case you have a library from Firebase that handles the connection, synchronization and that builds a client-side presentation of the data model.
When you're using the REST API, you're directly talking to the Firebase Database from your client. One advantage is that this works from any platform than can make HTTP calls. A disadvantage is that you don't have an SDK, so you will have to write all client-side code to handle the connection and data synchronization.
The simplest example of the REST API is always to find a piece of data in your database. You can find the URL of that data at the top of the Database panel in the Firebase Console, for example
https://stackoverflow.firebaseio.com/39905374. Now if I add
.json at the end of that path, I get the full URL for the REST API for that data:
If I open this URL in a browser tab, it fires a HTTP GET request and retrieves data:
That is the JSON data in that path of my database.
To learn how to use the REST API to manipulate the data, read the Firebase documentation: https://firebase.google.com/docs/database/rest/start