SlideShare a Scribd company logo
INCREASING AGILITY
WITH PHP AND KAFKA
1
EVENT DRIVEN
ARCHITECTURE
HELLO!
I am Mike Bywater
I am Head Of Software
Development at
Entanet
@MikeBywater
2
AGILE
3
CONTINUOUS DELIVERY
DEVOPS
SCRUM
CONTINUOUS INTEGRATION
KANBAN
“agility
Dictionary result for agility
/əˈdʒɪlɪti/
noun
1. ability to move quickly and easily.
2. "though he was without formal
training as dancer or athlete, his
physical agility was inexhaustible"
4
Removing technical obstacles
that inhibit agility
Reacting to significant
changes in state
1.
EVENT DRIVEN
ARCHITECTURE
5
6
ORDERING
INVOICING
SHIPPING
WAREHOUSE
LOGGING
● REST applications are
an event → command
pattern.
● Coupled in multiple
ways
● Endpoint is known
(i.e., the service
address).
● Method being called is
also known (i.e., an
API call to doStuff)
● Calls tend to return a
value; they are
synchronous.
UI
Request
orders.create
Response
Order created
ORDERING
INVOICING WAREHOUSE
SHIPPING LOGGING
7
● REST applications are
an event → command
pattern.
● Coupled in multiple
ways
● Endpoint is known
(i.e., the service
address).
● Method being called is
also known (i.e., an
API call to doStuff)
● Calls tend to return a
value; they are
synchronous.
UI
orders.create shipping.status
8
● We are tightly coupled
● If any service fails the whole system does
● Any code deployment potentially affects the entire system
● Even if we split teams into domains (DDD) we still have to
understand other systems to request data
● All systems need to know about each other (endpoints, data
schema)
2.
EVENT
NOTIFICATION
Informing other
applications something has
happened
ORDERING
INVOICING WAREHOUSE
SHIPPING LOGGING
10
● Some asynchronous
behaviour
● Upstream services
don’t need to
understand about
downstream services
● Limited data
transfered
UI
shipping.status
MESSAGE QUEUE
order created
orders.create
order.details
order created order created
order created order created
{
“event” : “order-created”,
“order” : 123456
}
11
● Services still depend on each other for data requests
● Resilience still a potential issue
● Knowledge of upstream service still required
● Upstream services no longer need to understand
anything about downstream processors
● Downstream services can fail without bringing down
upstream services
3.
Event-Carried
State Transfer
Decoupling Systems,
Increasing Stability
13
● Communication
asynchronous
● Applications fully
decoupled
● No restriction on
schema, no shared
datastore
● Microservices
independent,
increased
resiliency
● Microservices state
still important,
persistent
ORDERING
INVOICING WAREHOUSE SHIPPING
LOGGING
MESSAGE QUEUE
Order
Placed
Order
Placed
Invoice
Generated
Order
Placed
Item
Found
Item
Found
Item
Shipped
Order
Placed
Item
Shipped
All
Events
Invoice
Generated
14
{
“order”: 123456,
“user” : “Mike Bywater”,
“product” : “Muscle Vest”,
“price” : “40.00”,
“address” : “Telford TF3 2NS”
}
15
16
4.
Event Sourcing
Event stream as the source
of truth
18
19
20
21
● Complete Rebuild: We can discard the application state completely and
rebuild it by re-running the events from the event log on an empty application.
● Temporal Query: We can determine the application state at any point in time.
Notionally we do this by starting with a blank state and rerunning the events up
to a particular time or event. We can take this further by considering multiple
timelines (analogous to branching in a version control system).
● Event Replay: If we find a past event was incorrect, we can compute the
consequences by reversing it and later events and then replaying the new
event and later events. (Or indeed by throwing away the application state and
replaying all events with the correct event in sequence.) The same technique
can handle events received in the wrong sequence - a common problem with
systems that communicate with asynchronous messaging.
22
● Application state is no longer required to be persistent
● We may still persist in a database if the time taken to churn
through events is too slow
● We can create new services / data models an use the event
stream to put them in a state as if they had always existed
● Be wary of using if events cause interactions with 3rd party
systems or systems not designed with event sourcing in
mind
● Examples - Account Balances, Logging, Metrics
4.
DEMONSTRATION
Cat Facts
24
UI
FACTS GENERATOR SMS SERVICE
LOGGING
KAFKA
User
Subscribed
User
Subscribed
User Fact
Generated
Text
Sent
All
Events
Send Texts
User
Subscribed
User Fact
Generated
25
▹ Decoupling: Services don’t know
anything about upstream or
downstream services
▹ Encapsulation: There are clean
boundaries between services
▹ Evolutionary change: The system
and events can change over time
▹ Event sourcing: When using a log
and log-aware processors, we
gain the ability to easily rebuild
(and replay) application state
▹ Form small autonomous teams
▹ Safe experimentation
▹ New services can be tested using
real events, state can be
compared
▹ Refactoring of legacy code into
microservices is made easier
▹ Easier to decouple code into
small microservices
▹ Deployments can be more
frequent, affect less code and
have a lower chance of breaking
systems
THANKS!
Any questions?
You can find me at:
@mikebywater
mike.bywater@enta.net
26
FURTHER READING
▹ What do you mean by “Event-Driven”? - Martin Fowler
▹ Using Apache Kafka as a Scalable, Event-Driven Backbone for
Service Architectures - Ben Stopford
▹ Journey To Event Driven - Neil Avery
27

More Related Content

What's hot (14)

PDF
Flowable What´s coming next?
Flowable
 
PDF
Hello Lambda - How to call Lambdas on AWS
David Roberts
 
PDF
3 Ways to Deliver an Elastic, Cost-Effective Cloud Architecture (ANZ)
confluent
 
PPTX
Spring Services
Kasun Madusanke
 
PDF
Go Observability (in practice)
Eran Levy
 
PDF
Advanced process migration with Flowable
Flowable
 
PPTX
Simulating Different-Network Speeds using JMETER
Agile Testing Alliance
 
PDF
Flink Forward Berlin 2018: Lasse Nedergaard - "Our successful journey with Fl...
Flink Forward
 
PPTX
Distributing Transactions using MassTransit
Chris Patterson
 
PPTX
Multi touch attribution
Maxwell Goldbas
 
PPTX
Flux - An open sourced Workflow orchestrator from Flipkart
Shyam Kumar Akirala
 
PDF
Leaving Behind Legacy
Adrian Ryan
 
PDF
LEAN IT Infrastructure
Rob Betcher
 
PDF
The Reactive Principles: Eight Tenets For Building Cloud Native Applications
Lightbend
 
Flowable What´s coming next?
Flowable
 
Hello Lambda - How to call Lambdas on AWS
David Roberts
 
3 Ways to Deliver an Elastic, Cost-Effective Cloud Architecture (ANZ)
confluent
 
Spring Services
Kasun Madusanke
 
Go Observability (in practice)
Eran Levy
 
Advanced process migration with Flowable
Flowable
 
Simulating Different-Network Speeds using JMETER
Agile Testing Alliance
 
Flink Forward Berlin 2018: Lasse Nedergaard - "Our successful journey with Fl...
Flink Forward
 
Distributing Transactions using MassTransit
Chris Patterson
 
Multi touch attribution
Maxwell Goldbas
 
Flux - An open sourced Workflow orchestrator from Flipkart
Shyam Kumar Akirala
 
Leaving Behind Legacy
Adrian Ryan
 
LEAN IT Infrastructure
Rob Betcher
 
The Reactive Principles: Eight Tenets For Building Cloud Native Applications
Lightbend
 

Similar to Increasing agility with php and kafka (20)

PDF
Restate: Event-driven Asynchronous Services, Easy as Synchronous RPC
HostedbyConfluent
 
PDF
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JSFestUA
 
PDF
'How to build efficient backend based on microservice architecture' by Anton ...
OdessaJS Conf
 
PDF
Scalability truths and serverless architectures
Regunath B
 
PPTX
Data Con LA 2022 - Event Sourcing with Apache Pulsar and Apache Quarkus
Data Con LA
 
PDF
OSDC 2018 | From Monolith to Microservices by Paul Puschmann_
NETWAYS
 
PDF
Blue-green deploys with Pulsar & Envoy in an event-driven microservice ecosys...
StreamNative
 
PDF
App resiliency detecting and preventing issues in distributed apps
Ram Maddali
 
PPTX
WF_in_retail_banking_enterprise_systems
Oleh Zheleznyak
 
PDF
Service Mesh Talk for CTO Forum
Rick Hightower
 
PDF
“Sh*^%# on Fire, Yo!”: A True Story Inspired by Real Events
VMware Tanzu
 
PPTX
Inventory management using temporal workflow engine
salman4test2
 
PPTX
Service Mesh CTO Forum (Draft 3)
Rick Hightower
 
PPTX
Monoliths to Microservices: App Transformation - Jacksonville Workshop Slides
Tiera Fann, MBA
 
PDF
Citi Tech Talk: Event Driven Kafka Microservices
confluent
 
PDF
Manage the Digital Transformation with Machine Learning in a Reactive Microse...
DataWorks Summit
 
PDF
Confluent & GSI Webinars series - Session 3
confluent
 
PPTX
Microservices: Breaking Apart the Monolith
Iron.io
 
PDF
Kafka Summit NYC 2017 - Scalable Real-Time Complex Event Processing @ Uber
confluent
 
PDF
Testing Event Driven Architectures: How to Broker the Complexity | Frank Kilc...
HostedbyConfluent
 
Restate: Event-driven Asynchronous Services, Easy as Synchronous RPC
HostedbyConfluent
 
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JSFestUA
 
'How to build efficient backend based on microservice architecture' by Anton ...
OdessaJS Conf
 
Scalability truths and serverless architectures
Regunath B
 
Data Con LA 2022 - Event Sourcing with Apache Pulsar and Apache Quarkus
Data Con LA
 
OSDC 2018 | From Monolith to Microservices by Paul Puschmann_
NETWAYS
 
Blue-green deploys with Pulsar & Envoy in an event-driven microservice ecosys...
StreamNative
 
App resiliency detecting and preventing issues in distributed apps
Ram Maddali
 
WF_in_retail_banking_enterprise_systems
Oleh Zheleznyak
 
Service Mesh Talk for CTO Forum
Rick Hightower
 
“Sh*^%# on Fire, Yo!”: A True Story Inspired by Real Events
VMware Tanzu
 
Inventory management using temporal workflow engine
salman4test2
 
Service Mesh CTO Forum (Draft 3)
Rick Hightower
 
Monoliths to Microservices: App Transformation - Jacksonville Workshop Slides
Tiera Fann, MBA
 
Citi Tech Talk: Event Driven Kafka Microservices
confluent
 
Manage the Digital Transformation with Machine Learning in a Reactive Microse...
DataWorks Summit
 
Confluent & GSI Webinars series - Session 3
confluent
 
Microservices: Breaking Apart the Monolith
Iron.io
 
Kafka Summit NYC 2017 - Scalable Real-Time Complex Event Processing @ Uber
confluent
 
Testing Event Driven Architectures: How to Broker the Complexity | Frank Kilc...
HostedbyConfluent
 
Ad

Recently uploaded (20)

PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PPTX
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PDF
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
MiniTool Power Data Recovery 8.8 With Crack New Latest 2025
bashirkhan333g
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Ad

Increasing agility with php and kafka

  • 1. INCREASING AGILITY WITH PHP AND KAFKA 1 EVENT DRIVEN ARCHITECTURE
  • 2. HELLO! I am Mike Bywater I am Head Of Software Development at Entanet @MikeBywater 2
  • 4. “agility Dictionary result for agility /əˈdʒɪlɪti/ noun 1. ability to move quickly and easily. 2. "though he was without formal training as dancer or athlete, his physical agility was inexhaustible" 4 Removing technical obstacles that inhibit agility
  • 5. Reacting to significant changes in state 1. EVENT DRIVEN ARCHITECTURE 5
  • 6. 6 ORDERING INVOICING SHIPPING WAREHOUSE LOGGING ● REST applications are an event → command pattern. ● Coupled in multiple ways ● Endpoint is known (i.e., the service address). ● Method being called is also known (i.e., an API call to doStuff) ● Calls tend to return a value; they are synchronous. UI Request orders.create Response Order created
  • 7. ORDERING INVOICING WAREHOUSE SHIPPING LOGGING 7 ● REST applications are an event → command pattern. ● Coupled in multiple ways ● Endpoint is known (i.e., the service address). ● Method being called is also known (i.e., an API call to doStuff) ● Calls tend to return a value; they are synchronous. UI orders.create shipping.status
  • 8. 8 ● We are tightly coupled ● If any service fails the whole system does ● Any code deployment potentially affects the entire system ● Even if we split teams into domains (DDD) we still have to understand other systems to request data ● All systems need to know about each other (endpoints, data schema)
  • 10. ORDERING INVOICING WAREHOUSE SHIPPING LOGGING 10 ● Some asynchronous behaviour ● Upstream services don’t need to understand about downstream services ● Limited data transfered UI shipping.status MESSAGE QUEUE order created orders.create order.details order created order created order created order created { “event” : “order-created”, “order” : 123456 }
  • 11. 11 ● Services still depend on each other for data requests ● Resilience still a potential issue ● Knowledge of upstream service still required ● Upstream services no longer need to understand anything about downstream processors ● Downstream services can fail without bringing down upstream services
  • 13. 13 ● Communication asynchronous ● Applications fully decoupled ● No restriction on schema, no shared datastore ● Microservices independent, increased resiliency ● Microservices state still important, persistent ORDERING INVOICING WAREHOUSE SHIPPING LOGGING MESSAGE QUEUE Order Placed Order Placed Invoice Generated Order Placed Item Found Item Found Item Shipped Order Placed Item Shipped All Events Invoice Generated
  • 14. 14 { “order”: 123456, “user” : “Mike Bywater”, “product” : “Muscle Vest”, “price” : “40.00”, “address” : “Telford TF3 2NS” }
  • 15. 15
  • 16. 16
  • 17. 4. Event Sourcing Event stream as the source of truth
  • 18. 18
  • 19. 19
  • 20. 20
  • 21. 21 ● Complete Rebuild: We can discard the application state completely and rebuild it by re-running the events from the event log on an empty application. ● Temporal Query: We can determine the application state at any point in time. Notionally we do this by starting with a blank state and rerunning the events up to a particular time or event. We can take this further by considering multiple timelines (analogous to branching in a version control system). ● Event Replay: If we find a past event was incorrect, we can compute the consequences by reversing it and later events and then replaying the new event and later events. (Or indeed by throwing away the application state and replaying all events with the correct event in sequence.) The same technique can handle events received in the wrong sequence - a common problem with systems that communicate with asynchronous messaging.
  • 22. 22 ● Application state is no longer required to be persistent ● We may still persist in a database if the time taken to churn through events is too slow ● We can create new services / data models an use the event stream to put them in a state as if they had always existed ● Be wary of using if events cause interactions with 3rd party systems or systems not designed with event sourcing in mind ● Examples - Account Balances, Logging, Metrics
  • 24. 24 UI FACTS GENERATOR SMS SERVICE LOGGING KAFKA User Subscribed User Subscribed User Fact Generated Text Sent All Events Send Texts User Subscribed User Fact Generated
  • 25. 25 ▹ Decoupling: Services don’t know anything about upstream or downstream services ▹ Encapsulation: There are clean boundaries between services ▹ Evolutionary change: The system and events can change over time ▹ Event sourcing: When using a log and log-aware processors, we gain the ability to easily rebuild (and replay) application state ▹ Form small autonomous teams ▹ Safe experimentation ▹ New services can be tested using real events, state can be compared ▹ Refactoring of legacy code into microservices is made easier ▹ Easier to decouple code into small microservices ▹ Deployments can be more frequent, affect less code and have a lower chance of breaking systems
  • 26. THANKS! Any questions? You can find me at: @mikebywater [email protected] 26
  • 27. FURTHER READING ▹ What do you mean by “Event-Driven”? - Martin Fowler ▹ Using Apache Kafka as a Scalable, Event-Driven Backbone for Service Architectures - Ben Stopford ▹ Journey To Event Driven - Neil Avery 27