Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic configuration for big number of schemas #456

Open
inf-initely opened this issue Aug 18, 2023 · 3 comments
Open

Dynamic configuration for big number of schemas #456

inf-initely opened this issue Aug 18, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@inf-initely
Copy link

Currently, we host a big number of schemas (about ~700) which are equal in structure and version.
The problem is when we try to configure the tables. Even with simpler configuration:

Tables: []core.Table{
	{
		Name:   "news",
		Schema: "99_99_99_9999",
		Columns: []core.Column{
			{
				Name:       "user_id",
				ForeignKey: "99_99_99_9999.users.id",
				Primary:    true,
				Array:      false,
				Type:       "integer",
			},
		},
	},
},

when duplicated to 700, will of course just wasting memory than needed when in actuality, what you really need to change is
the schema's name.

Same problem with configuring RoleTable.

What would you like to be added:

New option to load configuration dynamically in runtime. That way, end-user can exchange memory usage with cpu usage.

Or, at least a way to solve problem for end-user with big number of schemas that want to reduce memory usage, if this is not possible.

Why is this needed:

For cases like above, and also when you need to dynamically load or change configuration in runtime.

@inf-initely inf-initely added the enhancement New feature or request label Aug 18, 2023
@noobmaster19
Copy link

Hey! Will this be worked on? I also require a way to load the configurations dynamically as i'm dealing with a multi-tenancy application with different schemas.

@dosco
Copy link
Owner

dosco commented Sep 10, 2024

You can use it as a library and dynamically provide the config you need when creating a new GraphJin or GraphJinServ instance. You can figure out what schemas are needed based on some other logic and then create a config with just those

@noobmaster19
Copy link

Hey! Thanks for replying :) however, (do correct me if i'm wrong) the nodejs wrapper seems to not allow this because it reads the FS based on the configPath only. I know the configuration can be an object, but not for the other files like data.graphql and the queries folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants