I'm building a web application using Firebase that takes the same data and presents it in two different ways - in a list and as an markers on a google map.
Right now, in each view - map or list - I have code to query data from firebase, merge it together, and display it. Instead, I'm considering this plan: on startup, query the data, merge it, and save it all into an array that I pass from view to view.
In a sense, I am "caching" the firebase data in an array. This isn't ideal in one sense - cached data isn't as up-to-date as directly querying Firebase. On the other hand, I only call Firebase once.
Does this make performance sense? Does reading data from a Firebase take within the same order of magnitude time as reading data from an array?