SlideShare une entreprise Scribd logo
1  sur  31
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

Contenu connexe

Tendances

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 210Mahmoud Samir Fayed
 
20150724 jason winston js
20150724 jason winston js20150724 jason winston js
20150724 jason winston jsLearningTech
 
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 189Mahmoud Samir Fayed
 
Intro to OTP in Elixir
Intro to OTP in ElixirIntro to OTP in Elixir
Intro to OTP in ElixirJesse Anderson
 
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 2016Carlos Maniero
 
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 2016Ben 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 kafkaOndřej Veselý
 
[131]해커의 관점에서 바라보기
[131]해커의 관점에서 바라보기[131]해커의 관점에서 바라보기
[131]해커의 관점에서 바라보기NAVER D2
 
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 Donovanlucenerevolution
 

Tendances (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
 

Similaire à 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 EfficientlyMartin Zapletal
 
A Playful Introduction to Rx
A Playful Introduction to RxA Playful Introduction to Rx
A Playful Introduction to RxAndrey 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 microservicesAndrá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.jsMarcus Frödin
 
Reactive programming every day
Reactive programming every dayReactive programming every day
Reactive programming every dayVadym 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 17Michele Orselli
 
Small pieces loosely joined
Small pieces loosely joinedSmall pieces loosely joined
Small pieces loosely joinedennui2342
 
Spark Streaming with Cassandra
Spark Streaming with CassandraSpark Streaming with Cassandra
Spark Streaming with CassandraJacek 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 ScalaWiem Zine Elabidine
 
Akka.NET streams and reactive streams
Akka.NET streams and reactive streamsAkka.NET streams and reactive streams
Akka.NET streams and reactive streamsBartosz 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 - techoramaAli Kheyrollahi
 
Cassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, OverviewCassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, OverviewJoshua 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 midnightWiem Zine Elabidine
 
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС2ГИС Технологии
 
Практическое применения Akka Streams
Практическое применения Akka StreamsПрактическое применения Akka Streams
Практическое применения Akka StreamsAlexey Romanchuk
 
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 StartedDavid Schmitz
 

Similaire à 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» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
 
Практическое применения Akka Streams
Практическое применения Akka StreamsПрактическое применения Akka Streams
Практическое применения Akka Streams
 
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
 

Dernier

SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 

Dernier (20)

SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 

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/