SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
Presented By:
Himanshu Gupta
Anjali Sharma
Knoldus Inc
Cloudstate
Distributed State Management for
Serverless
Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
Punctuality
Respect Knolx session timings,
you are requested not to join
sessions after a 5 minutes
threshold post the session start
time.
Feedback
Make sure to submit a
constructive feedback for all
sessions as it is very helpful for
the presenter.
Silent Mode
Keep your screens on mute
unless you have query.
Avoid Disturbance
Avoid unwanted chit chat during
the session.
Agenda
01 What is Serverless Computing
02 Limitations of Serverless Platforms
03 Rethinking CRUD
04 About Cloudstate and its architecture
05 Working with Cloudstate
What is Serverless Computing ?
● Serverless computing is a method of
providing backend services on an
as-used basis
● Serverless means that the developers
can do their work without having to
worry about servers at all.
What is Serverless Computing ?
Simplified Scalability
Low Latency
Easily Deployable
Cost Effective
No Server
Management Required
Benefits of Serverless Computing
Stateless
Latency
No addressability
Limitations of Serverless Platforms
Stateless
● Aside from the components that are explicitly designed to be data stores, most
Serverless components are effectively stateless
● Forces to load and store the state from the backend storage over and over again.
● Stateless components must, by definition, interact with other, stateful components
to persist any information beyond their immediate lifespan.
Limitations of Serverless Platforms
Latency
● Serverless faces two kinds of latency challenges: cold-starts and high tail latencies
● When the first user request arrives, the serverless platform needs to load the
function.
● Cold-starts are avoided by keeping one copy running, by forecasting when the first
call happens, or by improving the startup time of the code.
Limitations of Serverless Platforms
No Addressability
● Quite often, functions simply have no direct addressability
● They can’t communicate directly with each other using point-to-point
communication.
● This forces developers to resort to publish-subscribe, passing all data over some
slow and expensive storage medium.
Limitations of Serverless Platforms
● We need to rethink the use of CRUD in Serverless.
● CRUD, in the general sense, means unconstrained database access, and is too broad
and open-ended to be used effectively in Serverless environments
● You are thereby moving all the operational concerns from the Serverless framework
into the user function
Rethinking CRUD
● Is the operation a read, or
a write?
● Can it be cached?
● Can consistency be
relaxed, or is strong
consistency needed?
● Can operations proceed
during partial failure?
Rethinking CRUD
Abstracting over State
● When we try to use the existing
CRUD strategy then maintaining
the state becomes difficult.
● Unconstrained CRUD does not
work in this model since we can’t
pass the entire data set in and
out of the function.
Solution?
Restricted I/O Patterns
Rethinking CRUD
Event Sourcing
In Event Sourcing, state in is the event
log while state out is any newly persisted
events as a result of handling a
command.
Restricted I/O Patterns
CRDTs
In CRDTs, state in is a stream of deltas
and/or state updates, and state out is a
stream of deltas and/or state updates.
Restricted I/O Patterns
Key-Value
This is the least complex and most used
pattern. As in it, the Key is the State Out
and the Value is the State In.
VALUE KEY
Restricted I/O Patterns
Cloudstate is a specification, protocol, and reference implementation
for providing distributed state management patterns suitable for
Serverless computing.
– cloudstate.io
About Cloudstate and its Architecture
● In simple terms, Cloudstate is a framework that helps in building Distributed Stateful
Serverless Applications.
● It supports a variety of serverless patterns, like:
○ Event Sourcing
○ Conflict-Free Replicated Data Types (CRDTs)
○ Key-Value storage
○ P2P messaging, and
○ CQRS read side projections
● It is polyglot, which means that services can be written in any language that supports
gRPC, like (Dart, Go, Java, Javascript, Kotlin, Python, Sprint Boot, .Net).
What is Cloudstate?
● Cloudstate is built on top of K8,
Knative, Graal VM, gRPC, and Akka.
● A gRPC channel is used for both –
Inbound & Outbound
communication which goes
through sidecars.
● Also, a single gRPC channel is
used per service/entity which
allows the infrastructure to
safely cache the entity state in
memory.
Bird’s Eye View of its Architecture
● The Knative Stateful Serving is an
Akka Cluster under the hood.
● It provides durable Akka Actors
which in turn supports several
data models, storage techniques,
and DBs.
● This shields the User from the
complexities of the Akka Cluster
via a set of sidecars which
bridges the user code to the
backend state & cluster
management.
What is present Under the Hood?
The first step we need to take is, decide the
programming language of our choice.
Cloudstate have connectors for a wide range
of programming languages. Like:
1. Dart
2. Go
3. Java
4. Kotlin
5. Javascript
Choose Your Language Wisely
● The next step of working with
Cloudstate is to focus on the
business logic.
● Yes, you read it correctly. You
don’t have to take care of the
nitty-gritty details anymore.
● You just need to provide a
Kubernetes environment and run
your Cloudstate services on it.
Focus on Business Logic
● Ingress: Cloudstate expects traffic
to be distributed evenly across its
pods. Hence any service approach,
like Istio, Knative, or just regular
ClusterIP service communication in
K8 can be used.
● Akka Sidecar: It is injected by the
Cloudstate operator. All requests go
through it.
● f(x): This represents the function
implemented by the user.
● Distributed DB: This is the place
where state is persisted in form
events.
Cloudstate Service Structure
References
01 Lightbend Series from Knoldus Inc.
02 Cloudstate official documentation
Thank You !
For further queries reach out to us at:
himanshu@knoldus.com
anjali.sharma@knoldus.com

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Akka Remoting
Akka RemotingAkka Remoting
Akka Remoting
 
The Load Balancer: War Stories with HAProxy
The Load Balancer: War Stories with HAProxyThe Load Balancer: War Stories with HAProxy
The Load Balancer: War Stories with HAProxy
 
Nagios Conference 2014 - Bryan Heden - 10,000 Services Across The State of Ohio
Nagios Conference 2014 - Bryan Heden - 10,000 Services Across The State of OhioNagios Conference 2014 - Bryan Heden - 10,000 Services Across The State of Ohio
Nagios Conference 2014 - Bryan Heden - 10,000 Services Across The State of Ohio
 
Embracing SDN in the Next Gen Network
Embracing SDN in the Next Gen NetworkEmbracing SDN in the Next Gen Network
Embracing SDN in the Next Gen Network
 
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...
 
Backend, Simplified - A sane look on the mobile backend world, Nir Orpaz, Mob...
Backend, Simplified - A sane look on the mobile backend world, Nir Orpaz, Mob...Backend, Simplified - A sane look on the mobile backend world, Nir Orpaz, Mob...
Backend, Simplified - A sane look on the mobile backend world, Nir Orpaz, Mob...
 
How To Build, Integrate, and Deploy Real-Time Streaming Pipelines On Kubernetes
How To Build, Integrate, and Deploy Real-Time Streaming Pipelines On KubernetesHow To Build, Integrate, and Deploy Real-Time Streaming Pipelines On Kubernetes
How To Build, Integrate, and Deploy Real-Time Streaming Pipelines On Kubernetes
 
Man in the Binder - Michael Shalyt & Idan Revivo, CheckPoint
Man in the Binder - Michael Shalyt & Idan Revivo, CheckPointMan in the Binder - Michael Shalyt & Idan Revivo, CheckPoint
Man in the Binder - Michael Shalyt & Idan Revivo, CheckPoint
 
Flink Forward Berlin 2018: Wei-Che (Tony) Wei - "Lessons learned from Migrati...
Flink Forward Berlin 2018: Wei-Che (Tony) Wei - "Lessons learned from Migrati...Flink Forward Berlin 2018: Wei-Che (Tony) Wei - "Lessons learned from Migrati...
Flink Forward Berlin 2018: Wei-Che (Tony) Wei - "Lessons learned from Migrati...
 
Monitoring Serverless Applications with Datadog
Monitoring Serverless Applications with DatadogMonitoring Serverless Applications with Datadog
Monitoring Serverless Applications with Datadog
 
Cloud Economics - Crayon Optimization Services
Cloud Economics - Crayon Optimization ServicesCloud Economics - Crayon Optimization Services
Cloud Economics - Crayon Optimization Services
 
How to move from Monolith to Microservice
How to move from Monolith to MicroserviceHow to move from Monolith to Microservice
How to move from Monolith to Microservice
 
SDN at schuberg philis
SDN at schuberg philisSDN at schuberg philis
SDN at schuberg philis
 
Nagios Conference 2012 - Jason Cook - Nagios and Mod-Gearman
Nagios Conference 2012 - Jason Cook - Nagios and Mod-GearmanNagios Conference 2012 - Jason Cook - Nagios and Mod-Gearman
Nagios Conference 2012 - Jason Cook - Nagios and Mod-Gearman
 
Control and monitor_microservices_with_microprofile
Control and monitor_microservices_with_microprofileControl and monitor_microservices_with_microprofile
Control and monitor_microservices_with_microprofile
 
Dynatrace - Red Hat workshop : Monolith to Microservices
Dynatrace - Red Hat workshop : Monolith to MicroservicesDynatrace - Red Hat workshop : Monolith to Microservices
Dynatrace - Red Hat workshop : Monolith to Microservices
 
Akanda: Open Source, Production-Ready Network Virtualization for OpenStack
Akanda: Open Source, Production-Ready Network Virtualization for OpenStackAkanda: Open Source, Production-Ready Network Virtualization for OpenStack
Akanda: Open Source, Production-Ready Network Virtualization for OpenStack
 
REVOLUTION - Transforming the network with Open SDN
REVOLUTION - Transforming the network with Open SDNREVOLUTION - Transforming the network with Open SDN
REVOLUTION - Transforming the network with Open SDN
 
Transactions in micro-services (fall 2019)
Transactions in micro-services (fall 2019)Transactions in micro-services (fall 2019)
Transactions in micro-services (fall 2019)
 
Skynet project: Monitor, analyze, scale, and maintain a system in the Cloud
Skynet project: Monitor, analyze, scale, and maintain a system in the CloudSkynet project: Monitor, analyze, scale, and maintain a system in the Cloud
Skynet project: Monitor, analyze, scale, and maintain a system in the Cloud
 

Similar a Introduction to Akka Serverless

Cpp In Soa
Cpp In SoaCpp In Soa
Cpp In Soa
WSO2
 
NATS in action - A Real time Microservices Architecture handled by NATS
NATS in action - A Real time Microservices Architecture handled by NATSNATS in action - A Real time Microservices Architecture handled by NATS
NATS in action - A Real time Microservices Architecture handled by NATS
Raül Pérez
 

Similar a Introduction to Akka Serverless (20)

DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
 
3 Ways to Deliver an Elastic, Cost-Effective Cloud Architecture
3 Ways to Deliver an Elastic, Cost-Effective Cloud Architecture3 Ways to Deliver an Elastic, Cost-Effective Cloud Architecture
3 Ways to Deliver an Elastic, Cost-Effective Cloud Architecture
 
[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...
[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...
[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...
 
3 Ways to Deliver an Elastic, Cost-Effective Cloud Architecture (ANZ)
3 Ways to Deliver an Elastic, Cost-Effective Cloud Architecture (ANZ)3 Ways to Deliver an Elastic, Cost-Effective Cloud Architecture (ANZ)
3 Ways to Deliver an Elastic, Cost-Effective Cloud Architecture (ANZ)
 
API Microservices with Node.js and Docker
API Microservices with Node.js and DockerAPI Microservices with Node.js and Docker
API Microservices with Node.js and Docker
 
Cpp In Soa
Cpp In SoaCpp In Soa
Cpp In Soa
 
Not my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureNot my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructure
 
linkerd.pdf
linkerd.pdflinkerd.pdf
linkerd.pdf
 
Montreal MuleSoft_Meetup_16-Aug.pptx
Montreal MuleSoft_Meetup_16-Aug.pptxMontreal MuleSoft_Meetup_16-Aug.pptx
Montreal MuleSoft_Meetup_16-Aug.pptx
 
RethinkConn 2022!
RethinkConn 2022!RethinkConn 2022!
RethinkConn 2022!
 
'How to build efficient backend based on microservice architecture' by Anton ...
'How to build efficient backend based on microservice architecture' by Anton ...'How to build efficient backend based on microservice architecture' by Anton ...
'How to build efficient backend based on microservice architecture' by Anton ...
 
NATS in action - A Real time Microservices Architecture handled by NATS
NATS in action - A Real time Microservices Architecture handled by NATSNATS in action - A Real time Microservices Architecture handled by NATS
NATS in action - A Real time Microservices Architecture handled by NATS
 
Nats in action a real time microservices architecture handled by nats
Nats in action   a real time microservices architecture handled by natsNats in action   a real time microservices architecture handled by nats
Nats in action a real time microservices architecture handled by nats
 
Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservices
 
Multi-Tenant SOA Middleware for Cloud Computing
Multi-Tenant SOA Middleware for Cloud ComputingMulti-Tenant SOA Middleware for Cloud Computing
Multi-Tenant SOA Middleware for Cloud Computing
 
Deploy Microservices in the Real World
Deploy Microservices in the Real WorldDeploy Microservices in the Real World
Deploy Microservices in the Real World
 
Horizontal Scaling for Millions of Customers!
Horizontal Scaling for Millions of Customers! Horizontal Scaling for Millions of Customers!
Horizontal Scaling for Millions of Customers!
 
Platform without vendor lock-in
Platform without vendor lock-inPlatform without vendor lock-in
Platform without vendor lock-in
 
Software Architecture for Cloud Infrastructure
Software Architecture for Cloud InfrastructureSoftware Architecture for Cloud Infrastructure
Software Architecture for Cloud Infrastructure
 

Más de Knoldus Inc.

Más de Knoldus Inc. (20)

Supply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptxSupply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptx
 
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On Introduction
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptx
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptx
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdf
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptx
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable Testing
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose Kubernetes
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptx
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptx
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptx
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptx
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptx
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake Presentation
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics Presentation
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II Presentation
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRA
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Introduction to Akka Serverless

  • 1. Presented By: Himanshu Gupta Anjali Sharma Knoldus Inc Cloudstate Distributed State Management for Serverless
  • 2. Lack of etiquette and manners is a huge turn off. KnolX Etiquettes Punctuality Respect Knolx session timings, you are requested not to join sessions after a 5 minutes threshold post the session start time. Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter. Silent Mode Keep your screens on mute unless you have query. Avoid Disturbance Avoid unwanted chit chat during the session.
  • 3. Agenda 01 What is Serverless Computing 02 Limitations of Serverless Platforms 03 Rethinking CRUD 04 About Cloudstate and its architecture 05 Working with Cloudstate
  • 4. What is Serverless Computing ?
  • 5. ● Serverless computing is a method of providing backend services on an as-used basis ● Serverless means that the developers can do their work without having to worry about servers at all. What is Serverless Computing ?
  • 6. Simplified Scalability Low Latency Easily Deployable Cost Effective No Server Management Required Benefits of Serverless Computing
  • 8. Stateless ● Aside from the components that are explicitly designed to be data stores, most Serverless components are effectively stateless ● Forces to load and store the state from the backend storage over and over again. ● Stateless components must, by definition, interact with other, stateful components to persist any information beyond their immediate lifespan. Limitations of Serverless Platforms
  • 9. Latency ● Serverless faces two kinds of latency challenges: cold-starts and high tail latencies ● When the first user request arrives, the serverless platform needs to load the function. ● Cold-starts are avoided by keeping one copy running, by forecasting when the first call happens, or by improving the startup time of the code. Limitations of Serverless Platforms
  • 10. No Addressability ● Quite often, functions simply have no direct addressability ● They can’t communicate directly with each other using point-to-point communication. ● This forces developers to resort to publish-subscribe, passing all data over some slow and expensive storage medium. Limitations of Serverless Platforms
  • 11. ● We need to rethink the use of CRUD in Serverless. ● CRUD, in the general sense, means unconstrained database access, and is too broad and open-ended to be used effectively in Serverless environments ● You are thereby moving all the operational concerns from the Serverless framework into the user function Rethinking CRUD
  • 12. ● Is the operation a read, or a write? ● Can it be cached? ● Can consistency be relaxed, or is strong consistency needed? ● Can operations proceed during partial failure? Rethinking CRUD
  • 13. Abstracting over State ● When we try to use the existing CRUD strategy then maintaining the state becomes difficult. ● Unconstrained CRUD does not work in this model since we can’t pass the entire data set in and out of the function. Solution? Restricted I/O Patterns Rethinking CRUD
  • 14. Event Sourcing In Event Sourcing, state in is the event log while state out is any newly persisted events as a result of handling a command. Restricted I/O Patterns
  • 15. CRDTs In CRDTs, state in is a stream of deltas and/or state updates, and state out is a stream of deltas and/or state updates. Restricted I/O Patterns
  • 16. Key-Value This is the least complex and most used pattern. As in it, the Key is the State Out and the Value is the State In. VALUE KEY Restricted I/O Patterns
  • 17. Cloudstate is a specification, protocol, and reference implementation for providing distributed state management patterns suitable for Serverless computing. – cloudstate.io About Cloudstate and its Architecture
  • 18. ● In simple terms, Cloudstate is a framework that helps in building Distributed Stateful Serverless Applications. ● It supports a variety of serverless patterns, like: ○ Event Sourcing ○ Conflict-Free Replicated Data Types (CRDTs) ○ Key-Value storage ○ P2P messaging, and ○ CQRS read side projections ● It is polyglot, which means that services can be written in any language that supports gRPC, like (Dart, Go, Java, Javascript, Kotlin, Python, Sprint Boot, .Net). What is Cloudstate?
  • 19. ● Cloudstate is built on top of K8, Knative, Graal VM, gRPC, and Akka. ● A gRPC channel is used for both – Inbound & Outbound communication which goes through sidecars. ● Also, a single gRPC channel is used per service/entity which allows the infrastructure to safely cache the entity state in memory. Bird’s Eye View of its Architecture
  • 20. ● The Knative Stateful Serving is an Akka Cluster under the hood. ● It provides durable Akka Actors which in turn supports several data models, storage techniques, and DBs. ● This shields the User from the complexities of the Akka Cluster via a set of sidecars which bridges the user code to the backend state & cluster management. What is present Under the Hood?
  • 21. The first step we need to take is, decide the programming language of our choice. Cloudstate have connectors for a wide range of programming languages. Like: 1. Dart 2. Go 3. Java 4. Kotlin 5. Javascript Choose Your Language Wisely
  • 22. ● The next step of working with Cloudstate is to focus on the business logic. ● Yes, you read it correctly. You don’t have to take care of the nitty-gritty details anymore. ● You just need to provide a Kubernetes environment and run your Cloudstate services on it. Focus on Business Logic
  • 23. ● Ingress: Cloudstate expects traffic to be distributed evenly across its pods. Hence any service approach, like Istio, Knative, or just regular ClusterIP service communication in K8 can be used. ● Akka Sidecar: It is injected by the Cloudstate operator. All requests go through it. ● f(x): This represents the function implemented by the user. ● Distributed DB: This is the place where state is persisted in form events. Cloudstate Service Structure
  • 24. References 01 Lightbend Series from Knoldus Inc. 02 Cloudstate official documentation
  • 25. Thank You ! For further queries reach out to us at: himanshu@knoldus.com anjali.sharma@knoldus.com