swift - Firebase parallel queries -


i have firebase database of users, have field called active can true or false.

can firebase make parallel data accesses? i.e. faster retrieve data in 2 separate queries, or single?

e.g.

// load active users constants.firebase.usersref.queryordered(bychild: "isactive").queryequal(tovalue: true).observesingleevent(of: .value, with: {     (snapshot) in     self.loadactiveusers(snapshot: snapshot) })  // load inactive users constants.firebase.usersref.queryordered(bychild: "isactive").queryequal(tovalue: false).observesingleevent(of: .value, with: {     (snapshot) in     self.loadinactiveusers(snapshot: snapshot) }) 

versus

// load users constants.firebase.usersref.observesingleevent(of: .value, with: {     (snapshot) in     self.loadusers(snapshot: snapshot) }) 

where loadactiveusers & loadinactiveusers create 2 arrays, 1 active , 1 inactive users. , loadusers same (by splitting across active field).

all interaction between firebase database client , back-end goes on single socket connection. there no benefit parallelizing requests.

also see longer explanation of how requests sent: http://stackoverflow.com/questions/35931526/speed-up-fetching-posts-for-my-social-network-app-by-using-query-instead-of-obse/35932786#35932786


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -