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

ダイニーにおける本番 Hasura 運用

ダイニーにおける本番 Hasura 運用

Hasura と共に歩んだ一年と半年を振り返りつつ、どういったプロダクト・組織において Hasura を採用するべきか、採用すると何が起きるかについて説明します。

Hiroaki KARASAWA

November 24, 2021
Tweet

More Decks by Hiroaki KARASAWA

Other Decks in Programming

Transcript

  1. Hasura
    dinii aka karszawa
    UIT meetup vol. 14
    2021 11 24

    View full-size slide

  2. ΞδΣϯμ
    2
    1. Hasura
    2.
    3. Hasura
    4. Hasura N
    5.
    q Hasura

    View full-size slide

  3. ࣗݾ঺հ
    3

    ほ aka @karszawa
    ま dinii


    ま JavaScript TypeScript

    View full-size slide

  4. Hasura ͱ͸
    5
    ま Hasura
    ま PostgreSQL GraphQL
    ま GraphQL

    View full-size slide

  5. Αࠞ͘ಉ͞ΕΔʢʁʣ֓೦ͱͷ੔ཧ
    6
    ま vs GraphQL
    ほ GraphQL is
    ほ GraphQL
    ち Hasura
    ま vs Hasura Cloud
    ほ Hasura Hasura
    ほ dinii Cloud Run OSS Hasura
    ち OSS Hasura
    ま vs Prisma
    ほ Prisma is GraphQL ORM

    View full-size slide

  6. μΠχʔͱ͸
    8
    ま 2020 1
    ま 3 6
    ほ Vertical SaaS
    Ϩδ ΩΦεΫ ΩονϯσΟεϓϨΠ
    μογϡϘʔυ ϋϯσΟ
    ϞόΠϧΦʔμʔ
    ϓϦϯλ࿈ܞ
    ࣗಈ௼મػ࿈ܞ
    ϓϦϯλ࿈ܞ
    LINE Mini App

    View full-size slide

  7. ϙΠϯτ
    9


    ほ Node.js

    ほ IF GraphQL
    ほ Hasura

    View full-size slide

  8. ͍ͭ Hasura Λ࠾༻͢Δ΂͖͔
    11
    1. ろろろ
    2. ろろ
    3. ろ PostgreSQL

    View full-size slide

  9. ͍ͭ Hasura Λ࠾༻͢Δ΂͖͔
    12

    ま dinii
    ま Firebase & Firestore
    ほ NoSQL

    View full-size slide

  10. ͍ͭ Hasura Λ࠾༻͢Δ΂͖͔
    13
    ま = IF




    Hasura


    View full-size slide

  11. ͍ͭ Hasura Λ࠾༻͢Δ΂͖͔
    14
    PostgreSQL
    ま PostgreSQL
    ま MySQL
    ほ PostgreSQL Citus
    ま PostgreSQL
    ま PostgreSQL

    View full-size slide

  12. ຊ൪ Hasura ӡ༻ͷצॴ
    16
    1.
    2. Remote Schema
    3.

    View full-size slide

  13. ຊ൪ Hasura ӡ༻ͷצॴ
    17
    ま ORM Hasura
    ほ Hasura

    ま Hasura Web UI Hasura
    ほ Hasura
    ま TypeORM Hasura CI

    View full-size slide

  14. όοΫΤϯυͷ TypeORM ͷܕఆٛͱ Hasura ͷϚΠάϨʔγϣϯϑΝΠϧʹ੔߹ੑ͕͋Δ͜ͱΛ CI Ͱ֬ೝ͢Δํ๏
    18
    1. Hasura Web UI
    2. TypeORM
    CI
    1. Hasura
    2. TypeORM
    3. = Hasura TypeORM ❌

    = Hasura TypeORM ✅

    View full-size slide

  15. ຊ൪ Hasura ӡ༻ͷצॴ
    19
    Remote schema

    ほ Remote schema
    ほ Remote schema

    ほ Remote schema
    ほ Hasura

    View full-size slide

  16. ຊ൪ Hasura ӡ༻ͷצॴ
    20

    ほ Hasura
    ほ JWT
    ち ex: x-haura-shop-id=xyz JWT order.shopId=xyz order
    ま order.user.userId = xyz

    ほ Remote schema

    View full-size slide

  17. ຊ൪ Hasura ӡ༻ͷצॴ
    21
    ま Introspection Hasura schema.gql
    ま = GraphQL Codegen

    View full-size slide

  18. ͦͷଞͷצॴ
    22
    Hasura Web
    ま GraphiQL


    ま REST Remote schema Hasura
    Actions
    ま Remote schema

    Event Trigger

    View full-size slide

  19. ·ͱΊ
    24
    1. Hasura
    2. dinii 3 SWE
    3. 3 1
    ま https://about.dinii.jp/recruit
    ま 3
    ま 1 1 3

    View full-size slide