Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing...
Transcript of Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing...
![Page 1: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/1.jpg)
Jonas Bonér @jboner
Towards Stateful Serverless
![Page 2: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/2.jpg)
“We predict that Serverless Computing will grow to dominate the future of Cloud Computing.”
- Berkeley CS Department
Cloud computing simplified: a Berkeley view on serverless computing
![Page 3: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/3.jpg)
FaaS
FaaS = Function-as-a-Service
![Page 4: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/4.jpg)
Is visionaryFaaS
FaaS = Function-as-a-Service
![Page 5: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/5.jpg)
Is visionaryPaved the way
FaaS
FaaS = Function-as-a-Service
![Page 6: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/6.jpg)
Is visionaryPaved the wayJust the first step
FaaS
FaaS = Function-as-a-Service
![Page 7: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/7.jpg)
Serverless ≠Faas
![Page 8: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/8.jpg)
good use-casesFor FaaS?
![Page 9: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/9.jpg)
good use-casesFor FaaS?
Use-cases where throughput is key rather than low latency and requests can be completed in a short time window
![Page 10: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/10.jpg)
good use-casesFor FaaS?
1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition, log analysis
2. Low traffic applications—enterprise IT services, and spiky workloads 3. Stateless web applications—serving static content form S3 (or similar) 4. Orchestration functions—integration/coordination of calls to third-party services 5. Composing chains of functions—stateless workflow management, connected via data dependencies
6. Job scheduling—CRON jobs, triggers, etc.
Use-cases where throughput is key rather than low latency and requests can be completed in a short time window
![Page 11: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/11.jpg)
FAAS: Hard to build General-Purpose Applications
![Page 12: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/12.jpg)
1. Functions are stateless, ephemeral, short-lived: expensive to lose computational context & rehydrate
2. Durable state is always “somewhere else” 3. No co-location of state and processing 4. No direct addressability—all communication over external storage 5. Limited options for managing & coordinating distributed state 6. Limited options for modelling data consistency guarantees
FAAS: Hard to build General-Purpose Applications
![Page 13: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/13.jpg)
![Page 14: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/14.jpg)
State
![Page 15: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/15.jpg)
We Need Serverless Support For...
![Page 16: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/16.jpg)
We Need Serverless Support For...
In short:
General-purpose
applications
![Page 17: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/17.jpg)
• Managing in-memory durable session state across individual requests E.g. User Sessions, Shopping Carts, Caching
We Need Serverless Support For...
In short:
General-purpose
applications
![Page 18: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/18.jpg)
• Managing in-memory durable session state across individual requests E.g. User Sessions, Shopping Carts, Caching
• Low-latency serving of dynamic in-memory models E.g. Serving of Machine Learning Models
We Need Serverless Support For...
In short:
General-purpose
applications
![Page 19: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/19.jpg)
• Managing in-memory durable session state across individual requests E.g. User Sessions, Shopping Carts, Caching
• Low-latency serving of dynamic in-memory models E.g. Serving of Machine Learning Models
• Real-time stream processing E.g. Recommendation, Anomaly Detection, Prediction Serving
We Need Serverless Support For...
In short:
General-purpose
applications
![Page 20: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/20.jpg)
• Managing in-memory durable session state across individual requests E.g. User Sessions, Shopping Carts, Caching
• Low-latency serving of dynamic in-memory models E.g. Serving of Machine Learning Models
• Real-time stream processing E.g. Recommendation, Anomaly Detection, Prediction Serving
• Distributed resilient transactional workflows E.g. Saga Pattern, Workflow Orchestration, Rollback/Compensating Actions
We Need Serverless Support For...
In short:
General-purpose
applications
![Page 21: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/21.jpg)
• Managing in-memory durable session state across individual requests E.g. User Sessions, Shopping Carts, Caching
• Low-latency serving of dynamic in-memory models E.g. Serving of Machine Learning Models
• Real-time stream processing E.g. Recommendation, Anomaly Detection, Prediction Serving
• Distributed resilient transactional workflows E.g. Saga Pattern, Workflow Orchestration, Rollback/Compensating Actions
• Shared collaborative workspaces E.g. Collaborative Document Editing, Blackboards, Chat Rooms
We Need Serverless Support For...
In short:
General-purpose
applications
![Page 22: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/22.jpg)
• Managing in-memory durable session state across individual requests E.g. User Sessions, Shopping Carts, Caching
• Low-latency serving of dynamic in-memory models E.g. Serving of Machine Learning Models
• Real-time stream processing E.g. Recommendation, Anomaly Detection, Prediction Serving
• Distributed resilient transactional workflows E.g. Saga Pattern, Workflow Orchestration, Rollback/Compensating Actions
• Shared collaborative workspaces E.g. Collaborative Document Editing, Blackboards, Chat Rooms
• Leader election, counting, voting …and other distributed systems patterns/protocols for coordination
We Need Serverless Support For...
In short:
General-purpose
applications
![Page 23: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/23.jpg)
Technical Requirements
![Page 24: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/24.jpg)
1. Stateful long-lived addressable virtual components Actors
Technical Requirements
![Page 25: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/25.jpg)
1. Stateful long-lived addressable virtual components Actors
2. Options for distributed coordination and communication patterns Pub-Sub, Point-To-Point, Broadcast—CRDTs, Sagas, etc.
Technical Requirements
![Page 26: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/26.jpg)
1. Stateful long-lived addressable virtual components Actors
2. Options for distributed coordination and communication patterns Pub-Sub, Point-To-Point, Broadcast—CRDTs, Sagas, etc.
3. Options for managing distributed state reliably at scale Ranging from strong to eventual consistency (durable/ephemeral)
Technical Requirements
![Page 27: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/27.jpg)
1. Stateful long-lived addressable virtual components Actors
2. Options for distributed coordination and communication patterns Pub-Sub, Point-To-Point, Broadcast—CRDTs, Sagas, etc.
3. Options for managing distributed state reliably at scale Ranging from strong to eventual consistency (durable/ephemeral)
4. Intelligent adaptive placement of stateful functions Physical co-location of state and processing, sharding, and sticky routing
Technical Requirements
![Page 28: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/28.jpg)
1. Stateful long-lived addressable virtual components Actors
2. Options for distributed coordination and communication patterns Pub-Sub, Point-To-Point, Broadcast—CRDTs, Sagas, etc.
3. Options for managing distributed state reliably at scale Ranging from strong to eventual consistency (durable/ephemeral)
4. Intelligent adaptive placement of stateful functions Physical co-location of state and processing, sharding, and sticky routing
5. Predictable performance, latency, and throughput In startup time, communication/coordination, and storage of data
Technical Requirements
![Page 29: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/29.jpg)
1. Stateful long-lived addressable virtual components Actors
2. Options for distributed coordination and communication patterns Pub-Sub, Point-To-Point, Broadcast—CRDTs, Sagas, etc.
3. Options for managing distributed state reliably at scale Ranging from strong to eventual consistency (durable/ephemeral)
4. Intelligent adaptive placement of stateful functions Physical co-location of state and processing, sharding, and sticky routing
5. Predictable performance, latency, and throughput In startup time, communication/coordination, and storage of data
6. Ways of managing end-to-end guarantees and correctness
Technical Requirements
![Page 30: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/30.jpg)
User Function
Deployment
FaaS Is Great At Abstracting Over Communication
![Page 31: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/31.jpg)
Message In User Function
Deployment
FaaS Is Great At Abstracting Over Communication
![Page 32: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/32.jpg)
Message In User Function
Deployment
Message Out
FaaS Is Great At Abstracting Over Communication
![Page 33: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/33.jpg)
Message In User Function
Deployment
Message Out
FaaS With CRUD
![Page 34: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/34.jpg)
Message In User Function
Deployment
Database
Message Out
FaaS With CRUD
![Page 35: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/35.jpg)
Message In User Function
Deployment
Database
Message Out
Not Serverless Leaky Abstraction
![Page 36: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/36.jpg)
The Problem
![Page 37: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/37.jpg)
The Function is a
Black BoX
The Problem
![Page 38: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/38.jpg)
The Problem
![Page 39: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/39.jpg)
Unconstrained database access Makes it hard to
Automate operations
The Problem
![Page 40: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/40.jpg)
“Freedom is not so much the absence of restrictions as finding the right ones,
the liberating restrictions.”- Timothy keller
![Page 41: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/41.jpg)
User Function
Deployment
FaaS Abstracting Over Communication
![Page 42: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/42.jpg)
Message In
User Function
Deployment
FaaS Abstracting Over Communication
![Page 43: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/43.jpg)
Message In
User Function
Deployment
Message Out
FaaS Abstracting Over Communication
![Page 44: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/44.jpg)
Message In
User Function
Deployment
Message Out
Stateful Serverless Abstracting Over State
![Page 45: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/45.jpg)
Message In
User Function
Deployment
Message Out
Stateful Serverless Abstracting Over State
State In
![Page 46: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/46.jpg)
Message In
User Function
Deployment
Message Out
Stateful Serverless Abstracting Over State
State In State Out
![Page 47: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/47.jpg)
Enter
![Page 48: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/48.jpg)
What Is CloudState?https://cloudstate.io
![Page 49: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/49.jpg)
Overview:1. Open Source (Apache 2.0) project
What Is CloudState?https://cloudstate.io
![Page 50: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/50.jpg)
Overview:1. Open Source (Apache 2.0) project2. Makes Stateful Serverless applications easy
What Is CloudState?https://cloudstate.io
![Page 51: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/51.jpg)
Overview:1. Open Source (Apache 2.0) project2. Makes Stateful Serverless applications easy3. Reference implementation for a standard (protocol and spec)
What Is CloudState?https://cloudstate.io
![Page 52: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/52.jpg)
Overview:1. Open Source (Apache 2.0) project2. Makes Stateful Serverless applications easy3. Reference implementation for a standard (protocol and spec)4. Let’s you focus on business logic, data model, and workflow
What Is CloudState?https://cloudstate.io
![Page 53: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/53.jpg)
What Is CloudState?https://cloudstate.io
![Page 54: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/54.jpg)
What Is CloudState?https://cloudstate.io
Don’t worry about: 1. Managing: Complexities of Distributed and Concurrent systems
![Page 55: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/55.jpg)
What Is CloudState?https://cloudstate.io
Don’t worry about: 1. Managing: Complexities of Distributed and Concurrent systems2. Managing: Distributed State—Consistency, Replication, Persistence
![Page 56: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/56.jpg)
What Is CloudState?https://cloudstate.io
Don’t worry about: 1. Managing: Complexities of Distributed and Concurrent systems2. Managing: Distributed State—Consistency, Replication, Persistence3. Managing: Databases, Service Meshes, and other infrastructure
![Page 57: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/57.jpg)
What Is CloudState?https://cloudstate.io
Don’t worry about: 1. Managing: Complexities of Distributed and Concurrent systems2. Managing: Distributed State—Consistency, Replication, Persistence3. Managing: Databases, Service Meshes, and other infrastructure4. Managing: Message Routing, Scalability, Fail-over & Recovery
![Page 58: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/58.jpg)
What Is CloudState?https://cloudstate.io
Don’t worry about: 1. Managing: Complexities of Distributed and Concurrent systems2. Managing: Distributed State—Consistency, Replication, Persistence3. Managing: Databases, Service Meshes, and other infrastructure4. Managing: Message Routing, Scalability, Fail-over & Recovery5. Running & Operating your application
![Page 59: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/59.jpg)
What Is CloudState?https://cloudstate.io
![Page 60: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/60.jpg)
Technical Highlights:1. Polyglot: Client libs in JavaScript, Java, Go—with upcoming support for Python, .NET, Rust, Swift, Scala
What Is CloudState?https://cloudstate.io
![Page 61: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/61.jpg)
Technical Highlights:1. Polyglot: Client libs in JavaScript, Java, Go—with upcoming support for Python, .NET, Rust, Swift, Scala
2. PolyState: Powerful state models—Event Sourcing, CRDTs, Key Value
What Is CloudState?https://cloudstate.io
![Page 62: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/62.jpg)
Technical Highlights:1. Polyglot: Client libs in JavaScript, Java, Go—with upcoming support for Python, .NET, Rust, Swift, Scala
2. PolyState: Powerful state models—Event Sourcing, CRDTs, Key Value3. PolyDB: Supporting SQL, NoSQL, NewSQL and in-memory replication
What Is CloudState?https://cloudstate.io
![Page 63: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/63.jpg)
Technical Highlights:1. Polyglot: Client libs in JavaScript, Java, Go—with upcoming support for Python, .NET, Rust, Swift, Scala
2. PolyState: Powerful state models—Event Sourcing, CRDTs, Key Value3. PolyDB: Supporting SQL, NoSQL, NewSQL and in-memory replication4. Leveraging Akka, gRPC, Knative, GraalVM, running on Kubernetes
What Is CloudState?https://cloudstate.io
![Page 64: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/64.jpg)
Cloudstate Architecture
![Page 65: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/65.jpg)
Kubernetes Pod
Kubernetes Pod
Kubernetes Pod
Cloudstate Architecture
![Page 66: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/66.jpg)
Kubernetes Pod
Kubernetes Pod
Kubernetes Pod
User Function (JavaScript, Go, Java,…)
Cloudstate Architecture User Function
(JavaScript, Go, Java,…)
User Function (JavaScript, Go, Java,…)
![Page 67: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/67.jpg)
Kubernetes Pod
Kubernetes Pod
Kubernetes Pod
Cloudstate Proxy (Akka Sidecar)
User Function (JavaScript, Go, Java,…)
Cloudstate Architecture User Function
(JavaScript, Go, Java,…)
User Function (JavaScript, Go, Java,…)
![Page 68: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/68.jpg)
Kubernetes Pod
Kubernetes Pod
Kubernetes Pod
Cloudstate Proxy (Akka Sidecar)
User Function (JavaScript, Go, Java,…)
Cloudstate Architecture User Function
(JavaScript, Go, Java,…)
User Function (JavaScript, Go, Java,…)
![Page 69: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/69.jpg)
Kubernetes Pod
Kubernetes Pod
Kubernetes Pod
Cloudstate Proxy (Akka Sidecar)
User Function (JavaScript, Go, Java,…)
Cloudstate Architecture User Function
(JavaScript, Go, Java,…)
User Function (JavaScript, Go, Java,…)
gRPC
![Page 70: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/70.jpg)
Kubernetes Pod
Kubernetes Pod
Kubernetes Pod
Cloudstate Proxy (Akka Sidecar)
User Function (JavaScript, Go, Java,…)
Cloudstate Architecture User Function
(JavaScript, Go, Java,…)
User Function (JavaScript, Go, Java,…)
Datastore (Cassandra, Postgres, Spanner,…)
gRPC
![Page 71: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/71.jpg)
Kubernetes PodUser Function (JavaScript, Go, Java,…)
Kubernetes PodUser Function (JavaScript, Go, Java,…)
Kubernetes PodUser Function (JavaScript, Go, Java,…)
![Page 72: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/72.jpg)
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
![Page 73: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/73.jpg)
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Akka Cluster
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
![Page 74: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/74.jpg)
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Akka Cluster
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
HTTP
![Page 75: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/75.jpg)
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Akka Cluster
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
HTTP
![Page 76: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/76.jpg)
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Akka Cluster
gRPC
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
HTTP
![Page 77: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/77.jpg)
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Akka Cluster
gRPC
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
HTTP
Gossip, State replication, Routing
Gossip, State replication, Routing
![Page 78: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/78.jpg)
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Akka Cluster
Datastore (Cassandra, Postgres, Spanner,…)
gRPC
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
HTTP
Gossip, State replication, Routing
Gossip, State replication, Routing
![Page 79: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/79.jpg)
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Akka Cluster
Datastore (Cassandra, Postgres, Spanner,…)
gRPC
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
gRPC
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
HTTP
gRPC
Gossip, State replication, Routing
Gossip, State replication, Routing
![Page 80: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/80.jpg)
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
Akka Cluster
Datastore (Cassandra, Postgres, Spanner,…)
gRPC
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
gRPC
Kubernetes PodUser Function (JavaScript, Go, Java,…)Akka Sidecar
gRPC
HTTP
gRPC
Events
Gossip, State replication, Routing
Gossip, State replication, Routing
![Page 81: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/81.jpg)
CloudState helps you with (when being a managed service)
![Page 82: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/82.jpg)
• Pay-as-you-go: • On-demand Instance Creation, Passivation, and Failover • Autoscaling—up and down
CloudState helps you with (when being a managed service)
![Page 83: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/83.jpg)
• Pay-as-you-go: • On-demand Instance Creation, Passivation, and Failover • Autoscaling—up and down
• ZeroOps: • Automation of Message Routing and Delivery • Automation of State Management
• Service of Record—In-Memory Cluster Sharding, Co-location of Data & Processing • Coordination State—Replication, Consistency
• Automation of Deployment, Provisioning, Upgrades
CloudState helps you with (when being a managed service)
![Page 84: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/84.jpg)
Akka Cluster state management
![Page 85: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/85.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
![Page 86: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/86.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
![Page 87: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/87.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
• Actor-based Distributed Runtime• Decentralized Masterless P2P• Epidemic Gossiping, Self-healing
https://akka.io
![Page 88: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/88.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
• Actor-based Distributed Runtime• Decentralized Masterless P2P• Epidemic Gossiping, Self-healing
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User Function
User Function
![Page 89: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/89.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
• Actor-based Distributed Runtime• Decentralized Masterless P2P• Epidemic Gossiping, Self-healing
• State Sharding & Routing on Entity Key
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User Function
User Function
![Page 90: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/90.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
• Actor-based Distributed Runtime• Decentralized Masterless P2P• Epidemic Gossiping, Self-healing
• State Sharding & Routing on Entity Key
(Key, State)
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User Function
User Function
![Page 91: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/91.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
• Actor-based Distributed Runtime• Decentralized Masterless P2P• Epidemic Gossiping, Self-healing
• State Sharding & Routing on Entity Key• Forwarding of Requests (if needed)
(Key, State)
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User Function
User Function
![Page 92: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/92.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
• Actor-based Distributed Runtime• Decentralized Masterless P2P• Epidemic Gossiping, Self-healing
• State Sharding & Routing on Entity Key• Forwarding of Requests (if needed)
(Key, State)
(Key, State)
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User Function
User Function
![Page 93: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/93.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
• Actor-based Distributed Runtime• Decentralized Masterless P2P• Epidemic Gossiping, Self-healing
• State Sharding & Routing on Entity Key• Forwarding of Requests (if needed)• Co-Location of State & Processing
(Key, State)
(Key, State)
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User Function
User Function
![Page 94: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/94.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
• Actor-based Distributed Runtime• Decentralized Masterless P2P• Epidemic Gossiping, Self-healing
• State Sharding & Routing on Entity Key• Forwarding of Requests (if needed)• Co-Location of State & Processing• Backed by Event Log
(Key, State)
(Key, State)
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User Function
User Function
![Page 95: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/95.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Event Log
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
• Actor-based Distributed Runtime• Decentralized Masterless P2P• Epidemic Gossiping, Self-healing
• State Sharding & Routing on Entity Key• Forwarding of Requests (if needed)• Co-Location of State & Processing• Backed by Event Log
(Key, State)
(Key, State)
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User Function
User Function
![Page 96: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/96.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Event Log
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
• Actor-based Distributed Runtime• Decentralized Masterless P2P• Epidemic Gossiping, Self-healing
• State Sharding & Routing on Entity Key• Forwarding of Requests (if needed)• Co-Location of State & Processing• Backed by Event Log• Automatic Failover, Rehydration, and
Rebalancing
(Key, State)
(Key, State)
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User Function
User Function
![Page 97: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/97.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Event Log
Akka Sidecar
Akka Sidecar
Akka Sidecar
• Actor-based Distributed Runtime• Decentralized Masterless P2P• Epidemic Gossiping, Self-healing
• State Sharding & Routing on Entity Key• Forwarding of Requests (if needed)• Co-Location of State & Processing• Backed by Event Log• Automatic Failover, Rehydration, and
Rebalancing
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User Function
User Function
![Page 98: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/98.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Event Log
Akka Sidecar
Akka Sidecar
Akka Sidecar
• Actor-based Distributed Runtime• Decentralized Masterless P2P• Epidemic Gossiping, Self-healing
• State Sharding & Routing on Entity Key• Forwarding of Requests (if needed)• Co-Location of State & Processing• Backed by Event Log• Automatic Failover, Rehydration, and
Rebalancing
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User FunctionUser Function
![Page 99: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/99.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Event Log
Akka Sidecar
Akka Sidecar
Akka Sidecar
• Actor-based Distributed Runtime• Decentralized Masterless P2P• Epidemic Gossiping, Self-healing
• State Sharding & Routing on Entity Key• Forwarding of Requests (if needed)• Co-Location of State & Processing• Backed by Event Log• Automatic Failover, Rehydration, and
Rebalancing(Key, State)
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User FunctionUser Function
![Page 100: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/100.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Event Log
Akka Sidecar
Akka Sidecar
Akka Sidecar
• Actor-based Distributed Runtime• Decentralized Masterless P2P• Epidemic Gossiping, Self-healing
• State Sharding & Routing on Entity Key• Forwarding of Requests (if needed)• Co-Location of State & Processing• Backed by Event Log• Automatic Failover, Rehydration, and
Rebalancing(Key, State)
(Key, State)
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User FunctionUser Function
![Page 101: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/101.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
• In-memory Replication of State • Gossiping State Changes • Using CRDTs • State Merged on Local Node • Highly Available (N Replicas) • Very Scalable
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User Function
User Function
![Page 102: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/102.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
• In-memory Replication of State • Gossiping State Changes • Using CRDTs • State Merged on Local Node • Highly Available (N Replicas) • Very Scalable
(Key, State)
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User Function
User Function
![Page 103: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/103.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
• In-memory Replication of State • Gossiping State Changes • Using CRDTs • State Merged on Local Node • Highly Available (N Replicas) • Very Scalable
(Key, State)
(Key, State)
(Key, State)
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User Function
User Function
(Key, State)
(Key, State)
![Page 104: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/104.jpg)
Akka Cluster state management
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Cluster
Akka Sidecar
Akka Sidecar
Akka Sidecar
Akka Sidecar
• In-memory Replication of State • Gossiping State Changes • Using CRDTs • State Merged on Local Node • Highly Available (N Replicas) • Very Scalable
https://akka.io
User FunctionUser Function
User Function
User Function
User Function
User Function
User Function
![Page 105: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/105.jpg)
Cloudstate Uses Better Models
For Distributed State
![Page 106: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/106.jpg)
battle-tested, Yet Constrained, models like:
Cloudstate Uses Better Models
For Distributed State
![Page 107: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/107.jpg)
battle-tested, Yet Constrained, models like:
Cloudstate Uses Better Models
For Distributed State
Event Sourcing
![Page 108: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/108.jpg)
battle-tested, Yet Constrained, models like:
Cloudstate Uses Better Models
For Distributed State
Event Sourcing CRDTs
![Page 109: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/109.jpg)
battle-tested, Yet Constrained, models like:
Cloudstate Uses Better Models
For Distributed State
Event Sourcing CRDTs Key
Value
![Page 110: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/110.jpg)
Event Sourced Entities
Happy Path
![Page 111: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/111.jpg)
Event Sourced Entities
Happy Path
![Page 112: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/112.jpg)
Command
Event Sourced Entities
Happy Path
![Page 113: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/113.jpg)
Command
Event Sourced Entities
Happy Path
![Page 114: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/114.jpg)
Command
Event Sourced Entities
Happy Path
Command
![Page 115: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/115.jpg)
Command
Event Log
Event
Event Sourced Entities
Happy Path
Command
![Page 116: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/116.jpg)
Command
Event
Event Log
Event
Event Sourced Entities
Happy Path
Command
![Page 117: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/117.jpg)
Command
Event
Event Log
Event
Event Sourced Entities
Happy Path
Command Memory Image
![Page 118: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/118.jpg)
Event Sourced Entities
Happy Path
![Page 119: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/119.jpg)
SAD Path, RECOVER FROM FAILURE
Event Sourced Entities
![Page 120: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/120.jpg)
Event Log
SAD Path, RECOVER FROM FAILURE
Event Sourced Entities
![Page 121: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/121.jpg)
Event Log
REPLAY EventS
SAD Path, RECOVER FROM FAILURE
Event Sourced Entities
![Page 122: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/122.jpg)
Event Log
REPLAY EventS
SAD Path, RECOVER FROM FAILURE
Command
Event Sourced Entities
![Page 123: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/123.jpg)
Benefits of
Event Sourcing
![Page 124: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/124.jpg)
Benefits of
Event Sourcing
✴ One single Source of Truth with All history
![Page 125: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/125.jpg)
Benefits of
Event Sourcing
✴ One single Source of Truth with All history
✴ Allows for Memory Image (Durable In-Memory State)
![Page 126: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/126.jpg)
Benefits of
Event Sourcing
✴ One single Source of Truth with All history
✴ Allows for Memory Image (Durable In-Memory State)✴ Avoids the Object-relational mismatch
![Page 127: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/127.jpg)
Benefits of
Event Sourcing
✴ One single Source of Truth with All history
✴ Allows for Memory Image (Durable In-Memory State)✴ Avoids the Object-relational mismatch
✴ Allows others to Subscribe to state changes
![Page 128: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/128.jpg)
Benefits of
Event Sourcing
✴ One single Source of Truth with All history
✴ Allows for Memory Image (Durable In-Memory State)✴ Avoids the Object-relational mismatch
✴ Allows others to Subscribe to state changes
✴ Has good Mechanical sympathy (Single Writer Principle)
![Page 129: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/129.jpg)
Deployment
Serverless
Event Sourcing
![Page 130: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/130.jpg)
User Function/entity
Deployment
Serverless
Event Sourcing
![Page 131: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/131.jpg)
User Function/entity
Deployment
Event Log In
Serverless
Event Sourcing
![Page 132: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/132.jpg)
Command In
User Function/entity
Deployment
Event Log In
Serverless
Event Sourcing
![Page 133: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/133.jpg)
Command In
User Function/entity
Deployment
Reply Out
Event Log In
Serverless
Event Sourcing
![Page 134: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/134.jpg)
Command In
User Function/entity
Deployment
Reply Out
Event Log In Events OUt
Serverless
Event Sourcing
![Page 135: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/135.jpg)
Command In
User Function/entity
Deployment
Reply Out
Event Log In Events OUt
Serverless
Event Sourcing
![Page 136: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/136.jpg)
Convergent & Commutative Replicated Data Types - Shapiro et. al. 2011
Conflict-Free Replicated Data Types
![Page 137: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/137.jpg)
CRDT
Convergent & Commutative Replicated Data Types - Shapiro et. al. 2011
Conflict-Free Replicated Data Types
![Page 138: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/138.jpg)
CRDTStrong Eventual Consistency Replicated & Decentralized Highly Available & Very Scalable Data Types Contain Resolution Logic Always Converge Correctly
Convergent & Commutative Replicated Data Types - Shapiro et. al. 2011
Conflict-Free Replicated Data Types
![Page 139: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/139.jpg)
Data types Counters Registers
Sets Maps
Graphs (that all compose)
CRDTStrong Eventual Consistency Replicated & Decentralized Highly Available & Very Scalable Data Types Contain Resolution Logic Always Converge Correctly
Convergent & Commutative Replicated Data Types - Shapiro et. al. 2011
Conflict-Free Replicated Data Types
![Page 140: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/140.jpg)
CRDTs are…
![Page 141: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/141.jpg)
CRDTs are…Associative Batch-insensitive
(grouping doesn't matter) a+(b+c)=(a+b)+c
![Page 142: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/142.jpg)
CRDTs are…Associative Batch-insensitive
(grouping doesn't matter) a+(b+c)=(a+b)+c
Commutative Order-insensitive
(order doesn't matter) a+b=b+a
![Page 143: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/143.jpg)
CRDTs are…Associative Batch-insensitive
(grouping doesn't matter) a+(b+c)=(a+b)+c
Commutative Order-insensitive
(order doesn't matter) a+b=b+a
Idempotent Retransmission-insensitive (duplication does not matter)
a+a=a
![Page 144: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/144.jpg)
Deployment
Serverless
CRDTs
![Page 145: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/145.jpg)
User Function/entity
Deployment
Serverless
CRDTs
![Page 146: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/146.jpg)
User Function/entity
Deployment
States/Deltas IN
Serverless
CRDTs
![Page 147: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/147.jpg)
Message In
User Function/entity
Deployment
States/Deltas IN
Serverless
CRDTs
![Page 148: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/148.jpg)
Message In
User Function/entity
Deployment
Message Out
States/Deltas IN
Serverless
CRDTs
![Page 149: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/149.jpg)
Message In
User Function/entity
Deployment
Message Out
States/Deltas IN States/deltas OUT
Serverless
CRDTs
![Page 150: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/150.jpg)
Message In
User Function/entity
Deployment
Message Out
States/Deltas IN States/deltas OUT
Serverless
CRDTs
![Page 151: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/151.jpg)
Deployment
Serverless
CRUD Using KeyValue
![Page 152: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/152.jpg)
User Function/entity
Deployment
Serverless
CRUD Using KeyValue
![Page 153: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/153.jpg)
User Function/entity
Deployment
Snapshot In (By Entity KEy)
Serverless
CRUD Using KeyValue
![Page 154: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/154.jpg)
Message In
User Function/entity
Deployment
Snapshot In (By Entity KEy)
Serverless
CRUD Using KeyValue
![Page 155: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/155.jpg)
Message In
User Function/entity
Deployment
Message Out
Snapshot In (By Entity KEy)
Serverless
CRUD Using KeyValue
![Page 156: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/156.jpg)
Message In
User Function/entity
Deployment
Message Out
Snapshot In (By Entity KEy)
Snapshot out (By Entity Key)
Serverless
CRUD Using KeyValue
![Page 157: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/157.jpg)
Example CRDT Entity
Presence function in a chat appgithub.com/cloudstateio/samples-java-chat
![Page 158: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/158.jpg)
Protobuf Descriptor
![Page 159: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/159.jpg)
syntax = "proto3";import "cloudstate/entity_key.proto";
package cloudstate.samples.chat.presence;
option java_package = "io.cloudstate.samples.chat.presence";option java_outer_classname = "PresenceProtos";
Protobuf Descriptor
![Page 160: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/160.jpg)
syntax = "proto3";import "cloudstate/entity_key.proto";
package cloudstate.samples.chat.presence;
option java_package = "io.cloudstate.samples.chat.presence";option java_outer_classname = "PresenceProtos";
message User { "// Entity key is the unique entity/function identifier string name = 1 [(.cloudstate.entity_key) = true];}
message OnlineStatus { bool online = 1;}
message Empty {}
Protobuf Descriptor
![Page 161: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/161.jpg)
syntax = "proto3";import "cloudstate/entity_key.proto";
package cloudstate.samples.chat.presence;
option java_package = "io.cloudstate.samples.chat.presence";option java_outer_classname = "PresenceProtos";
message User { "// Entity key is the unique entity/function identifier string name = 1 [(.cloudstate.entity_key) = true];}
message OnlineStatus { bool online = 1;}
message Empty {}
service Presence {
"// Connect the given user rpc Connect(User) returns (stream Empty); "// Monitor the online status of the given user rpc Monitor(User) returns (stream OnlineStatus);}
Protobuf Descriptor
![Page 162: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/162.jpg)
CRDT Entity
![Page 163: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/163.jpg)
@CrdtEntity public class PresenceEntity { private final Vote vote; "// Vote CRDT for this user. It’s auto replicated "// and keeps track how each node has voted private final String username; "// Entity Key (for sharding and routing)
public PresenceEntity( Optional<Vote> vote, CrdtCreationContext ctx, @EntityId String username) { … }
}
CRDT Entity
![Page 164: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/164.jpg)
@CrdtEntity public class PresenceEntity { private final Vote vote; "// Vote CRDT for this user. It’s auto replicated "// and keeps track how each node has voted private final String username; "// Entity Key (for sharding and routing)
public PresenceEntity( Optional<Vote> vote, CrdtCreationContext ctx, @EntityId String username) { … }
}
public static void main(String""... args) { new CloudState()
.registerCrdtEntity(…)
.start(); }
CRDT Entity
![Page 165: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/165.jpg)
@CrdtEntity public class PresenceEntity { private final Vote vote; "// Vote CRDT for this user. It’s auto replicated "// and keeps track how each node has voted private final String username; "// Entity Key (for sharding and routing)
public PresenceEntity( Optional<Vote> vote, CrdtCreationContext ctx, @EntityId String username) { … }
}
"// Here we implement the Protobuf Service API, our business logic @CommandHandler public void connect(StreamedCommandContext<Empty> ctx) { vote.vote(true); …
}
public static void main(String""... args) { new CloudState()
.registerCrdtEntity(…)
.start(); }
CRDT Entity
![Page 166: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/166.jpg)
@CrdtEntity public class PresenceEntity { private final Vote vote; "// Vote CRDT for this user. It’s auto replicated "// and keeps track how each node has voted private final String username; "// Entity Key (for sharding and routing)
public PresenceEntity( Optional<Vote> vote, CrdtCreationContext ctx, @EntityId String username) { … }
}
"// Here we implement the Protobuf Service API, our business logic @CommandHandler public void connect(StreamedCommandContext<Empty> ctx) { vote.vote(true); …
}
public static void main(String""... args) { new CloudState()
.registerCrdtEntity(…)
.start(); }
CRDT Entity
@CommandHandler public OnlineStatus monitor(StreamedCommandContext<OnlineStatus> ctx) { ctx.onChange(change "-> { … }); …
}
![Page 167: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/167.jpg)
Run in Kubernetes
![Page 168: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/168.jpg)
# Install Cloudstatekubectl create namespace cloudstate
Run in Kubernetes
![Page 169: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/169.jpg)
# Install Cloudstatekubectl create namespace cloudstate
kubectl apply -n cloudstate -f https:"//github.com/cloudstateio/cloudstate/releases/download/v0.4/cloudstate-0.4.yaml
Run in Kubernetes
![Page 170: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/170.jpg)
# Install Cloudstatekubectl create namespace cloudstate
kubectl apply -n cloudstate -f https:"//github.com/cloudstateio/cloudstate/releases/download/v0.4/cloudstate-0.4.yaml
Run in Kubernetes
# Install our Presence app and Gateway kubectl apply -f https:"//raw.githubusercontent.com/cloudstateio/samples-java-chat/master/deploy/presence.yaml
![Page 171: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/171.jpg)
# Install Cloudstatekubectl create namespace cloudstate
kubectl apply -n cloudstate -f https:"//github.com/cloudstateio/cloudstate/releases/download/v0.4/cloudstate-0.4.yaml
Run in Kubernetes
# Install our Presence app and Gateway kubectl apply -f https:"//raw.githubusercontent.com/cloudstateio/samples-java-chat/master/deploy/presence.yaml
kubectl apply -f https:"//raw.githubusercontent.com/cloudstateio/samples-java-chat/master/deploy/gateway.yaml
![Page 172: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/172.jpg)
# Install Cloudstatekubectl create namespace cloudstate
kubectl apply -n cloudstate -f https:"//github.com/cloudstateio/cloudstate/releases/download/v0.4/cloudstate-0.4.yaml
Run in Kubernetes
# Install our Presence app and Gateway kubectl apply -f https:"//raw.githubusercontent.com/cloudstateio/samples-java-chat/master/deploy/presence.yaml
kubectl apply -f https:"//raw.githubusercontent.com/cloudstateio/samples-java-chat/master/deploy/gateway.yaml
# Scale up the app to 3 nodeskubectl scale deploy/presence-deployment "--replicas 3
![Page 173: Cloudstate - Towards Stateful Serverless€¦ · 1. Embarrassingly parallel processing tasks—invoked on demand & intermittently, examples include: image processing, object recognition,](https://reader036.fdocuments.us/reader036/viewer/2022062508/60540f2e4c2a5910ad2e395e/html5/thumbnails/173.jpg)
Join Us Try Out
The Next Generation Stateful Serverless
cloudstate.io