tomper
tomper

Reputation: 737

Firebase performance - fetching nodes

Two firebase performance questions:

  1. Docs refer to flat data is best practice when constructing data. However, if I wish to retrieve a few nodes of data together (a JOIN query in SQL), this means a few network requests. Is Firebase optimizing such use case (in server/client side)? How?

  2. When fetching a specific node, using its full path, is there any need of indexing it? (Docs refer to actual queries, and I'm not sure this case applies as a query)

Thanks

Upvotes: 1

Views: 112

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598728

Doing a "client-side join" in Firebase is not nearly as expensive as you might expect. See this answer: Speed up fetching posts for my social network app by using query instead of observing a single event repeatedly

If you directly access the node (only calling new Firebase() and child()), no query is needed, so you won't need an index. If you're calling orderByChild() or orderByValue() you should add an index.

Upvotes: 1

Related Questions