Firebase Retrieval using FireSharp or any other SDK

242 views
Skip to first unread message

Zaid Mirza

unread,
May 11, 2016, 10:32:49 AM5/11/16
to Firebase Google Group
Hi Scenario is,

Im new to Firebase, I have Structure my Data on firebase using Indices for maintaining relationshi as described in below articles
https://www.firebase.com/docs/web/guide/structuring-data.html
https://www.firebase.com/blog/2013-04-12-denormalizing-is-normal.html

I just want to clear my retrieval concept on firebase.

as mention in above links
{
  links: {
    link1: {
      title: "Example",
      href: "http://example.org",
      submitted: "user1",
      comments: {
        comment1: true
      }
    }

  }
}
when I access link1, response contains link1 data as well as comments: {comment1:true}. Instead of comment1 actual text, accessing link1 gives comment's ID i.e, comment1. its mean when I access link1, it gives me the Ids of comments belongs to that link. so I have to retrieve comments mannually requesting firebase again based on comments ids received in link1 response? Please clear my concept :  )

Frank van Puffelen

unread,
May 12, 2016, 5:59:34 PM5/12/16
to Firebase Google Group
Hey Zaid,

You would indeed need to write code that runs client-side to "join" the comments. Many developers with are used to server-side joins, based on their SQL background. But in NoSQL this is actually not all that uncommon.

A next common concern is the number of roundtrips the client-side join requires and how that will affect performance. For a reasonable number of items, the performance is actually quite good. This is because Firebase can pipeline all requests over it's open connection, instead of doing them one by one over potentially an equal number of HTTP connections. This so-called pipelining makes the entire operation much faster that you'd expect.


    puf
Reply all
Reply to author
Forward
0 new messages