# Access crate via HTTP or via PostgreSQL

**URL:** <https://community.cratedb.com/t/access-crate-via-http-or-via-postgresql/228>\
**Category:** CrateDB\
**Created:** [June 7, 2019, 5:36pm UTC](https://community.cratedb.com/t/access-crate-via-http-or-via-postgresql/228 "2019-06-07T17:36:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![metase](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@metase](https://community.cratedb.com/u/metase)\
**Post date:** [June 7, 2019, 5:36pm UTC](https://community.cratedb.com/t/access-crate-via-http-or-via-postgresql/228/1 "2019-06-07T17:36:56Z")

</div>

I’ve asked this before and wasn’t quite sure on the answer but is it better to connect to crate via posgresql or via http endpoint? I have concluded some tests and it seemed that HTTP was quicker, but in some cases postgres was quicker once the connection was opened. I believe Dominic may have suggested HTTP was a better option but I’m just wondering if there were any changes to this at all.

---

<div class="post-metadata">

**Author:** ![miguel.arregui](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/miguel.arregui/32/126_2.png) [@miguel.arregui](https://community.cratedb.com/u/miguel.arregui)\
**Post date:** [May 31, 2020, 6:14pm UTC](https://community.cratedb.com/t/access-crate-via-http-or-via-postgresql/228/2 "2020-05-31T18:14:54Z")

</div>

Hi,

Long time no hear, I hope you are well.

What is your use case?, what are you trying to do?.

Under the scenes both protocols’s purpose is to serialise and send to and receive from CrateDB queries and result-sets. Each protocol has it’s own overhead, but the differences are small from my own experience. Also, a lot of the performance can be milked through improving the original query, or by batching inserts, and other techniques that have nothing to do with the choice of protocol.

Here is an example of how you can interact [using java](https://community.cratedb.com/t/how-can-i-connect-to-cratedb-using-jdbc/400/4).

Here is an example on how you can achieve launch using a different technology/language, [node.js/javascript](https://github.com/crate/crate-qa/tree/master/tests/client_tests/node-postgres).

Happy days!
