building-envelope-data / api

API specification to exchange data about building envelopes
MIT License
3 stars 1 forks source link

Develop a concept how Methods as a Service can be implemented in the network of databases #289

Closed christoph-maurer closed 8 months ago

christoph-maurer commented 1 year ago

IBP has many methods implemented, but not yet accessible via the API of buildingenvelopedata.org.

simon-wacker commented 1 year ago

Are the methods accessible as services through any API at the moment?

In general, there are generic API endpoints or queries/mutations to login, to schedule computation tasks, to ask whether tasks are finished, and to fetch results. And there are method specific endpoints or queries/mutations for example to provide the exact data sources and meta information the method needs to run. The generic part could be standardized across different providers of methods as a service, which would make it easier for frontends to interact with those services. Alternatively, the metabase could delegate requests to providers --- then the providers could have different endpoints and the metabase unifies them (this is in general not possible).

How shall the data be transferred? Shall a user download it from somewhere and upload it to the service, where it needs to be stored until it gets processed. Or shall the user just supply the URL of for example an HTTPS resource that can be fetched via a simple GET request and the service downloads the data from there ones it needs it? Or shall both options be possible?

christoph-maurer commented 1 year ago

Are the methods accessible as services through any API at the moment?

I ask IBP.

How shall the data be transferred? Shall a user download it from somewhere and upload it to the service, where it needs to be stored until it gets processed. Or shall the user just supply the URL of for example an HTTPS resource that can be fetched via a simple GET request and the service downloads the data from there ones it needs it? Or shall both options be possible?

The option to supply only the URL of HTTPS resources has a high priority. The option to upload data sets has a low priority, because we can upload data sets until then to the TestLab DB in order to use them as source for methods.

simon-wacker commented 1 year ago

Microservices are en vogue these days and they seem to fit our needs: Introduction to Microservices and APIs. The same website Patterns of API Design lists hopefully-proven design patterns to common problems. It thereby does not only list the patterns in a structured way but also sensitizes for common problems we may encounter. There is also a short introduction by Azure Microservice architecture style (the other sites in the same chapter explain other architectures).

If the microservices are exposed through REST APIs, then the API can be specified succinctly with OpenAPI. Some words on microservices connected with OpenAPI and its tooling: Microservices & Kubernetes: Achieving functional and operational consistency with OpenAPI, What are Microservices?, and Microservices Guide.

Microservices come with challenges and disadvantages (see the above articles). So, it is not advisable to use microservices everywhere but only where they solve a problem that we have.

And just to get a sense of previous approaches to make web services usable: List of web service specifications.

christoph-maurer commented 8 months ago

The next step is https://github.com/building-envelope-data/database/issues/50 .