1 / 9

Compiled GraphQL as a Database Query Language

Compiled GraphQL as a Database Query Language. Predrag Gruevski. Kensho Knowledge Graph. “ Current CEOs of French banks that earned €1+/share last quarter?”. Kensho Knowledge Graph. “ Current CEOs of French banks that earned €1+/share last quarter?”. Under the hood:. Graph Database.

jesusj
Download Presentation

Compiled GraphQL as a Database Query Language

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Compiled GraphQL as a Database Query Language Predrag Gruevski

  2. Kensho Knowledge Graph “Current CEOs of French banks that earned €1+/share last quarter?”

  3. Kensho Knowledge Graph “Current CEOs of French banks that earned €1+/share last quarter?” Under the hood: Graph Database Relational Databases Timeseries Database

  4. Approach that does not scale “Current CEOs of French banks that earned €1+/share last quarter?” Product engineerwrites queries forall database backends Graph Database Relational Databases Timeseries Database

  5. An ideal solution “Current CEOs of French banks that earned €1+/share last quarter?” Domain ofproduct engineer declarative query Universal query layer graph databasequery SQL query timeseries query Domain ofinfrastructure engineer Graph Database Relational Databases Timeseries Database

  6. GraphQL to the rescue? Not quite. GraphQL can consolidate all data into a single schema, but its resolvers cause awful performance. Time Backend … 10^N round-trips later … Find all companies in France Find France Are theybanks? Get their current CEOs 😴 Backing databases

  7. Compile GraphQL to single database queries GraphQL query GraphQL compiler graph databasequery timeseries query SQL query Graph Database Relational Database Timeseries Database

  8. Why this works well • Product engineers focus on business logic • Database-agnostic: switching MySQL => Postgres has no visible impact • Fully declarative: ignorant of indexes, data sizes, join order… • Infrastructure engineers handle underlyingimplementation • Free to choose the best database for the job • Compiler ensures workarounds for database bugs are always in place • Compiler ensures proper semantics in tricky situations: • optional edges followed by required edges (outer join then inner join) • recursive edge traversals (recursive joins)

  9. Why this works well • Product engineers focus on business logic • Database-agnostic: switching MySQL => Postgres has no visible impact • Fully declarative: ignorant of indexes, data sizes, join order… • Infrastructure engineers handle underlyingimplementation • Free to choose the best database for the job • Compiler ensures workarounds for database bugs are always in place • Compiler ensures proper semantics in tricky situations: • optional edges followed by required edges (outer join then inner join) • recursive edge traversals (recursive joins)

More Related