# When connecting from cloudfunctions/cloudflareworkers: Should I use gRPC JS Client, HTTP JS Client, or cURL http API

**URL:** <https://discuss.dgraph.io/t/when-connecting-from-cloudfunctions-cloudflareworkers-should-i-use-grpc-js-client-http-js-client-or-curl-http-api/15917>\
**Category:** Dgraph Cloud\
**Tags:** kind:question\
**Created:** [October 30, 2021, 3:08pm UTC](https://discuss.dgraph.io/t/when-connecting-from-cloudfunctions-cloudflareworkers-should-i-use-grpc-js-client-http-js-client-or-curl-http-api/15917 "2021-10-30T15:08:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juri](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/juri/32/8872_2.png) [@Juri](https://discuss.dgraph.io/u/Juri)\
**Post date:** [October 30, 2021, 3:08pm UTC](https://discuss.dgraph.io/t/when-connecting-from-cloudfunctions-cloudflareworkers-should-i-use-grpc-js-client-http-js-client-or-curl-http-api/15917/1 "2021-10-30T15:08:49Z")

</div>

Hi,  
I am using Cloudflare Workers to access dgraph cloud.  
What’s the best most performant way to do that?

Should I use gRPC JS Client, HTTP JS Client, or cURL http API?

Of course every option of these 3 work fine, but I ask in terms of optimization, which of these 3 will give me the best results.

I think it will be gRPC because it’s faster due it operating on the binary level, but are there really no drawbacks?

thanks a lot

---

<div class="post-metadata">

**Author:** ![iluminae](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/iluminae/32/7367_2.png) [@iluminae](https://discuss.dgraph.io/u/iluminae)\
**Post date:** [October 30, 2021, 3:15pm UTC](https://discuss.dgraph.io/t/when-connecting-from-cloudfunctions-cloudflareworkers-should-i-use-grpc-js-client-http-js-client-or-curl-http-api/15917/2 "2021-10-30T15:15:50Z")

</div>

The advantage of grpc is using protobufs which will help with decoding times on larger messages, but since all the endpoints are unary, there is not a big difference in operation.

I would say, do whatever feels right in your code. Probably not the raw http API as it will be harder to maintain in case of changes.
