When you work with Firebase data (read, write ...) in an Android application, you need to get a link to firebase in order to be able to process the data.
Since the Firebase link is a JSON tree, if you specify the root of the tree, you can always refer to the child, no matter how deep.
Question: what is the best for memory and latency for processing this link in code?
1 / Create a static Firebase for the root in the application.
MyApplication.getFirebaseRootRef().chid(C1).chid(C11).setValue(...);
2 / Create a new firebase ref for baby C11
Firebase ref = new Firebase("https://your.firebaseio.com/C1/C11"); ref..setValue(...);
3 / Hybrid
Firebase ref = new Firebase("https://your.firebaseio.com"); ref.child(C1).child(C11).setValue(...);
4 / Hybrid 2
Firebase ref = new Firebase("https://your.firebaseio.com").child(C1).child(C11); ref.setValue(...);
Is there a difference in performance?
Maybe you can have some tips for easy reading and maintenance?
source share