spacecloud-io / space-cloud

Open source Firebase + Heroku to develop, scale and secure serverless apps on Kubernetes
https://space-cloud.io
Apache License 2.0
3.95k stars 222 forks source link

[Feature] Move syncman module to caddy #1626

Closed YourTechBud closed 1 year ago

YourTechBud commented 1 year ago

The problem faced currently?

Current implementation of syncman has multiple issues like:

  1. Several deadlocks are present which can cause SC to freeze
  2. Config management in all modules is not declarative which makes each module more prone to bugs

How can we solve it?

Migrate the core config management module to caddy.

Here's how we will go about:

  1. All our Providers (database / rpc / graphql) will be caddy apps.

    Each app will handle it's own Provisioning and CleanUp phases. Caddy will be resposible to call the appropriate hooks as and when config changes. Caddy also has built in helpers to create stickly objects for things like database connections to prevent reloading them on every config change.

    Each provider will provide a specific piece of functionality like GraphQL Engine, Database & `RPC.

  2. All configuration objects (Sources) will be caddy modules belonging to the Source Manager App.

    Each source is a caddy module in the source namespace. The Source Manager app will be responsible to:

    1. Provision the source (E.g. initialise a database driver) 
    2. Distribute the source objects to the applicable providers. A source will define which providers it is meant for and will have to implement the appropriate interfaces that the provider requires.

If you want this feature to be implemented, give it a thumbs up reaction, so that we can determine which features are important to you. 👍