Support JSON-formatted SQL query responses for easy tool integration
We've heard this request on occasion from customers, and it's easy to see that it would be a useful capability. The SQL/introspection capabilities are here to stay and we'll likely want to use them directly from the front-end, too. The ability to serve resultsets in JSON will make it easier to integrate into customer tools and do ah-hoc scripting and automation.
There are two potential paths we could take:
- generate JSON server-side: this is costlier than just serving the arrow binary encoded data but it would make it trivially easy to use simple tools such as
curl&jqto process results - alternatively, document how to use https://arrow.apache.org/docs/js/ and possibly offer a Restate-specific convenience client in the SDKs to handle the decoding on the client-side
- as an aid to ad-hoc automation building, we could also incorporate a "scripting mode" in the Restate CLI which allows customers to easily pipe the output of
restate sqlinto other tools
- as an aid to ad-hoc automation building, we could also incorporate a "scripting mode" in the Restate CLI which allows customers to easily pipe the output of
Particularly in a multi-tenant environment, we would strongly prefer to save server resources and offload more of the work to the client, as long as the development experience isn't badly compromised. Let's use this issue to discuss the tradeoffs and settle on a direction, even if we don't immediately implement it.