Comparing different "SQL over HTTP" APIs
davidgomes.com
davidgomes.com
1. I'm assuming all these HTTP API's use HTTP/2? 2. What is the real-world difference between using websockets and http for the Neon API?
How are they able to support transactions over HTTP?
Because of the Vitess layer we use, Vitess already has to maintain this with it's internal connection pooler and it knows which connections are bound in transactions on the underlying mysqld. And since Vitess is running "next" to mysqld on behalf of the client, the client is capable of being able to effectively pass around a session cookie with a reference to the in-progress session against the database.
So when the next request comes in, we're effectively saying "please use this bound session id", and vitess says "cool, we got a connection still going for you" and uses that reserved connection.
But tl;dr, it's fundamentally a design that Vitess enables us, and it's implemented effectively with bouncing a Session of state back and forth similar to a browser cookie.
Specifically this protobuf message: https://buf.build/planetscale/vitess/docs/main:vitess.vtgate...