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

GraphQL-native serverless backend with Fauna

Rob Sutter
December 08, 2021

GraphQL-native serverless backend with Fauna

Slides presented ahead of the workshop "GraphQL-native serverless backend with Fauna" at GraphQL Galaxy on 08 December 2021.

Rob Sutter

December 08, 2021

More Decks by Rob Sutter

Other Decks in Programming


  1. Confidential © Fauna, Inc. 2020 2 What is serverless? No

    infrastructure concerns Automatic scaling Highly available and secure Pay for value
  2. Confidential © Fauna, Inc. 2020 4 Serverless benefits Satisfy compliance

    requirements Reduce latency Minimal increase 
 in spending
  3. Confidential © Fauna, Inc. 2020 9 A smart API layer

    over Fauna Rob Sutter - @rts_rob - fauna.link/workers
  4. Confidential © Fauna, Inc. 2020 11 The Zen of Fauna

    Always use user-defined functions (UDFs). Compile only Login keys into clients. Compute on your data, don’t load data to compute. Hold onto your read access patterns loosely. Model your data as relational documents. Beware the single document hot write. Locks are an anti-pattern.
  5. Confidential © Fauna, Inc. 2020 13 • Abstraction of your

    business logic • Write once, run across every client, including GraphQL! • Solving all the other problems in this workshop becomes simpler with UDFs • Composition • Wrap even the simplest call to Create or Delete in a UDF Always use UDFs
  6. Confidential © Fauna, Inc. 2020 14 • Principle of least

    privilege • Clients can call a Login UDF • Sometimes they can also register a user • Every other permission is denied • Clients receive temporary tokens after logging in Compile only Login keys into clients
  7. Confidential © Fauna, Inc. 2020 15 What is serverless? 1.

    No infrastructure provisioning, no management 2. Automatic scaling 3. Highly available and secure 4. Pay for value
  8. Confidential © Fauna, Inc. 2020 16 Before we go Shadid

    Haque • [email protected] • @HaqueShadid
 Rob Sutter • [email protected] • @rts_rob Discord - fauna.link/discord Fauna Labs - fauna.link/labs Twitter - @fauna