Skip to content
Marcus Henriksson edited this page Jul 26, 2023 · 1 revision

Payloadbuilder

  1. What Is Payloadbuilder?
  2. What Is Payloadbuilder For?
  3. How Does Payloadbuilder Work?

What Is Payloadbuilder?

Payloadbuilder is a minimal library aimed for enable SQL access on top of various datasources. A simple query enginle with a query planner that provides support for joining data from different datasources, also building payload for example to an e-commerce solution.

Payloadbuilder was initial built to solve providing payload to an e-commerce solution who's underlying datasource (Elasticsearch) did not support SQL. The e-commerece platform had a lot of different runtime criterias like country, language, pricelists etc. which made Elasticsearch kind of troublesome to use natively, there was a lot of manual coding on top of Elastic to solve all these criterias. And then the idéa about a layer above elastic that could enable SQL-like syntax for joining data was the starting point of Payloadbuilder.

What Is Payloadbuilder For?

Payloadbuilder can be used as a library to provide payload to services that stores it's data in a non natively SQL engine where SQL is desiered for ease of use.

It can also be used as an ad-hoc query tool. See Queryeer which is a Swing IDE that utilizes Payloadbuilder as the library for doing queries against datasources.

How Does Payloadbuilder Work?

Payloadbuilder makes use of registered Catalogs (pluggable datasource implementations) to build an executable query plan. Catalogs can provide different building blocks like Scalar functions, Table valued functions, tables with schema and indices etc.

Each registered Catalog is assigned an alias which is then used in the SQL query to distinguish between datasources.

Ie. Here two Catalogs has been utilized in a simple INNER JOIN query.

SELECT *
FROM es#_doc d
INNER JOIN jdbc#purchase p
  ON p.orderId = d.orderId