Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Naming Convention for Firebase Platform Realtime Database

Question:
Beside this piece of documentation Firebase has on Realtime Database, is there any other documentation available?
Is there a set of preferred naming conventions for Firebase Realtime Database entities such as databases, and field names?

For instance:

  • Database uses the word in singular and end with the “db” suffix.
  • They are lower case.
  • Document fields for instance camelCase, userName, firstName, lastName, et cetera.

I looked online and here (StackOverflow) but I could not find much beside the one already mentioned. Any external links will be helpful.

like image 821
Red M Avatar asked May 01 '18 01:05

Red M


People also ask

What is the correct Firebase database structure?

All Firebase Realtime Database data is stored as JSON objects. You can think of the database as a cloud-hosted JSON tree. Unlike a SQL database, there are no tables or records. When you add data to the JSON tree, it becomes a node in the existing JSON structure with an associated key.

What type of database is Firebase Realtime Database?

The Firebase Realtime Database is a cloud-hosted NoSQL database that lets you store and sync data between your users in realtime.

Why is Firebase called Realtime Database?

The Firebase Realtime Database lets you build rich, collaborative applications by allowing secure access to the database directly from client-side code. Data is persisted locally, and even while offline, realtime events continue to fire, giving the end user a responsive experience.

Does Firebase have schema?

Firebase security rules, this video does an amazing job explaining them, are a way in which you can sort of create schemas. An important consideration when using these rules is that if you're using the Firestore Admin SDK (used for backend code) then your rules will be bypassed.


1 Answers

The Firebase Database infers no meaning to how node names are spelled, beyond disallowing certain characters as outlined in the documentation.

The Firebase team typically names nodes on collection level as plural (e.g. users, posts, items) and individual properties as singular (e.g. name, title, price). But this is a matter of preference, and does not influence how the database functions.

like image 199
Frank van Puffelen Avatar answered Sep 21 '22 12:09

Frank van Puffelen