performance. Doing comparison of medium text (schema as input) against medium text (stored schema) seems like a costly operation in mysql.. especially if you have a lot of schemas registered over time.
sometimes there are extra whitespaces & tabs that make schema not well formatted
if service changes even a whitespace character, then it is considered as new schema
3.1 if we would add another variable column (lets name it meta with type JSON to the schema) that could contain extra data, like query cost or access controls, then uniqueness check would become even more complex
Suggested solution
add UUID column that would be a hash of unique features (type_defs, meta etc), calculate value by hashing type_defs
Problem definition
Currently, whatever service tries to register as its schema, is directly stored in DB https://github.com/pipedrive/graphql-schema-registry/blob/master/src/database/schema.ts#L259
The problem is that
meta
with typeJSON
to the schema) that could contain extra data, like query cost or access controls, then uniqueness check would become even more complexSuggested solution
UUID
column that would be a hash of unique features (type_defs, meta etc), calculate value by hashing type_defsRelated Issues
106