SlideShare a Scribd company logo
FaunaDB - Functional NoSQL
Conor Farrell, Lambda Lounge March 2019
Overview
- What’s NoSQL?
- Distributed DB basics
- FaunaDB
- Fauna Query Language (FQL)
- Demo!
- Questions
NoSQL
- AKA Not Only SQL
- Common usecases: real-time, big data
- K-V, document store, graph…
- Generally scale horizontally
- Store data based on its access patterns, in contrast to relational
NoSQL compromises
- Many do not provide ACID guarantees
- BASE (basically available, soft state, eventually consistent) guarantees
- Consistency (in the CAP sense) usually loses out, though not always
- PACELC!
Distributed system consensus
How can we reach agreement across nodes, given that they may fail or become
unreachable?
- Paxos
- Google Spanner, Neo4J
- Raft
- Consul, FaunaDB
Consensus algorithms formally proven (TLA+)
Consistency models
Calvin transactional protocol
- 2012 paper by Thomson et al
- Transaction scheduling and data replication layer
- Separate ordering transactions from executing transactions
- Deterministic ordering -> execute transactions in parallel across replicas
- Linear scaling, no single point of failure
- Clock skew doesn’t matter, so no need for atomic clocks (Spanner)
Calvin transactional protocol
However, there’s a price!
- Transactions can’t happen interactively
- Transactions must be pure
- Minimum latency as transaction window must finish
FaunaDB
- Multiple paradigm NoSQL (document, relational, graph)
- Each transaction is a single query expression
- ACID guarantees, snapshot isolation to strict serializability
- Serverless (generally) pricing model
- Used by nVidia, Nextdoor & others
FaunaDB Transactions
- Uses Calvin + Raft
- Coordinator node chooses a snapshot time with which to make read
requests.
- If there are writes, a commit phase starts. Reads include last update
timestamps -> optimistic lock acquisitions.
- Read timestamps + writes committed to transaction log.
- Transaction resolution in parallel across data partitions.
- A transaction is committed and durable if no concurrent write to any read
values has occurred.
Fauna Query Language (FQL)
In SQL terms:
Schema ~=> Database
Table ~=> Class
Row ~=> Instance
Fauna Query Language (FQL)
Can do the usual things like creating a database (schema) and class (table)
CreateDatabase({name: "employees"})
CreateClass({name: "office"})
Note that class structures are not defined at create time!
Fauna Query Language (FQL)
If all members of a class should share a property, we can add an index.
CreateIndex({
name: "office_by_id",
source: Class("office"),
terms: [{ field: [ "data", "id" ] }],
unique: true
})
Fauna Query Language (FQL)
We can also use lambda functions inside an FQL expression
Map(Arr("MCR","LON","NYC"),
Lambda("office_id",
Create(Class("office"), {data: "id", Var("office_id")})))
This will create three offices for us.
Fauna Query Language (FQL)
Plus other ‘traditional’ programming concepts like:
- Let-bindings
- If statements
- Filter/map/foreach/take
Expressive enough to capture business logic in a database transaction.
FaunaDB Demo
- Start a local cluster (can use cloud too)
- fauna shell to interact with it
Thank you!
Questions?

More Related Content

PPTX
Introduction to Fauna
PDF
Making Structured Streaming Ready for Production
PDF
Cloud native application 입문
PDF
AWS 활용한 Data Lake 구성하기
PDF
Introduction to big data and apache spark
PDF
From Zero to Hero with Kafka Connect
PPTX
성능 최대화를 위한 CloudFront 설정 Best Practice
PDF
Spring cloud on kubernetes
Introduction to Fauna
Making Structured Streaming Ready for Production
Cloud native application 입문
AWS 활용한 Data Lake 구성하기
Introduction to big data and apache spark
From Zero to Hero with Kafka Connect
성능 최대화를 위한 CloudFront 설정 Best Practice
Spring cloud on kubernetes

What's hot (20)

PDF
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
PPTX
Elastic 101 - Get started
PDF
Kafka internals
PDF
네이버 클라우드 플랫폼의 서비스 전략(공공, Cloud Connect)
PDF
What is in a Lucene index?
PDF
[2019] 바르게, 빠르게! Reactive를 품은 Spring Kafka
PDF
Apache kafka performance(latency)_benchmark_v0.3
PDF
gRPC와 goroutine 톺아보기 - GDG Golang Korea 2019
PPTX
Fleet and elastic agent
PPTX
[211] HBase 기반 검색 데이터 저장소 (공개용)
PPTX
Intro to WebSockets
DOCX
Studi kelayakan
PDF
[2019] PAYCO 쇼핑 마이크로서비스 아키텍처(MSA) 전환기
PDF
Streaming sql and druid
PDF
Ieee nfv-sdn-2020-srv6-tutorial
PPTX
Azure Logic Apps
PDF
FIWARE Training: API Umbrella
PDF
MongoDB for Coder Training (Coding Serbia 2013)
PDF
NestJS - O framework progressivo
PDF
Amazon Redshift의 이해와 활용 (김용우) - AWS DB Day
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
Elastic 101 - Get started
Kafka internals
네이버 클라우드 플랫폼의 서비스 전략(공공, Cloud Connect)
What is in a Lucene index?
[2019] 바르게, 빠르게! Reactive를 품은 Spring Kafka
Apache kafka performance(latency)_benchmark_v0.3
gRPC와 goroutine 톺아보기 - GDG Golang Korea 2019
Fleet and elastic agent
[211] HBase 기반 검색 데이터 저장소 (공개용)
Intro to WebSockets
Studi kelayakan
[2019] PAYCO 쇼핑 마이크로서비스 아키텍처(MSA) 전환기
Streaming sql and druid
Ieee nfv-sdn-2020-srv6-tutorial
Azure Logic Apps
FIWARE Training: API Umbrella
MongoDB for Coder Training (Coding Serbia 2013)
NestJS - O framework progressivo
Amazon Redshift의 이해와 활용 (김용우) - AWS DB Day
Ad

Similar to Fauna DB - Functional NoSQL (20)

KEY
NoSQL: Why, When, and How
PPT
No sql landscape_nosqltips
PDF
Fast and Simplified Streaming, Ad-Hoc and Batch Analytics with FiloDB and Spa...
PPT
No sql
PPTX
PPTX
Data Engineering for Data Scientists
KEY
Using NoSQL MongoDB with ColdFusion
PPT
NOSQL Database: Apache Cassandra
PPT
SQL or NoSQL, that is the question!
ODP
Sumedh Wale's presentation
PDF
Hands-On Apache Spark
PPTX
Using Cassandra with your Web Application
PDF
Near Real Time Indexing Kafka Messages into Apache Blur: Presented by Dibyend...
PPTX
NoSql Database
PPT
Schemaless Databases
PDF
From Zero to Stream Processing
PPTX
Big data vahidamiri-tabriz-13960226-datastack.ir
PDF
Database Systems - A Historical Perspective
PPT
NoSql Databases
PPTX
Intro to Spark
NoSQL: Why, When, and How
No sql landscape_nosqltips
Fast and Simplified Streaming, Ad-Hoc and Batch Analytics with FiloDB and Spa...
No sql
Data Engineering for Data Scientists
Using NoSQL MongoDB with ColdFusion
NOSQL Database: Apache Cassandra
SQL or NoSQL, that is the question!
Sumedh Wale's presentation
Hands-On Apache Spark
Using Cassandra with your Web Application
Near Real Time Indexing Kafka Messages into Apache Blur: Presented by Dibyend...
NoSql Database
Schemaless Databases
From Zero to Stream Processing
Big data vahidamiri-tabriz-13960226-datastack.ir
Database Systems - A Historical Perspective
NoSql Databases
Intro to Spark
Ad

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Spectroscopy.pptx food analysis technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
Teaching material agriculture food technology
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Cloud computing and distributed systems.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation theory and applications.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
sap open course for s4hana steps from ECC to s4
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Spectroscopy.pptx food analysis technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Teaching material agriculture food technology
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Review of recent advances in non-invasive hemoglobin estimation
Cloud computing and distributed systems.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation theory and applications.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Big Data Technologies - Introduction.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Programs and apps: productivity, graphics, security and other tools
Unlocking AI with Model Context Protocol (MCP)

Fauna DB - Functional NoSQL

  • 1. FaunaDB - Functional NoSQL Conor Farrell, Lambda Lounge March 2019
  • 2. Overview - What’s NoSQL? - Distributed DB basics - FaunaDB - Fauna Query Language (FQL) - Demo! - Questions
  • 3. NoSQL - AKA Not Only SQL - Common usecases: real-time, big data - K-V, document store, graph… - Generally scale horizontally - Store data based on its access patterns, in contrast to relational
  • 4. NoSQL compromises - Many do not provide ACID guarantees - BASE (basically available, soft state, eventually consistent) guarantees - Consistency (in the CAP sense) usually loses out, though not always - PACELC!
  • 5. Distributed system consensus How can we reach agreement across nodes, given that they may fail or become unreachable? - Paxos - Google Spanner, Neo4J - Raft - Consul, FaunaDB Consensus algorithms formally proven (TLA+)
  • 7. Calvin transactional protocol - 2012 paper by Thomson et al - Transaction scheduling and data replication layer - Separate ordering transactions from executing transactions - Deterministic ordering -> execute transactions in parallel across replicas - Linear scaling, no single point of failure - Clock skew doesn’t matter, so no need for atomic clocks (Spanner)
  • 8. Calvin transactional protocol However, there’s a price! - Transactions can’t happen interactively - Transactions must be pure - Minimum latency as transaction window must finish
  • 9. FaunaDB - Multiple paradigm NoSQL (document, relational, graph) - Each transaction is a single query expression - ACID guarantees, snapshot isolation to strict serializability - Serverless (generally) pricing model - Used by nVidia, Nextdoor & others
  • 10. FaunaDB Transactions - Uses Calvin + Raft - Coordinator node chooses a snapshot time with which to make read requests. - If there are writes, a commit phase starts. Reads include last update timestamps -> optimistic lock acquisitions. - Read timestamps + writes committed to transaction log. - Transaction resolution in parallel across data partitions. - A transaction is committed and durable if no concurrent write to any read values has occurred.
  • 11. Fauna Query Language (FQL) In SQL terms: Schema ~=> Database Table ~=> Class Row ~=> Instance
  • 12. Fauna Query Language (FQL) Can do the usual things like creating a database (schema) and class (table) CreateDatabase({name: "employees"}) CreateClass({name: "office"}) Note that class structures are not defined at create time!
  • 13. Fauna Query Language (FQL) If all members of a class should share a property, we can add an index. CreateIndex({ name: "office_by_id", source: Class("office"), terms: [{ field: [ "data", "id" ] }], unique: true })
  • 14. Fauna Query Language (FQL) We can also use lambda functions inside an FQL expression Map(Arr("MCR","LON","NYC"), Lambda("office_id", Create(Class("office"), {data: "id", Var("office_id")}))) This will create three offices for us.
  • 15. Fauna Query Language (FQL) Plus other ‘traditional’ programming concepts like: - Let-bindings - If statements - Filter/map/foreach/take Expressive enough to capture business logic in a database transaction.
  • 16. FaunaDB Demo - Start a local cluster (can use cloud too) - fauna shell to interact with it