absmach / magistrala

Industrial IoT Messaging and Device Management Platform

Home Page:https://www.abstractmachines.fr/magistrala.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: Service configuration

arvindh123 opened this issue · comments

Is your feature request related to a problem? Please describe.

No

Describe the feature you are requesting, as well as the possible use case(s) for it.

Service configuration helps to configure the service as per user need.

Indicate the importance of this feature to you.

Must-have

Anything else?

No response

Approach 1 :

Constraint Provider service is a new service
Entity service will check with constraint provider service before its operation

Example:

  • Entity service will check with constraint provider for limits before creation of entity
  • Messaging service will check with constraint provider for rate limits and message per second before the publish or subscribe of message.

image

In this approach , since constraint provider is a separate service, we can move them to API Gateway in future
image

Approach 2:

Constraint Provider as library , which can wrapped with service layer like logging and metrics .
Constraint Provider will be like a middleware. So when ever service request pass through constraint provider, it will check for constraint provided in configuration file.

Example:

  • Entity service constraint provider middleware will check for limits before creation of entity.
  • Messaging service will check with constraint provider for rate limits and message per second before the publish or subscribe of message.

image

Approach 3:

Constraint Provider implementation in Database as Trigger.
Whenever service starts, it should get configuration from source and create new trigger in database.

Common Spec for all approaches:

A configuration can be stored in

  • TOML file
  • Database
  • External System like Stripe

configuration should load to memory on start.
If there is any change in configuration source data, it should automatically update the configuration memory on the fly.