Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Turbocharging scalability of GraphQL services with a Distributed SQL DB

AMEY BANARSE
February 21, 2020

Turbocharging scalability of GraphQL services with a Distributed SQL DB

GraphQL, with its roots in some of the biggest internet companies like Facebook, was created to simplify cloud-native application development without compromising performance or security. However, the ability to scale out on-demand, the need for high availability and tolerating cloud outages are omnipresent in cloud-native architectures. Hasura is a popular, open-source GraphQL engine that works on top of a PostgreSQL database to instantly give you a production-ready GraphQL API. However, vanilla PostgreSQL is not horizontally scalable or highly available. YugabyteDB, an open-source, distributed SQL database was built to support all PostgreSQL features with full wire-compatibility to address exactly these needs - massive scalability, high availability and geo-distribution of data. In this talk, we will look at what features are needed in a distributed SQL database to support a GraphQL engine like Hasura. We will also look at the open-source distributed SQL DB landscape, and how YugabyteDB has been optimized for scaling the Hasura GraphQL engine.

AMEY BANARSE

February 21, 2020
Tweet

More Decks by AMEY BANARSE

Other Decks in Technology

Transcript

  1. Turbocharging Scalability of
    GraphQL with Distributed SQL
    Amey Banarse
    Principal Data Architect, Yugabyte Inc.
    @ameybanarse

    View full-size slide

  2. 2
    © 2019 All rights reserved.
    Introduction
    2

    Amey Banarse
    Principal Data Architect, Yugabyte Inc.

    Pivotal ♦
    FINRA ♦
    NYSE
    University of Pennsylvania (UPenn)
    @ameybanarse
    about.me/amey

    View full-size slide

  3. Scaling GraphQL: What's the bottleneck today?
    HASURA
    App
    HASURA
    App
    HASURA
    HASURA
    App
    App


    View full-size slide

  4. 4
    Yugabyte Confidential © 2020 All rights reserved.
    A brief history of Yugabyte
    Builders of multiple popular DBs
    Part of Facebook’s Cloud-Native DB Evolution
    Yugabyte team dealt with this growth first hand
    Massive geo-distributed deployment given global users
    Worked with world class infra team to solve these issues
    Yugabyte founding team ran Facebook’s
    public-cloud scale DBaaS
    +1 Trillion
    ops/day
    +100 Petabytes
    data set sizes

    View full-size slide

  5. 5
    Yugabyte Confidential © 2020 All rights reserved.
    What is Distributed SQL?
    SQL &
    Transactions
    SQL
    Massive
    Scalability
    Geo
    Distribution
    Ultra Resilience
    A Revolutionary Database Architecture

    View full-size slide

  6. 6
    Yugabyte Confidential © 2020 All rights reserved.
    Open source, high performance, cloud native, distributed SQL database
    100% Apache 2.0
    Low Latency
    (Sub-ms)
    Kubernetes &
    Multi-Cloud

    View full-size slide

  7. 7
    Yugabyte Confidential © 2020 All rights reserved.
    Designing the Perfect Distributed SQL DB
    PostgreSQL more popular than MongoDB Aurora much more popular than Spanner
    bit.ly/distributed-sql-deconstructed
    Amazon Aurora Google Spanner
    A highly available MySQL
    and PostgreSQL-compatible
    relational database service
    Not scalable but HA
    All RDBMS features
    PostgreSQL & MySQL
    The first horizontally scalable,
    strongly consistent, relational
    database service
    Scalable and HA
    Missing RDBMS features
    New SQL syntax

    View full-size slide

  8. 8
    Yugabyte Confidential © 2020 All rights reserved.
    o YSQL - Fully relational SQL API that is
    wire compatible with PostgreSQL
    o YCQL - Optimized Cassandra Query
    Language API
    o DocDB
    – High-performance distributed
    Document store
    – Offers strong consistency and
    multi row ACID transactions
    Design Follows a Layered Approach

    View full-size slide

  9. Scaling out PostgreSQL with YugabyteDB

    View full-size slide

  10. 10
    © 2019 All rights reserved.
    All Nodes are Identical


    YugabyteDB
    Query Layer
    YugabyteDB
    Query Layer
    YugabyteDB
    Query Layer
    DocDB
    Storage Layer
    DocDB
    Storage Layer
    DocDB
    Storage Layer
    Can connect to ANY node
    Add/remove nodes anytime
    YugabyteDB Node YugabyteDB Node YugabyteDB Node
    HASURA

    View full-size slide

  11. Scaling out GraphQL services: Turbocharged
    HASURA
    App
    HASURA
    App
    HASURA
    HASURA
    App
    App
    r


    YugabyteDB Cluster

    View full-size slide

  12. 12
    Yugabyte Confidential © 2019 All rights reserved.
    Yugabyte Platform
    Demo

    View full-size slide

  13. 13
    Yugabyte Confidential © 2019 All rights reserved.
    What’s next for
    Yugabyte + Hasura?

    View full-size slide

  14. 14
    Yugabyte Confidential © 2020 All rights reserved.
    Building Geo-Distributed GraphQL services
    ● Scalable & Highly
    Available data tier
    ● Business Continuity
    ● Geo-Partitioning &
    Data Compliance

    View full-size slide

  15. 15
    © 2018 All rights reserved.
    Scaling Without Load Balancers
    Yugabyte Cluster Awareness for Hasura GraphQL
    Load Balancers
    Hasura Hasura Hasura
    Connection Pool
    Hasura
    r
    YugabyteDB Cluster

    View full-size slide

  16. Scalable, Distributed GraphQL Subscriptions
    ● Integrates with
    YugabyteDB Change
    Data Capture (CDC)
    ● Use Cases
    ○ Fraud Detection
    ○ Real Time
    Dashboards
    ○ Event Driven
    architectures
    Distributed
    DB Log
    Search Index
    Kakfa Streams
    GraphQL
    subscriptions
    Realtime Push
    notifications

    View full-size slide

  17. 17
    © 2019 All rights reserved.
    Join the community
    yugabyte.com/slack
    We stars!
    github.com/yugabyte/yugabyte-db
    We’re Hiring!
    bit.ly/yugabyte-careers

    View full-size slide

  18. 18
    Yugabyte Confidential © 2020 All rights reserved.
    The default database for the cloud
    Thank You!

    View full-size slide