SlideShare a Scribd company logo
https://github.com/patricknoir/reactive-platform
Patrick Di Loreto
CTO Addison Global (MoPlay)
https://github.com/patricknoir
http://patricknoir.blogspot.com
@patricknoir
 This architecture was designed for
system pre smart phone generation
 Need for customer acquisition
=> need for SCALABILITY
 Availability became more important
than Consistency (CAP theorem)
Response in a
timely manner
Responsive under
failure scenariosResponsive
under load
Enabler for
responsiveness
Monolithic Microservices
 Average system utilization across organization is 15% to 20%
 The ideal should be around 80%
20% of IT budgets go to operations
“We have created:
Large
Underutilized
Complex
Environments which are costly to maintain”
In => Out
In
Stateful
Out
Database
In => Out
In
Stateless
FaaS
Out
 Has a name
 Is a function from In to Out
 Service[-In, +Out](name: String, f: In => Out)
 Sometime services have to handle a state, so in order to elaborate a
computation: they need to know the current state and they will also
produce an output state.
type StatefulService[S, Input, Output] = Service[(S, Input), (S, Output)]
class Service[In, Out](name: String, f: In => Out)
type In = (S, Input) type Out = (S, Output)
type In = (S, I)
type Out = (S, O)
class Service[In, Out](name: String, f: In => Out)
f: (S, I) => (S, O)
f: I => S => (S, O) // Currying: I => (S => (S, O))
f: I => State[S, O] // S => (S, O) = State[S, O]
class StatefulService[S, I, O](name: String, f: I => State[S, O])
Instruction Time
Execute typical instruction 1/1,000,000,000 = 1 nanosec
Fetch from L1 cache memory 0.5 nanosec
Branch misprediction 5 nanosec
Fetch from L2 cache memory 7 nanosec
Mutex lock/unlock 25 nanosec
Fetch from main memory 100 nanosec
Send 2K bytes over 1Gbps network 20,000 nanosec (20µs)
Read 1MB sequentially from memory 250,000 nanosec (250µs)
Fetch from new disk location (seek) 8,000,000 (8ms)
Read 1MB sequentially from disk 20,000,000 nanosec (20ms)
Send packet US to Europe and back 150,000,000 nanosec (150ms)
Instruction Time
Execute typical instruction 1 s
Fetch from L1 cache memory 0.5 s
Branch misprediction 5 s
Fetch from L2 cache memory 7 s
Mutex lock/unlock ½ s
Fetch from main memory 1½ min
Send 2K bytes over 1Gbps network 5½ hours
Read 1MB sequentially from memory 3 days
Fetch from new disk location (seek) 13 weeks
Read 1MB sequentially from disk 6½ months
Send packet US to Europe and back 5 years
class Service[In, Out](name: String, f: In => Out)
type ReactiveService[I, O] = Service[I, Future[O]]
val f: I => Future[O]
type ReactiveStatefulService[S, I, E] = StatefulService[I, Future[State[S, E]]]
val f: I => Future[State[S, E]]
O = State[S, E]
f: (S, Command) => (S, Event)
val f: Command => State[S, Event]
type Cmd[S] = StatefulService[S, Command, Event]
f: (S, Event) => (S, Event)
val f: Event => State[S, Event]
type Evt[S] = StatefulService[S, Event, Event]
f: (S, Request) => (_, Response)
val f: Request => State[S, Response]
type Ask[S] = StatefulService[S, Request, Response]
(Wallet(id=123, balance=5), DepositCmd(walletId=123, amount=10)) => (Wallet(id=123, balance=15), DepositEvt(walletId=123, amount=10))
(Wallet(id=123, balance=15), SettleWinEvt(walletId=123, amount=10)) => (Wallet(id=123, balance=25), WinSettledEvt(walletId=123, amount=1
(Wallet(id=123, balance=15), GetBalanceReq(walletId=123)) => (_, GetBalanceResp(walletId=123, amount=25))
val reactors: Set[(S, Event) => (S, Event)]val reactors: Set[StatefulService[S, Event, Event]]
val modifiers: Set[StatefulService[S, Command, Event]]val modifiers: Set[(S, Command) => (S, Event)]
trait Processor[S] {
type RootAggregate = S
}
trait View[S] {
type RootAggregate = S
}
val queries: Set[(S, Request) => Response]val queries: Set[StatefulService[S, Request, Response]]
val reactors: Set[(S, Event) => (S, Event)]val reactors: Set[StatefulService[S, Event, Event]]
Processor Actor
Cmd[Debit(10)]
Evt[Credit(50)]
Evt[Debit(20)]
Evt[Credit(15)]
Evt[Debit(10)]
publish
process
View Actor
request
respond
Client App
notify
Actor
[View1]Actor
[View1]Actor
[View1]
PROCESSORS
(WRITE)
VIEWS
(READ)
(Wallet, Cmd) => (Wallet Evt)
(List[Wallet], Req) => Res
(List[Wallet], Evt) => List[Wallet]
Node 1 Node 2 Node 3
 Deployment CI/CD
 Monitoring
 Logging
 Tracing
 Security Auth/Autz
MessageFabric
APIGateway
Pub
Int
Ext
Computation Farm
RDS KV GRAPH HDFS/S3
Repository
Kubernetes
Node
/logs
POD PODPOD
Infra Kubernetes
Federated Prometheus
 Mobile growth changed customer behavior, new needs:
 SCALABILITY is a must to run your business
 Shift on priorities: AVAILABILITY over CONSISTENCY (CAP)
 Infrastructure complexity and operational costs increase with MicroService
Architecture vs Monolith
 Serverless is the way to go but are not yet good enough to manage State
 https://cloudstate.io/
 https://github.com/patricknoir/reactive-platform

More Related Content

What's hot

Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version)
 Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version) Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version)
Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version)
Tobias Pfeiffer
 
How fast is it really? Benchmarking in Practice (Ruby Version)
How fast is it really? Benchmarking in Practice (Ruby Version)How fast is it really? Benchmarking in Practice (Ruby Version)
How fast is it really? Benchmarking in Practice (Ruby Version)
Tobias Pfeiffer
 
The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.9 book - Part 71 of 210The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.9 book - Part 71 of 210
Mahmoud Samir Fayed
 
20150724 jason winston js
20150724 jason winston js20150724 jason winston js
20150724 jason winston js
LearningTech
 
The Ring programming language version 1.6 book - Part 48 of 189
The Ring programming language version 1.6 book - Part 48 of 189The Ring programming language version 1.6 book - Part 48 of 189
The Ring programming language version 1.6 book - Part 48 of 189
Mahmoud Samir Fayed
 
Intro to OTP in Elixir
Intro to OTP in ElixirIntro to OTP in Elixir
Intro to OTP in Elixir
Jesse Anderson
 
dplyr
dplyrdplyr
Seu primeiro loop com Python AsyncIO - TDC 2016
Seu primeiro loop com Python AsyncIO - TDC 2016Seu primeiro loop com Python AsyncIO - TDC 2016
Seu primeiro loop com Python AsyncIO - TDC 2016
Carlos Maniero
 
ES6 generators
ES6 generatorsES6 generators
ES6 generators
Steven Foote
 
Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016
Ben Lesh
 
Python queue solution with asyncio and kafka
Python queue solution with asyncio and kafkaPython queue solution with asyncio and kafka
Python queue solution with asyncio and kafka
Ondřej Veselý
 
[131]해커의 관점에서 바라보기
[131]해커의 관점에서 바라보기[131]해커의 관점에서 바라보기
[131]해커의 관점에서 바라보기
NAVER D2
 
Mongo à la Resque
Mongo à la ResqueMongo à la Resque
Mongo à la Resque
Nicolas Fouché
 
Async Frontiers
Async FrontiersAsync Frontiers
Async Frontiers
Domenic Denicola
 
はじめてのGroovy
はじめてのGroovyはじめてのGroovy
はじめてのGroovy
Tsuyoshi Yamamoto
 
Do you Promise?
Do you Promise?Do you Promise?
Do you Promise?
jungkees
 
Принципы и практики разработки ПО / Principles and practices of software deve...
Принципы и практики разработки ПО / Principles and practices of software deve...Принципы и практики разработки ПО / Principles and practices of software deve...
Принципы и практики разработки ПО / Principles and practices of software deve...
Alexander Granin
 
Solr and Lucene at Etsy - By Gregg Donovan
Solr and Lucene at Etsy - By Gregg DonovanSolr and Lucene at Etsy - By Gregg Donovan
Solr and Lucene at Etsy - By Gregg Donovan
lucenerevolution
 
Solr & Lucene at Etsy
Solr & Lucene at EtsySolr & Lucene at Etsy
Solr & Lucene at Etsy
Lucidworks (Archived)
 

What's hot (20)

Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version)
 Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version) Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version)
Stop Guessing and Start Measuring - Benchmarking Practice (Poly Version)
 
How fast is it really? Benchmarking in Practice (Ruby Version)
How fast is it really? Benchmarking in Practice (Ruby Version)How fast is it really? Benchmarking in Practice (Ruby Version)
How fast is it really? Benchmarking in Practice (Ruby Version)
 
The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.9 book - Part 71 of 210The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.9 book - Part 71 of 210
 
20150724 jason winston js
20150724 jason winston js20150724 jason winston js
20150724 jason winston js
 
The Ring programming language version 1.6 book - Part 48 of 189
The Ring programming language version 1.6 book - Part 48 of 189The Ring programming language version 1.6 book - Part 48 of 189
The Ring programming language version 1.6 book - Part 48 of 189
 
Intro to OTP in Elixir
Intro to OTP in ElixirIntro to OTP in Elixir
Intro to OTP in Elixir
 
dplyr
dplyrdplyr
dplyr
 
Seu primeiro loop com Python AsyncIO - TDC 2016
Seu primeiro loop com Python AsyncIO - TDC 2016Seu primeiro loop com Python AsyncIO - TDC 2016
Seu primeiro loop com Python AsyncIO - TDC 2016
 
ES6 generators
ES6 generatorsES6 generators
ES6 generators
 
Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016
 
Python queue solution with asyncio and kafka
Python queue solution with asyncio and kafkaPython queue solution with asyncio and kafka
Python queue solution with asyncio and kafka
 
[131]해커의 관점에서 바라보기
[131]해커의 관점에서 바라보기[131]해커의 관점에서 바라보기
[131]해커의 관점에서 바라보기
 
Mongo à la Resque
Mongo à la ResqueMongo à la Resque
Mongo à la Resque
 
Flare3d jiglib.as
Flare3d jiglib.asFlare3d jiglib.as
Flare3d jiglib.as
 
Async Frontiers
Async FrontiersAsync Frontiers
Async Frontiers
 
はじめてのGroovy
はじめてのGroovyはじめてのGroovy
はじめてのGroovy
 
Do you Promise?
Do you Promise?Do you Promise?
Do you Promise?
 
Принципы и практики разработки ПО / Principles and practices of software deve...
Принципы и практики разработки ПО / Principles and practices of software deve...Принципы и практики разработки ПО / Principles and practices of software deve...
Принципы и практики разработки ПО / Principles and practices of software deve...
 
Solr and Lucene at Etsy - By Gregg Donovan
Solr and Lucene at Etsy - By Gregg DonovanSolr and Lucene at Etsy - By Gregg Donovan
Solr and Lucene at Etsy - By Gregg Donovan
 
Solr & Lucene at Etsy
Solr & Lucene at EtsySolr & Lucene at Etsy
Solr & Lucene at Etsy
 

Similar to Serverless stateful

Data in Motion: Streaming Static Data Efficiently
Data in Motion: Streaming Static Data EfficientlyData in Motion: Streaming Static Data Efficiently
Data in Motion: Streaming Static Data Efficiently
Martin Zapletal
 
A Playful Introduction to Rx
A Playful Introduction to RxA Playful Introduction to Rx
A Playful Introduction to Rx
Andrey Cheptsov
 
Introducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event ProcessorIntroducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event ProcessorWSO2
 
Functional programming techniques in real-world microservices
Functional programming techniques in real-world microservicesFunctional programming techniques in real-world microservices
Functional programming techniques in real-world microservices
András Papp
 
Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.js
Marcus Frödin
 
Reactive programming every day
Reactive programming every dayReactive programming every day
Reactive programming every day
Vadym Khondar
 
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
InfluxData
 
Hopping in clouds - phpuk 17
Hopping in clouds - phpuk 17Hopping in clouds - phpuk 17
Hopping in clouds - phpuk 17
Michele Orselli
 
Small pieces loosely joined
Small pieces loosely joinedSmall pieces loosely joined
Small pieces loosely joined
ennui2342
 
Spark Streaming with Cassandra
Spark Streaming with CassandraSpark Streaming with Cassandra
Spark Streaming with Cassandra
Jacek Lewandowski
 
ZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in ScalaZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in Scala
Wiem Zine Elabidine
 
Akka.NET streams and reactive streams
Akka.NET streams and reactive streamsAkka.NET streams and reactive streams
Akka.NET streams and reactive streams
Bartosz Sypytkowski
 
5 must have patterns for your microservice - techorama
5 must have patterns for your microservice - techorama5 must have patterns for your microservice - techorama
5 must have patterns for your microservice - techorama
Ali Kheyrollahi
 
Cassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, OverviewCassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, Overview
Joshua McKenzie
 
Flying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnightFlying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnight
Wiem Zine Elabidine
 
Java Se next Generetion
Java Se next GeneretionJava Se next Generetion
Java Se next Generetion
Otávio Santana
 
Практическое применения Akka Streams
Практическое применения Akka StreamsПрактическое применения Akka Streams
Практическое применения Akka Streams
Alexey Romanchuk
 
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
2ГИС Технологии
 
WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor
WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor
WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor WSO2
 
Spring boot - Getting Started
Spring boot - Getting StartedSpring boot - Getting Started
Spring boot - Getting Started
David Schmitz
 

Similar to Serverless stateful (20)

Data in Motion: Streaming Static Data Efficiently
Data in Motion: Streaming Static Data EfficientlyData in Motion: Streaming Static Data Efficiently
Data in Motion: Streaming Static Data Efficiently
 
A Playful Introduction to Rx
A Playful Introduction to RxA Playful Introduction to Rx
A Playful Introduction to Rx
 
Introducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event ProcessorIntroducing the WSO2 Complex Event Processor
Introducing the WSO2 Complex Event Processor
 
Functional programming techniques in real-world microservices
Functional programming techniques in real-world microservicesFunctional programming techniques in real-world microservices
Functional programming techniques in real-world microservices
 
Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.js
 
Reactive programming every day
Reactive programming every dayReactive programming every day
Reactive programming every day
 
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
 
Hopping in clouds - phpuk 17
Hopping in clouds - phpuk 17Hopping in clouds - phpuk 17
Hopping in clouds - phpuk 17
 
Small pieces loosely joined
Small pieces loosely joinedSmall pieces loosely joined
Small pieces loosely joined
 
Spark Streaming with Cassandra
Spark Streaming with CassandraSpark Streaming with Cassandra
Spark Streaming with Cassandra
 
ZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in ScalaZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in Scala
 
Akka.NET streams and reactive streams
Akka.NET streams and reactive streamsAkka.NET streams and reactive streams
Akka.NET streams and reactive streams
 
5 must have patterns for your microservice - techorama
5 must have patterns for your microservice - techorama5 must have patterns for your microservice - techorama
5 must have patterns for your microservice - techorama
 
Cassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, OverviewCassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, Overview
 
Flying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnightFlying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnight
 
Java Se next Generetion
Java Se next GeneretionJava Se next Generetion
Java Se next Generetion
 
Практическое применения Akka Streams
Практическое применения Akka StreamsПрактическое применения Akka Streams
Практическое применения Akka Streams
 
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
 
WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor
WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor
WSO2 Product Release Webinar - Introducing the WSO2 Complex Event Processor
 
Spring boot - Getting Started
Spring boot - Getting StartedSpring boot - Getting Started
Spring boot - Getting Started
 

Recently uploaded

GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 

Recently uploaded (20)

GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 

Serverless stateful

  • 2. Patrick Di Loreto CTO Addison Global (MoPlay) https://github.com/patricknoir http://patricknoir.blogspot.com @patricknoir
  • 3.
  • 4.
  • 5.
  • 6.  This architecture was designed for system pre smart phone generation  Need for customer acquisition => need for SCALABILITY  Availability became more important than Consistency (CAP theorem)
  • 7. Response in a timely manner Responsive under failure scenariosResponsive under load Enabler for responsiveness
  • 9.  Average system utilization across organization is 15% to 20%  The ideal should be around 80% 20% of IT budgets go to operations “We have created: Large Underutilized Complex Environments which are costly to maintain”
  • 10. In => Out In Stateful Out Database In => Out In Stateless FaaS Out
  • 11.  Has a name  Is a function from In to Out  Service[-In, +Out](name: String, f: In => Out)
  • 12.  Sometime services have to handle a state, so in order to elaborate a computation: they need to know the current state and they will also produce an output state. type StatefulService[S, Input, Output] = Service[(S, Input), (S, Output)] class Service[In, Out](name: String, f: In => Out) type In = (S, Input) type Out = (S, Output)
  • 13. type In = (S, I) type Out = (S, O) class Service[In, Out](name: String, f: In => Out) f: (S, I) => (S, O) f: I => S => (S, O) // Currying: I => (S => (S, O)) f: I => State[S, O] // S => (S, O) = State[S, O] class StatefulService[S, I, O](name: String, f: I => State[S, O])
  • 14.
  • 15. Instruction Time Execute typical instruction 1/1,000,000,000 = 1 nanosec Fetch from L1 cache memory 0.5 nanosec Branch misprediction 5 nanosec Fetch from L2 cache memory 7 nanosec Mutex lock/unlock 25 nanosec Fetch from main memory 100 nanosec Send 2K bytes over 1Gbps network 20,000 nanosec (20µs) Read 1MB sequentially from memory 250,000 nanosec (250µs) Fetch from new disk location (seek) 8,000,000 (8ms) Read 1MB sequentially from disk 20,000,000 nanosec (20ms) Send packet US to Europe and back 150,000,000 nanosec (150ms)
  • 16. Instruction Time Execute typical instruction 1 s Fetch from L1 cache memory 0.5 s Branch misprediction 5 s Fetch from L2 cache memory 7 s Mutex lock/unlock ½ s Fetch from main memory 1½ min Send 2K bytes over 1Gbps network 5½ hours Read 1MB sequentially from memory 3 days Fetch from new disk location (seek) 13 weeks Read 1MB sequentially from disk 6½ months Send packet US to Europe and back 5 years
  • 17. class Service[In, Out](name: String, f: In => Out) type ReactiveService[I, O] = Service[I, Future[O]] val f: I => Future[O] type ReactiveStatefulService[S, I, E] = StatefulService[I, Future[State[S, E]]] val f: I => Future[State[S, E]] O = State[S, E]
  • 18. f: (S, Command) => (S, Event) val f: Command => State[S, Event] type Cmd[S] = StatefulService[S, Command, Event] f: (S, Event) => (S, Event) val f: Event => State[S, Event] type Evt[S] = StatefulService[S, Event, Event] f: (S, Request) => (_, Response) val f: Request => State[S, Response] type Ask[S] = StatefulService[S, Request, Response] (Wallet(id=123, balance=5), DepositCmd(walletId=123, amount=10)) => (Wallet(id=123, balance=15), DepositEvt(walletId=123, amount=10)) (Wallet(id=123, balance=15), SettleWinEvt(walletId=123, amount=10)) => (Wallet(id=123, balance=25), WinSettledEvt(walletId=123, amount=1 (Wallet(id=123, balance=15), GetBalanceReq(walletId=123)) => (_, GetBalanceResp(walletId=123, amount=25))
  • 19. val reactors: Set[(S, Event) => (S, Event)]val reactors: Set[StatefulService[S, Event, Event]] val modifiers: Set[StatefulService[S, Command, Event]]val modifiers: Set[(S, Command) => (S, Event)] trait Processor[S] { type RootAggregate = S }
  • 20. trait View[S] { type RootAggregate = S } val queries: Set[(S, Request) => Response]val queries: Set[StatefulService[S, Request, Response]] val reactors: Set[(S, Event) => (S, Event)]val reactors: Set[StatefulService[S, Event, Event]]
  • 21. Processor Actor Cmd[Debit(10)] Evt[Credit(50)] Evt[Debit(20)] Evt[Credit(15)] Evt[Debit(10)] publish process View Actor request respond Client App notify Actor [View1]Actor [View1]Actor [View1] PROCESSORS (WRITE) VIEWS (READ) (Wallet, Cmd) => (Wallet Evt) (List[Wallet], Req) => Res (List[Wallet], Evt) => List[Wallet]
  • 22.
  • 23. Node 1 Node 2 Node 3
  • 24.  Deployment CI/CD  Monitoring  Logging  Tracing  Security Auth/Autz
  • 26.
  • 28.
  • 30.  Mobile growth changed customer behavior, new needs:  SCALABILITY is a must to run your business  Shift on priorities: AVAILABILITY over CONSISTENCY (CAP)  Infrastructure complexity and operational costs increase with MicroService Architecture vs Monolith  Serverless is the way to go but are not yet good enough to manage State  https://cloudstate.io/