SlideShare a Scribd company logo
Building stateful real
apps on serverless
I’m Tiru
Hasura is :
- GraphQL on Postgres
- Serverless business logic
- Postgres as event source
I do:
- Product development
- Product management
- Developer advocacy
https://hasura.io
@Tirumarai
A real app always has
STATE!
Otherwise.
It is only.
Heating the place up!
# global warming
Examples of few simple apps
1. Get an image as input, resize and store it somewhere. That’s state.
2. Register a user, and create a list of Todo items
That’s definitely state.
3. Given a city, retrieve the current weather.
Ah! No state?
@Tirumarai
Given a city, retrieve the current weather
There is no state, only if
you are NOT Yahoo
Weather
What we have done is
delegated state to a
black-box
Real apps have state! All we can do is delegate, delegate and delegate.
Patterns for delegating state
1) Send full context in event payload
2) Use BaaS aka managed services
3) Run long running “state planes”
4) Build workflows using state machine pattern
5) EASIEST: Don’t delegate state (w00t!)
Pattern #1: Send context with event
Event #1
{ "id": “42” }
Event #2
"user_info": {
"user-id": "1"
},
"op": "UPDATE",
"data": {
"old":{
"id":"42",
"name": "jane"
},
"new": {
"id":"42",
"name": "john doe"
}
}
Obviate the need
for database read
❌ ✅
Example #1: Send context with event
"user_info": {
"user-id": "1",
"name": "Jane",
"address": "Ch. S",
},
"login": "Facebook",
"created": "14-02-19"
"utm": {
"source": "twit",
"campaign": "ad"
} @Tirumarai
Pattern #2: Use BaaS/managed services
Let someone else deal with state
Identity: Auth0
Media tools: Cloudinary
Search: Algolia
Notifications: Twilio
E.g.
@Tirumarai
Example #2: Use BaaS/managed services
Pattern #3: Run long running “state planes”
@Tirumarai
Example #3: Run long running “state planes”
Running a
GraphQL
service on
serverless
https://medium.com/open-graphql/
scaling-rdbms-for-graphql-backend
s-on-serverless-980ef24af171
Pattern #4 : Build workflows using
state-machine pattern
@Tirumarai
Pattern #4 : Build workflows using
state-machine pattern
Pattern #5 : Use fast databases (EASY)
@Tirumarai
Pattern #5 : Use fast databases (EASY)
@Tirumarai
What is stateless then?
Stateless == Idempotency?
What people usually mean by stateless is idempotency
Stateless => Idempotency, Idempotency => More than stateless
If we can ensure idempotency, our stateful function seems like
a stateless function!
Managed services should be idempotent for use with serverless
Caveats
Good enough, but not everything
Demo time :)
The 3factor app
The 3factor app
What’s the catch? Transactions!
Let’s talk about Haskell :)
How to get started?
Incremental adoption for brownfield projects
An example: Before and After
Hasura Event Triggers
Thank you!
Tirumarai Selvan
@Tirumarai
hasura.io
github.com/hasura/graphql-engine
Questions?

More Related Content

PDF
Building stateful apps using serverless
PDF
Hasura 2.0 Webinar
PPT
HTML Flight Scraper
PPTX
Building TimePiece
PPTX
Nyc web perf-final-july-23
PDF
Selenium camp 2017. Alexander Chumakin
PPTX
Exploring MongoDB & Elasticsearch: Better Together
PPTX
Presto@Netflix Presto Meetup 03-19-15
Building stateful apps using serverless
Hasura 2.0 Webinar
HTML Flight Scraper
Building TimePiece
Nyc web perf-final-july-23
Selenium camp 2017. Alexander Chumakin
Exploring MongoDB & Elasticsearch: Better Together
Presto@Netflix Presto Meetup 03-19-15

What's hot (20)

PPTX
GitHub Data and Insights
PPTX
An Intro to Elasticsearch and Kibana
PDF
Collecting Endpoint Security Logs Through Big Data Technology - Dedi Dwianto
PPTX
Analyzing Mixpanel Data into Amazon Redshift
PDF
SC7 Webinar 5 13/12/2017 NCSR "Demokritos" Presentation "Event Detection"
PPTX
Power BI Streaming Datasets - San Diego BI Users Group
PPTX
Reshaping Data Driven Application Development with GraphQL and AppSync
PDF
Hands on experience in real-time data process with AWS Kinesis, Firehose, S3 ...
PDF
SC7 Webinar 5 13/12/2017 UoA Presentation "Technical aspects of the 3rd secur...
PDF
Elk - An introduction
PDF
DE gitConnect
PDF
GAB 2019 - Integrate Microsoft Graph​ with Azure Active Directory​ in your cl...
PDF
Open Data and Web API
PDF
Visualising and Linking Open Data from Multiple Sources
PDF
Wilson Wu_
PDF
Graph Computing with Apache TinkerPop
PDF
Piyali Kamra - Analytics and Data Visualization pipeline backed by AWS Glue &...
PDF
This Week in Neo4j- 1st December 2018
PDF
Distributed Tracing
PDF
Rohan kumar keshri
GitHub Data and Insights
An Intro to Elasticsearch and Kibana
Collecting Endpoint Security Logs Through Big Data Technology - Dedi Dwianto
Analyzing Mixpanel Data into Amazon Redshift
SC7 Webinar 5 13/12/2017 NCSR "Demokritos" Presentation "Event Detection"
Power BI Streaming Datasets - San Diego BI Users Group
Reshaping Data Driven Application Development with GraphQL and AppSync
Hands on experience in real-time data process with AWS Kinesis, Firehose, S3 ...
SC7 Webinar 5 13/12/2017 UoA Presentation "Technical aspects of the 3rd secur...
Elk - An introduction
DE gitConnect
GAB 2019 - Integrate Microsoft Graph​ with Azure Active Directory​ in your cl...
Open Data and Web API
Visualising and Linking Open Data from Multiple Sources
Wilson Wu_
Graph Computing with Apache TinkerPop
Piyali Kamra - Analytics and Data Visualization pipeline backed by AWS Glue &...
This Week in Neo4j- 1st December 2018
Distributed Tracing
Rohan kumar keshri
Ad

Similar to Building real apps on serverless (20)

PDF
The future of serverless is STATE!
PPT
Difference Between Stateful vs Stateless API.ppt
PPTX
Advanced design patterns in action
PDF
Cloudstate—Towards Stateful Serverless
PDF
Cloudstate - Towards Stateful Serverless
PDF
Scalability truths and serverless architectures
PPTX
State Management in Mule applications | MuleSoft Mysore Meetup #42
PDF
Introduction to Akka Serverless
PDF
A COMPARATIVE STUDY BETWEEN GRAPH-QL RESTFUL SERVICES IN API MANAGEMENT OF S...
PDF
A COMPARATIVE STUDY BETWEEN GRAPH-QL& RESTFUL SERVICES IN API MANAGEMENT OF S...
PDF
Designing Practical RESTful APIs
PDF
Architecture of scalable and resilient apps with GraphQL, Amazon RDS and AWS ...
PDF
A COMPARATIVE STUDY BETWEEN GRAPH-QL Amp RESTFUL SERVICES IN API MANAGEMENT ...
PDF
A COMPARATIVE STUDY BETWEEN GRAPH-QL& RESTFUL SERVICES IN API MANAGEMENT OF S...
PDF
A Comparative Study between Graph-QL& Restful Services in API Management of S...
PDF
A COMPARATIVE STUDY BETWEEN GRAPH-QL& RESTFUL SERVICES IN API MANAGEMENT OF S...
PDF
GlueCon 2019: Beyond REST - Moving to Event-Based APIs and Streaming
PDF
GraphQL API on a Serverless Environment
PDF
Introduction to Serverless through Architectural Patterns
PDF
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
The future of serverless is STATE!
Difference Between Stateful vs Stateless API.ppt
Advanced design patterns in action
Cloudstate—Towards Stateful Serverless
Cloudstate - Towards Stateful Serverless
Scalability truths and serverless architectures
State Management in Mule applications | MuleSoft Mysore Meetup #42
Introduction to Akka Serverless
A COMPARATIVE STUDY BETWEEN GRAPH-QL RESTFUL SERVICES IN API MANAGEMENT OF S...
A COMPARATIVE STUDY BETWEEN GRAPH-QL& RESTFUL SERVICES IN API MANAGEMENT OF S...
Designing Practical RESTful APIs
Architecture of scalable and resilient apps with GraphQL, Amazon RDS and AWS ...
A COMPARATIVE STUDY BETWEEN GRAPH-QL Amp RESTFUL SERVICES IN API MANAGEMENT ...
A COMPARATIVE STUDY BETWEEN GRAPH-QL& RESTFUL SERVICES IN API MANAGEMENT OF S...
A Comparative Study between Graph-QL& Restful Services in API Management of S...
A COMPARATIVE STUDY BETWEEN GRAPH-QL& RESTFUL SERVICES IN API MANAGEMENT OF S...
GlueCon 2019: Beyond REST - Moving to Event-Based APIs and Streaming
GraphQL API on a Serverless Environment
Introduction to Serverless through Architectural Patterns
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
Ad

Recently uploaded (20)

PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
medical staffing services at VALiNTRY
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Digital Strategies for Manufacturing Companies
PDF
AI in Product Development-omnex systems
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
System and Network Administraation Chapter 3
PPTX
history of c programming in notes for students .pptx
PDF
System and Network Administration Chapter 2
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Transform Your Business with a Software ERP System
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Design an Analysis of Algorithms I-SECS-1021-03
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
wealthsignaloriginal-com-DS-text-... (1).pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
medical staffing services at VALiNTRY
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Digital Strategies for Manufacturing Companies
AI in Product Development-omnex systems
Which alternative to Crystal Reports is best for small or large businesses.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
System and Network Administraation Chapter 3
history of c programming in notes for students .pptx
System and Network Administration Chapter 2
Upgrade and Innovation Strategies for SAP ERP Customers
Design an Analysis of Algorithms II-SECS-1021-03
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Transform Your Business with a Software ERP System
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)

Building real apps on serverless

  • 2. I’m Tiru Hasura is : - GraphQL on Postgres - Serverless business logic - Postgres as event source I do: - Product development - Product management - Developer advocacy https://hasura.io @Tirumarai
  • 3. A real app always has STATE! Otherwise. It is only. Heating the place up! # global warming
  • 4. Examples of few simple apps 1. Get an image as input, resize and store it somewhere. That’s state. 2. Register a user, and create a list of Todo items That’s definitely state. 3. Given a city, retrieve the current weather. Ah! No state? @Tirumarai
  • 5. Given a city, retrieve the current weather There is no state, only if you are NOT Yahoo Weather What we have done is delegated state to a black-box Real apps have state! All we can do is delegate, delegate and delegate.
  • 6. Patterns for delegating state 1) Send full context in event payload 2) Use BaaS aka managed services 3) Run long running “state planes” 4) Build workflows using state machine pattern 5) EASIEST: Don’t delegate state (w00t!)
  • 7. Pattern #1: Send context with event Event #1 { "id": “42” } Event #2 "user_info": { "user-id": "1" }, "op": "UPDATE", "data": { "old":{ "id":"42", "name": "jane" }, "new": { "id":"42", "name": "john doe" } } Obviate the need for database read ❌ ✅
  • 8. Example #1: Send context with event "user_info": { "user-id": "1", "name": "Jane", "address": "Ch. S", }, "login": "Facebook", "created": "14-02-19" "utm": { "source": "twit", "campaign": "ad" } @Tirumarai
  • 9. Pattern #2: Use BaaS/managed services Let someone else deal with state Identity: Auth0 Media tools: Cloudinary Search: Algolia Notifications: Twilio E.g. @Tirumarai
  • 10. Example #2: Use BaaS/managed services
  • 11. Pattern #3: Run long running “state planes” @Tirumarai
  • 12. Example #3: Run long running “state planes” Running a GraphQL service on serverless https://medium.com/open-graphql/ scaling-rdbms-for-graphql-backend s-on-serverless-980ef24af171
  • 13. Pattern #4 : Build workflows using state-machine pattern @Tirumarai
  • 14. Pattern #4 : Build workflows using state-machine pattern
  • 15. Pattern #5 : Use fast databases (EASY) @Tirumarai
  • 16. Pattern #5 : Use fast databases (EASY) @Tirumarai
  • 18. Stateless == Idempotency? What people usually mean by stateless is idempotency Stateless => Idempotency, Idempotency => More than stateless If we can ensure idempotency, our stateful function seems like a stateless function! Managed services should be idempotent for use with serverless
  • 20. Good enough, but not everything
  • 24. What’s the catch? Transactions!
  • 25. Let’s talk about Haskell :)
  • 26. How to get started?
  • 27. Incremental adoption for brownfield projects
  • 28. An example: Before and After