Does Firebase support batch operations in REST API?

1,013 views
Skip to first unread message

atomd

unread,
Oct 23, 2014, 12:43:40 AM10/23/14
to fireba...@googlegroups.com
In server side, I want to POST data to each user, and I have to POST data for too many times.
Does Firebase support batch operations in REST API?

Michael Wulf

unread,
Oct 23, 2014, 12:46:14 PM10/23/14
to fireba...@googlegroups.com
Hi there!

You can do some "batchy" operations using the PATCH method. Note that this is not a recursive operation, so you would need to set the entire user object at each key you provide, but it would allow you to send a set of user ids all at once.

If you find that there is some portion of the data you are frequently editing, you may want to flatten that into its own path. Then it should be fairly easy to use the update command to perform bulk operations.

As an alternative to bulk writes, you may also want to utilize a keep-alive header, which will reduce the overhead considerably by re-using the connection to the server. For smaller write operations (less than hundreds a second or less than MB of data) this can be plenty performant.

Cheers,
Kato


On Wed, Oct 22, 2014 at 9:43 PM, atomd <dwb...@gmail.com> wrote:
In server side, I want to POST data to each user, and I have to POST data for too many times.
Does Firebase support batch operations in REST API?

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rachel Willmer

unread,
Mar 30, 2015, 10:52:22 AM3/30/15
to fireba...@googlegroups.com
How about bulk reads? I have a bunch of endpoints which I want to get as efficiently as possible; they're the result of a search so I can't predict in advance what they will be.

I'd like to do just one REST GET to grab them all rather than a single GET for each; is this possible?

Rachel

Greg Soltis

unread,
Mar 30, 2015, 1:11:22 PM3/30/15
to fireba...@googlegroups.com
Hi Rachel,

There is not currently a way to fetch multiple independent locations in a single REST request. You can, however, pipeline multiple GETs over a single tcp connection, which will at least save you some overhead.

Hope that help!

-Greg

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages