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

Upgrade schema information retrieval and caching #15179

Open
rijkvanzanten opened this issue Aug 19, 2022 · 1 comment
Open

Upgrade schema information retrieval and caching #15179

rijkvanzanten opened this issue Aug 19, 2022 · 1 comment

Comments

@rijkvanzanten
Copy link
Member

Currently, we introspect the whole schema on the first request, and store the result in the cache. This cached schema overview object is then passed around to all the services so they can rely on the schema information in operation.

This comes with a handful of downsides:

  • Introspecting the database schema fresh can take quite a while
    Depending on the database vendor used, it can take anywhere from 30ms to 1.5 seconds to introspect the full database schema. Even though we heavily cache it, that's a non-trivial amount t of time to wait for the schema to be known
  • The output schema object is pretty big. Depending on your schema, the overview object can easily be over half a million characters, which in turn causes:
  • Caching is very fast for smaller chunks of data with large read/write ops. However, storing a single massive value can easily cause bottlenecks it the connection to/from the caches
  • The full schema is read even when it's not needed / only partially used

To improve on this, we should:

  • Introspect (and cache) parts of the schema when they're actually requested, rather than all ahead of time
  • Store the schema information in smaller chunks (eg per collection / field) in the caches
@rijkvanzanten
Copy link
Member Author

Linear: ENG-205

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants