For example when I use a SQLiteDatabase in android, it is generally not a good idea to open/close lots of SQLiteDatabase helpers. Instead it is better to create a sort of single
FirebaseDatabase
and DatabaseReference
objects can be considered relatively cheap references to the underlying resources.
The Firebase SDK manages such things behind the scenes. Only the first call to FirebaseData.getInstance()
will do the set up work, subsequent calls (within the same process) will simply re-use what was done already.