Access crate via HTTP or via PostgreSQL

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.


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.

Here is an example on how you can achieve launch using a different technology/language, node.js/javascript.

Happy days!