Data-Web Gateway

It's like GraphQL, but instead of the GraphQL language, you use SQL

With Microprocess Architecture, the only interface for anything is the database, even for the client application - it only interfaces with tables via direct SQL. The web used to only talk to database via custom middleware code. There's quite a simple solution, make direct database querying possible. The Data-Web Gateway makes this possible.

This is not called "Database-Web Gateway" on purpose. "Database" is too strongly linked to a relational database server. The ideal "Data-Web Gateway" would act as a gateway to entities in different kinds of databases, ideally with a single query language that can be dispatched to work with different collections that work with specialised storage engines each.

Authorisation with JSON Web Tokens (JWT)

A phantom user is created in the target database where security can be controlled
  • A JWT is used for authorisation from an external provider

  • A user record is created that MAY contain additional fields, and complex relationships for record-restrictions via VIEWS

  • A phantom user is created in the database, with a name that contains the user record ID as well as the session ID

  • (The role claims in the JWT MAY BE mapped to roles in the database)

A Web User-Impersonated SQL Connection

Using the Phantom User to connect to the database, only authorised SQL can be run

With this simple idea, the Data-Web Gateway lets a javascript based application talk directly with the database.

This means:

  • The database takes care of security

  • There is no middleware logic needed between a client application and the database