graphql-schema-registry icon indicating copy to clipboard operation
graphql-schema-registry copied to clipboard

Make Redis Optional

Open jon-frankel opened this issue 3 years ago • 2 comments

Hello! We are in the process of setting the Schema Registry for our federated gateway. It's been fairly easy and straightforward so far.

It appears that Redis is only ever used by the persisted_queries utility. If this endpoint/type is never used, then there is no need to have Redis running alongside the schema registry.

It is also not clear from the documentation how this endpoint is meant to be used, as the APQ option in Apollo does not include a REST or separate GraphQL API as an option for a cache layer. I'm not really sure what the use case is for this endpoint.

At any rate, the service is able to run without Redis, but calling the persisted_queries results in the request timing out. Perhaps we could have a flag to exit early from that endpoint and return a 404?

Thank you!

jon-frankel avatar Jan 10 '22 22:01 jon-frankel

hey. You are right, redis is not critical dependency and can be ommited. Automatic persisted are an apollo feature and yes, we don't have an example how exactly to use it. But basically, you can pass custom class to apollo server that will implement cache get/set and instead of using redis, it can make requests to schema-registry that would manage these things.

You can make a PR to ignore redis in those endpoints. It was meant for performance (to avoid going to DB)

tot-ra avatar Jan 10 '22 22:01 tot-ra

Thanks for the insight. I may open a PR, though since it works fine as-is without Redis, this is low on our priority list for now.

jon-frankel avatar Jan 11 '22 17:01 jon-frankel