Workflow Engines & Event Streaming Brokers - Can they work together? [Current 2023]

September 2023
Workflow Engines &
Event Streaming Brokers
Can they work together?
Natan Silnitsky, Backend Infra TL @Wix
natansil.com twitter@NSilnitsky linkedin/natansilnitsky github.com/natansil
Workflow Engines & Event Streaming Brokers @NSilnitsky
Would you
implement a
complex business
flow with Kafka and
Event Driven
Architecture?
A B
C
D
E
Workflow Engines & Event Streaming Brokers @NSilnitsky
Hi, I’m Natan →
→
→
Backend Infra Tech Lead @Wix
Yoga enthusiast
Speaker
Blogger
→
Workflow Engines & Event Streaming Brokers @NSilnitsky
Workflow Engines & Event Streaming Brokers @NSilnitsky
~1B
Unique visitors
use Wix platform
every month
~3.5B
Daily HTTP
Transactions
~70B
Kafka messages
a day
>600
GAs every day
3000
Microservices
in production
Workflow Engines & Event Streaming Brokers @NSilnitsky
@Wix Is great for
● Event Streaming @Scale
● Asynchronous Messaging Pub/Sub
● Decoupling & Extensibility
● Optimize Queries - Materialized views
Workflow Engines & Event Streaming Brokers @NSilnitsky
Gaps @Wix
● Complex business flows - Comprehension & Changes
● Long running tasks - Internal job processing
Workflow Engines & Event Streaming Brokers @NSilnitsky
Gaps @Wix
Workflow Engines & Event Streaming Brokers @NSilnitsky
Battle of the Microservices Coordination Strategies
Workflow Engines & Event Streaming Brokers @NSilnitsky
● Simplifies complex orchestration
● Fault-tolerant & resilient
● Boosts developer productivity
Workflow Engines & Event Streaming Brokers @NSilnitsky
What’s now Complex business flow
Temporal Overview
Long running tasks
Integrating Workflow Engines into Wix
→
→
→
→
Workflow Engines & Event Streaming Brokers @NSilnitsky
Complex business flow
Inventory
Service
Payments
Service
Order
Service
Create Order
Reserve Inventory
process payment
Cart
Service
Workflow Engines & Event Streaming Brokers @NSilnitsky
Complex business flow
Inventory
Service
Payments
Service
Order
Service
Create Order
Reserve Inventory
process payment
Cart
Service
Workflow Engines & Event Streaming Brokers @NSilnitsky
Complex business flow
Inventory
Service
Payments
Service
Order
Service
Create Order
Reserve Inventory
process payment
Cancel reservation
Cart
Service
Workflow Engines & Event Streaming Brokers @NSilnitsky
Complex business flow
Payments
Service
Order
Service
Create Order
Reserve Inventory
process payment
Cancel order
Cancel reservation
Inventory
Service
Cart
Service
Workflow Engines & Event Streaming Brokers @NSilnitsky
Complex business flow
Workflow Engines & Event Streaming Brokers @NSilnitsky
How would you do it with Kafka events
Inventory
Service
Payments
Service
Order
Service
Checkout Started
Order Created
Inventory reserved
Cart
Service
Workflow Engines & Event Streaming Brokers @NSilnitsky
Inventory
Service
Payments
Service
Order
Service
Checkout Started
Order Created
Inventory reserved
Cart
Service
Reservation
canceled
Payment failed
Order canceled
How would you do it with Kafka events
Workflow Engines & Event Streaming Brokers @NSilnitsky
Order
Service
Cart
Service
function checkout():
summarize cart
// publish CheckoutStarted event
listen to checkoutStarted event:
create order
publish orderCreated event
listen to inventoryCancelled event:
cancel order
publish orderCancelled event
How would you do it with Kafka / EDA
Workflow Engines & Event Streaming Brokers @NSilnitsky
listen to orderCreated event:
reserve inventory
if reservation successful:
publish inventoryReserved event
else:
publish inventoryCancelled event
listen to paymentCancelled event:
release reserved inventory
listen to inventoryReserved event:
process payment
if payment successful:
publish paymentProcessed event
else:
publish paymentFailed event
Inventory
Service
Payments
Service
How would you do it with Kafka events
* only once, changing order
Workflow Engines & Event Streaming Brokers @NSilnitsky
https://cdn.confluent.io/wp-content/uploads/stream-lineage-data-flow-stock-events.png
Workflow Engines & Event Streaming Brokers @NSilnitsky
Complex business flow
Workflow Engines & Event Streaming Brokers @NSilnitsky
How would you do it with Workflow engine?
Inventory
Service
Payments
Service
Order
Service
Cart
Service
function checkout():
cart = summarizeCart()
order = createOrder(cart)
result = reserveInventory(order)
if result != "Success":
cancelOrder(order) # Rollback order
creation
return "Inventory reservation failed"
result = processPayment(order)
if result != "Success":
releaseInventory(order)
cancelOrder(order)
return "Payment processing failed"
completeOrder(order)
return "Order placed successfully"
Workflow Engines & Event Streaming Brokers @NSilnitsky
How would you do it with Workflow engine?
Workflow Engines & Event Streaming Brokers @NSilnitsky
Complex business flow
Seeing the Big Picture
beats*
Production Monitoring
and Debugging
Changing the sequence of
the business flow
Workflow Engines & Event Streaming Brokers @NSilnitsky
What’s now Complex business flow
Temporal Overview
Long running tasks
Integrating Workflow Engines into Wix
→
→
→
→
Workflow Engines & Event Streaming Brokers @NSilnitsky
Temporal Workflow
Order
Service
Cart
Service
Summarize Cart
Activity
Checkout
Workflow
Order creation
Activity
Logical definition
Workflow Engines & Event Streaming Brokers @NSilnitsky
public interface CartActivity {
@ActivityMethod
CartSummary summarizeCart(Cart cart);
}
public interface CheckoutWorkflow {
@WorkflowMethod
void processCheckout(Cart cart);
}
public interface OrderActivity {
@ActivityMethod
Order createOrder(CartSummary cartSummary);
}
Workflow Engines & Event Streaming Brokers @NSilnitsky
public class CheckoutWorkflowImpl implements CheckoutWorkflow {
CartActivity cartActivity = Workflow.newActivityStub(CartActivity.class);
@Override
public void processCheckout(Cart cart) {
// Summarize the cart
CartSummary summary = cartActivity.summarizeCart(cart);
// rest of the checkout process here...
}
}
Workflow Engines & Event Streaming Brokers @NSilnitsky
Temporal Workflow
Temporal
Server
Cart
Service
Summarize Cart
Activity
Worker
Checkout
Workflow
Worker
Workers
Order creation
Activity
Worker
Order
Service
Workflow Engines & Event Streaming Brokers @NSilnitsky
Temporal Workflow
Temporal Server
Cart
Service
Summarize Cart
Activity
Worker
Checkout
Workflow
Worker
Task Queues
Order creation
Activity
Worker
Order
Service
Workflow Engines & Event Streaming Brokers @NSilnitsky
public class CartServiceCompositionLayer {
public static void init(String[] args) {
// Create a new worker factory
WorkerFactory factory = WorkerFactory.newInstance(... WorkflowClient ...);
// Create a new worker that listens on the specified task queue
Worker worker = factory.newWorker("MY_TASK_QUEUE");
// Register your workflow and activity implementations
worker.registerWorkflowImplementationTypes(CheckoutWorkflowImpl.class);
worker.registerActivitiesImplementations(new CartActivityImpl());
// Start listening for tasks
factory.start();
}
}
Workflow Engines & Event Streaming Brokers @NSilnitsky
Temporal Server
Temporal Workflow
Cart
Service
Summarize Cart
Activity
Worker
Checkout
Workflow
Worker
Retries
Order creation
Activity
Worker
Order
Service
* Wix infra
Workflow Engines & Event Streaming Brokers @NSilnitsky
public class CheckoutWorkflowImpl implements CheckoutWorkflow {
public CheckoutWorkflowImpl() {
ActivityOptions options = ActivityOptions.newBuilder()
.setStartToCloseTimeout(Duration.ofSeconds(10))
.setRetryOptions(
RetryOptions.newBuilder()
.setInitialInterval(Duration.ofSeconds(1))
.setMaximumInterval(Duration.ofSeconds(100))
.setBackoffCoefficient(2)
.setMaximumAttempts(3)
.build()
)
.build();
CartActivity cartActivity = Workflow.newActivityStub(
CartActivity.class, options);
}
}
Workflow Engines & Event Streaming Brokers @NSilnitsky
Temporal Supports
Temporal
Server
Cart
Service
Summarize Cart
Activity
Worker
Checkout
Workflow
Worker
Major languages
Order creation
Activity
Worker
Order
Service
Service written with Python
Service written with JS&TS
* Wix infra
Workflow Engines & Event Streaming Brokers @NSilnitsky
Temporal Workflow Debugging
Workflow Engines & Event Streaming Brokers @NSilnitsky
Temporal Workflow Debugging
Workflow Engines & Event Streaming Brokers @NSilnitsky
Temporal
disadvantages
● workflow code has to be deterministic
● Activity Input and Output must be
serializable
● No support for Very low Latency
Workflow Engines & Event Streaming Brokers @NSilnitsky
public class CheckoutWorkflowImpl implements CheckoutWorkflow {
public String processCheckout() {
Cart cart = cartActivity.summarizeCart();
Order order = orderActivity.createOrder(cart);
String result = inventoryActivity.reserveInventory(order);
if (!"Success".equals(result)) {
orderActivity.cancelOrder(order);
return "Inventory reservation failed";
}
result = paymentActivity.processPayment(order);
if (!"Success".equals(result)) {
inventoryActivity.releaseInventory(order);
orderActivity.cancelOrder(order);
return "Payment processing failed";
}
orderActivity.completeOrder(order);
return "Order placed successfully";
}
}
Non-deterministic code has to be
inside activity.
Parameters must be serializable!
Workflow Engines & Event Streaming Brokers @NSilnitsky
Temporal Server
Temporal Workflow
Cart
Service
Summarize Cart
Activity
Worker
Checkout
Workflow
Worker
Serializable
Order creation
Activity
Worker
Order
Service
Order must be serializable
Cart must be serializable
Workflow Engines & Event Streaming Brokers @NSilnitsky
What’s now Complex business flow
Temporal Overview
Long running tasks
Integrating Workflow Engines into Wix
→
→
→
→
Workflow Engines & Event Streaming Brokers @NSilnitsky
Long Running tasks
Workflow Engines & Event Streaming Brokers @NSilnitsky
Kafka Broker
renew-sub-topic
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
Kafka Consumer
Greyhound Consumer
Payment Service
Long Running tasks
Workflow Engines & Event Streaming Brokers @NSilnitsky
Kafka Broker
renew-sub-topic
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
Kafka Consumer
Greyhound Consumer
Partition
Revoked
Message Poll
Timeout!
Payment Service
Long Running tasks
Kafka Consumer
Greyhound Consumer
Workflow Engines & Event Streaming Brokers @NSilnitsky
Temporal Server
Cart
Service
Summarize Cart
Activity
Worker
Checkout
Workflow
Worker
Product Info
Activity
Worker
Order
Service
Long Running tasks
Workflow Engines & Event Streaming Brokers @NSilnitsky
public class PaymentActivityImpl implements PaymentActivity {
public processPayment(order) {
...
ExecutionContext executionContext = Activity.getExecutionContext;
executionContext.heartbeat("waiting for bank.");
...
}
}
Workflow Engines & Event Streaming Brokers @NSilnitsky
What’s now Complex business flow
Temporal Overview
Long running tasks
Integrating Workflow Engines into Wix
→
→
→
→
Workflow Engines & Event Streaming Brokers @NSilnitsky
Wix has built an Open Platform
Wix Orders service
Wix Inventory service
3rd party
Checkout app
3rd party
Analytics app
3rd party Tax
Calculator
SPI
API
Produce order created
Workflow Engines & Event Streaming Brokers @NSilnitsky
Can Temporal do Pub/Sub messaging?
Checkout Started
json
Cart
Service
Temporal Signal
Checkout workflow1
Checkout workflow2
Checkout workflow3
Order
Service
* Not design high throu, for same
exec, or for distributing work
Workflow Engines & Event Streaming Brokers @NSilnitsky
public interface CheckoutWorkflow {
@SignalMethod
void checkoutStarted(Cart cart);
}
CheckoutWorkflow workflow1 = client.newWorkflowStub(...);
…
workflow1.checkoutStarted(...);
Workflow Engines & Event Streaming Brokers @NSilnitsky
public class CheckoutWorkflowImpl implements CheckoutWorkflow {
public String processCheckout() {
Cart cart = cartActivity.summarizeCart();
Order order = orderActivity.createOrder(cart);
String result = inventoryActivity.reserveInventory(order);
if (!"Success".equals(result)) {
orderActivity.cancelOrder(order);
return "Inventory reservation failed";
}
result = paymentActivity.processPayment(order);
if (!"Success".equals(result)) {
inventoryActivity.releaseInventory(order);
orderActivity.cancelOrder(order);
return "Payment processing failed";
}
orderActivity.completeOrder(order);
return "Order placed successfully";
}
}
Coupled orchestration
Workflow Engines & Event Streaming Brokers @NSilnitsky
Where is Wix thinking
of utilizing Temporal
Workflow Engines & Event Streaming Brokers @NSilnitsky
Where Wix is thinking of utilizing Temporal
long running processes
Cron jobs
Internal microservice jobs
Dual use
Workflow Engines & Event Streaming Brokers @NSilnitsky
Fitting Temporal in Wix- cron jobs
Cron Job
Workflow Engines & Event Streaming Brokers @NSilnitsky
client.newWorkflowStub(
...,
WorkflowOptions.newBuilder()
.setCronSchedule("* * * * *")
.build());
);
Workflow Engines & Event Streaming Brokers @NSilnitsky
Where Wix is thinking of utilizing Temporal
long running processes
Cron jobs
Internal microservice jobs
Dual use
Workflow Engines & Event Streaming Brokers @NSilnitsky
Cart Service Order Service
3rd party
HTTP WebHook
Fitting Temporal in Wix
Option 1 - intra service jobs
gRPC
HTTP
Workflow Engines & Event Streaming Brokers @NSilnitsky
Option 2 - dual use
Cart Service Order Service
3rd party
HTTP WebHook
Fitting Temporal in Wix
gRPC
HTTP
Workflow Engines & Event Streaming Brokers @NSilnitsky
Low
Latency
Long
Running
Tasks
vs
Customized
Decoupled
Logic
Standalone
Business
Processes
Summary - Microservices Coordination
Workflow Engines & Event Streaming Brokers @NSilnitsky
Summary - Wix plans
Wix has a rich and diverse distributed
system and open platform mindset
Kafka and Wix Infra allow us to have
flexibility, extensibility and resiliency
built into the system
Wix is considering to inject Temporal
in strategic places in order to increase
dev velocity
* things to consider. Some companies. Can together?
Workflow Engines & Event Streaming Brokers @NSilnitsky
github.com/wix/greyhound
Workflow Engines & Event Streaming Brokers @NSilnitsky
Lessons Learned From Working with 2000
Event-Driven Microservices
The Next Step
https://www.youtube.com/watch?v=
H4OSmOYTCkM
Scan the code
Thank You!
September 2023
natansil.com twitter@NSilnitsky linkedin/natansilnitsky github.com/natansil
👉 slideshare.net/NatanSilnitsky
1 of 63

Recommended

How we eased out security journey with OAuth (Goodbye Kerberos!) | Paul Makka... by
How we eased out security journey with OAuth (Goodbye Kerberos!) | Paul Makka...How we eased out security journey with OAuth (Goodbye Kerberos!) | Paul Makka...
How we eased out security journey with OAuth (Goodbye Kerberos!) | Paul Makka...HostedbyConfluent
733 views33 slides
Docker Kubernetes Istio by
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes IstioAraf Karsh Hamid
3K views240 slides
Event Driven Systems with Spring Boot, Spring Cloud Streams and Kafka by
Event Driven Systems with Spring Boot, Spring Cloud Streams and KafkaEvent Driven Systems with Spring Boot, Spring Cloud Streams and Kafka
Event Driven Systems with Spring Boot, Spring Cloud Streams and KafkaVMware Tanzu
1.3K views37 slides
Kafka Streams: What it is, and how to use it? by
Kafka Streams: What it is, and how to use it?Kafka Streams: What it is, and how to use it?
Kafka Streams: What it is, and how to use it?confluent
1.9K views34 slides
Spring Boot+Kafka: the New Enterprise Platform by
Spring Boot+Kafka: the New Enterprise PlatformSpring Boot+Kafka: the New Enterprise Platform
Spring Boot+Kafka: the New Enterprise PlatformVMware Tanzu
1.4K views28 slides
Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat... by
Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...
Show Me Kafka Tools That Will Increase My Productivity! (Stephane Maarek, Dat...confluent
12K views31 slides

More Related Content

What's hot

Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo... by
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...Lucas Jellema
490 views82 slides
Securing Kafka by
Securing Kafka Securing Kafka
Securing Kafka confluent
14.6K views35 slides
Streaming Visualization by
Streaming VisualizationStreaming Visualization
Streaming VisualizationGuido Schmutz
1.7K views43 slides
Introduction to Apache Kafka by
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache KafkaJeff Holoman
52.2K views70 slides
Microservices Architecture & Testing Strategies by
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesAraf Karsh Hamid
2.8K views79 slides
Managing multiple event types in a single topic with Schema Registry | Bill B... by
Managing multiple event types in a single topic with Schema Registry | Bill B...Managing multiple event types in a single topic with Schema Registry | Bill B...
Managing multiple event types in a single topic with Schema Registry | Bill B...HostedbyConfluent
2.7K views41 slides

What's hot(20)

Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo... by Lucas Jellema
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Lucas Jellema490 views
Securing Kafka by confluent
Securing Kafka Securing Kafka
Securing Kafka
confluent14.6K views
Streaming Visualization by Guido Schmutz
Streaming VisualizationStreaming Visualization
Streaming Visualization
Guido Schmutz1.7K views
Introduction to Apache Kafka by Jeff Holoman
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
Jeff Holoman52.2K views
Microservices Architecture & Testing Strategies by Araf Karsh Hamid
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
Araf Karsh Hamid2.8K views
Managing multiple event types in a single topic with Schema Registry | Bill B... by HostedbyConfluent
Managing multiple event types in a single topic with Schema Registry | Bill B...Managing multiple event types in a single topic with Schema Registry | Bill B...
Managing multiple event types in a single topic with Schema Registry | Bill B...
HostedbyConfluent2.7K views
Intelligent Auto-scaling of Kafka Consumers with Workload Prediction | Ming S... by HostedbyConfluent
Intelligent Auto-scaling of Kafka Consumers with Workload Prediction | Ming S...Intelligent Auto-scaling of Kafka Consumers with Workload Prediction | Ming S...
Intelligent Auto-scaling of Kafka Consumers with Workload Prediction | Ming S...
HostedbyConfluent4.6K views
Streaming all over the world Real life use cases with Kafka Streams by confluent
Streaming all over the world  Real life use cases with Kafka StreamsStreaming all over the world  Real life use cases with Kafka Streams
Streaming all over the world Real life use cases with Kafka Streams
confluent565 views
Real time analytics at uber @ strata data 2019 by Zhenxiao Luo
Real time analytics at uber @ strata data 2019Real time analytics at uber @ strata data 2019
Real time analytics at uber @ strata data 2019
Zhenxiao Luo2.9K views
Kafka At Scale in the Cloud by confluent
Kafka At Scale in the CloudKafka At Scale in the Cloud
Kafka At Scale in the Cloud
confluent11.2K views
Etl is Dead; Long Live Streams by confluent
Etl is Dead; Long Live StreamsEtl is Dead; Long Live Streams
Etl is Dead; Long Live Streams
confluent4.2K views
Introduction to Presto at Treasure Data by Taro L. Saito
Introduction to Presto at Treasure DataIntroduction to Presto at Treasure Data
Introduction to Presto at Treasure Data
Taro L. Saito1.7K views
Apache Kafka Architecture & Fundamentals Explained by confluent
Apache Kafka Architecture & Fundamentals ExplainedApache Kafka Architecture & Fundamentals Explained
Apache Kafka Architecture & Fundamentals Explained
confluent27.6K views
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu... by HostedbyConfluent
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
HostedbyConfluent884 views
Agile, User Stories, Domain Driven Design by Araf Karsh Hamid
Agile, User Stories, Domain Driven DesignAgile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven Design
Araf Karsh Hamid1.2K views
A visual introduction to Apache Kafka by Paul Brebner
A visual introduction to Apache KafkaA visual introduction to Apache Kafka
A visual introduction to Apache Kafka
Paul Brebner4.7K views
ksqlDB - Stream Processing simplified! by Guido Schmutz
ksqlDB - Stream Processing simplified!ksqlDB - Stream Processing simplified!
ksqlDB - Stream Processing simplified!
Guido Schmutz1.1K views
Automate Your Kafka Cluster with Kubernetes Custom Resources by confluent
Automate Your Kafka Cluster with Kubernetes Custom Resources Automate Your Kafka Cluster with Kubernetes Custom Resources
Automate Your Kafka Cluster with Kubernetes Custom Resources
confluent3.1K views

Similar to Workflow Engines & Event Streaming Brokers - Can they work together? [Current 2023]

Event Driven Streaming Analytics - Demostration on Architecture of IoT by
Event Driven Streaming Analytics - Demostration on Architecture of IoTEvent Driven Streaming Analytics - Demostration on Architecture of IoT
Event Driven Streaming Analytics - Demostration on Architecture of IoTLei Xu
1.7K views32 slides
Real-time analytics as a service at King by
Real-time analytics as a service at King Real-time analytics as a service at King
Real-time analytics as a service at King Gyula Fóra
465 views20 slides
Working with data using Azure Functions.pdf by
Working with data using Azure Functions.pdfWorking with data using Azure Functions.pdf
Working with data using Azure Functions.pdfStephanie Locke
80 views31 slides
Experiences in Architecting & Implementing Platforms using Serverless.pdf by
Experiences in Architecting & Implementing Platforms using Serverless.pdfExperiences in Architecting & Implementing Platforms using Serverless.pdf
Experiences in Architecting & Implementing Platforms using Serverless.pdfSrushith Repakula
30 views42 slides
Building microservices with Scala, functional domain models and Spring Boot (... by
Building microservices with Scala, functional domain models and Spring Boot (...Building microservices with Scala, functional domain models and Spring Boot (...
Building microservices with Scala, functional domain models and Spring Boot (...Chris Richardson
3.7K views77 slides
Serverless Design Patterns by
Serverless Design PatternsServerless Design Patterns
Serverless Design PatternsYan Cui
759 views170 slides

Similar to Workflow Engines & Event Streaming Brokers - Can they work together? [Current 2023](20)

Event Driven Streaming Analytics - Demostration on Architecture of IoT by Lei Xu
Event Driven Streaming Analytics - Demostration on Architecture of IoTEvent Driven Streaming Analytics - Demostration on Architecture of IoT
Event Driven Streaming Analytics - Demostration on Architecture of IoT
Lei Xu1.7K views
Real-time analytics as a service at King by Gyula Fóra
Real-time analytics as a service at King Real-time analytics as a service at King
Real-time analytics as a service at King
Gyula Fóra465 views
Working with data using Azure Functions.pdf by Stephanie Locke
Working with data using Azure Functions.pdfWorking with data using Azure Functions.pdf
Working with data using Azure Functions.pdf
Stephanie Locke80 views
Experiences in Architecting & Implementing Platforms using Serverless.pdf by Srushith Repakula
Experiences in Architecting & Implementing Platforms using Serverless.pdfExperiences in Architecting & Implementing Platforms using Serverless.pdf
Experiences in Architecting & Implementing Platforms using Serverless.pdf
Building microservices with Scala, functional domain models and Spring Boot (... by Chris Richardson
Building microservices with Scala, functional domain models and Spring Boot (...Building microservices with Scala, functional domain models and Spring Boot (...
Building microservices with Scala, functional domain models and Spring Boot (...
Chris Richardson3.7K views
Serverless Design Patterns by Yan Cui
Serverless Design PatternsServerless Design Patterns
Serverless Design Patterns
Yan Cui759 views
Serveless design patterns by Yan Cui
Serveless design patternsServeless design patterns
Serveless design patterns
Yan Cui390 views
Long running processes in DDD by Bernd Ruecker
Long running processes in DDDLong running processes in DDD
Long running processes in DDD
Bernd Ruecker8K views
Building Event Driven (Micro)services with Apache Kafka by Guido Schmutz
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache Kafka
Guido Schmutz1.5K views
Goto meetup Stockholm - Let your microservices flow by Bernd Ruecker
Goto meetup Stockholm - Let your microservices flowGoto meetup Stockholm - Let your microservices flow
Goto meetup Stockholm - Let your microservices flow
Bernd Ruecker708 views
Kafka as an Event Store (Guido Schmutz, Trivadis) Kafka Summit NYC 2019 by confluent
Kafka as an Event Store (Guido Schmutz, Trivadis) Kafka Summit NYC 2019Kafka as an Event Store (Guido Schmutz, Trivadis) Kafka Summit NYC 2019
Kafka as an Event Store (Guido Schmutz, Trivadis) Kafka Summit NYC 2019
confluent2K views
Building event-driven Microservices with Kafka Ecosystem by Guido Schmutz
Building event-driven Microservices with Kafka EcosystemBuilding event-driven Microservices with Kafka Ecosystem
Building event-driven Microservices with Kafka Ecosystem
Guido Schmutz2.2K views
Developing event-driven microservices with event sourcing and CQRS (phillyete) by Chris Richardson
Developing event-driven microservices with event sourcing and CQRS (phillyete)Developing event-driven microservices with event sourcing and CQRS (phillyete)
Developing event-driven microservices with event sourcing and CQRS (phillyete)
Chris Richardson9K views
Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architecture by Ben Wilcock
Devoxx 2018 -  Pivotal and AxonIQ - Quickstart your event driven architectureDevoxx 2018 -  Pivotal and AxonIQ - Quickstart your event driven architecture
Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architecture
Ben Wilcock347 views
apidays LIVE JAKARTA - Event Driven APIs by Phil Scanlon by apidays
apidays LIVE JAKARTA - Event Driven APIs by Phil Scanlonapidays LIVE JAKARTA - Event Driven APIs by Phil Scanlon
apidays LIVE JAKARTA - Event Driven APIs by Phil Scanlon
apidays1.5K views
Public v1 real world example of azure functions serverless conf london 2016 by Yochay Kiriaty
Public v1 real world example of azure functions serverless conf london 2016 Public v1 real world example of azure functions serverless conf london 2016
Public v1 real world example of azure functions serverless conf london 2016
Yochay Kiriaty1.2K views
Couchbase@live person meetup july 22nd by Ido Shilon
Couchbase@live person meetup   july 22ndCouchbase@live person meetup   july 22nd
Couchbase@live person meetup july 22nd
Ido Shilon1.2K views
Code first in the cloud: going serverless with Azure by Jeremy Likness
Code first in the cloud: going serverless with AzureCode first in the cloud: going serverless with Azure
Code first in the cloud: going serverless with Azure
Jeremy Likness1.6K views
Building event-driven (Micro)Services with Apache Kafka Ecosystem by Guido Schmutz
Building event-driven (Micro)Services with Apache Kafka EcosystemBuilding event-driven (Micro)Services with Apache Kafka Ecosystem
Building event-driven (Micro)Services with Apache Kafka Ecosystem
Guido Schmutz369 views

More from Natan Silnitsky

DevSum - Lessons Learned from 2000 microservices by
DevSum - Lessons Learned from 2000 microservicesDevSum - Lessons Learned from 2000 microservices
DevSum - Lessons Learned from 2000 microservicesNatan Silnitsky
5 views60 slides
GeeCon - Lessons Learned from 2000 microservices by
GeeCon - Lessons Learned from 2000 microservicesGeeCon - Lessons Learned from 2000 microservices
GeeCon - Lessons Learned from 2000 microservicesNatan Silnitsky
91 views60 slides
Wix+Confluent Meetup - Lessons Learned from 2000 Event Driven Microservices by
Wix+Confluent Meetup - Lessons Learned from 2000 Event Driven MicroservicesWix+Confluent Meetup - Lessons Learned from 2000 Event Driven Microservices
Wix+Confluent Meetup - Lessons Learned from 2000 Event Driven MicroservicesNatan Silnitsky
19 views60 slides
Create Atomic habits to become a better developer by
Create Atomic habits to become a better developerCreate Atomic habits to become a better developer
Create Atomic habits to become a better developerNatan Silnitsky
248 views45 slides
BuildStuff - Lessons Learned from 2000 Event Driven Microservices by
BuildStuff - Lessons Learned from 2000 Event Driven MicroservicesBuildStuff - Lessons Learned from 2000 Event Driven Microservices
BuildStuff - Lessons Learned from 2000 Event Driven MicroservicesNatan Silnitsky
143 views61 slides
Lessons Learned from 2000 Event Driven Microservices - Reversim by
Lessons Learned from 2000 Event Driven Microservices - ReversimLessons Learned from 2000 Event Driven Microservices - Reversim
Lessons Learned from 2000 Event Driven Microservices - ReversimNatan Silnitsky
316 views59 slides

More from Natan Silnitsky(20)

DevSum - Lessons Learned from 2000 microservices by Natan Silnitsky
DevSum - Lessons Learned from 2000 microservicesDevSum - Lessons Learned from 2000 microservices
DevSum - Lessons Learned from 2000 microservices
Natan Silnitsky5 views
GeeCon - Lessons Learned from 2000 microservices by Natan Silnitsky
GeeCon - Lessons Learned from 2000 microservicesGeeCon - Lessons Learned from 2000 microservices
GeeCon - Lessons Learned from 2000 microservices
Natan Silnitsky91 views
Wix+Confluent Meetup - Lessons Learned from 2000 Event Driven Microservices by Natan Silnitsky
Wix+Confluent Meetup - Lessons Learned from 2000 Event Driven MicroservicesWix+Confluent Meetup - Lessons Learned from 2000 Event Driven Microservices
Wix+Confluent Meetup - Lessons Learned from 2000 Event Driven Microservices
Natan Silnitsky19 views
Create Atomic habits to become a better developer by Natan Silnitsky
Create Atomic habits to become a better developerCreate Atomic habits to become a better developer
Create Atomic habits to become a better developer
Natan Silnitsky248 views
BuildStuff - Lessons Learned from 2000 Event Driven Microservices by Natan Silnitsky
BuildStuff - Lessons Learned from 2000 Event Driven MicroservicesBuildStuff - Lessons Learned from 2000 Event Driven Microservices
BuildStuff - Lessons Learned from 2000 Event Driven Microservices
Natan Silnitsky143 views
Lessons Learned from 2000 Event Driven Microservices - Reversim by Natan Silnitsky
Lessons Learned from 2000 Event Driven Microservices - ReversimLessons Learned from 2000 Event Driven Microservices - Reversim
Lessons Learned from 2000 Event Driven Microservices - Reversim
Natan Silnitsky316 views
Devoxx Ukraine - Kafka based Global Data Mesh by Natan Silnitsky
Devoxx Ukraine - Kafka based Global Data MeshDevoxx Ukraine - Kafka based Global Data Mesh
Devoxx Ukraine - Kafka based Global Data Mesh
Natan Silnitsky79 views
Dev Days Europe - Kafka based Global Data Mesh at Wix by Natan Silnitsky
Dev Days Europe - Kafka based Global Data Mesh at WixDev Days Europe - Kafka based Global Data Mesh at Wix
Dev Days Europe - Kafka based Global Data Mesh at Wix
Natan Silnitsky52 views
Kafka Summit London - Kafka based Global Data Mesh at Wix by Natan Silnitsky
Kafka Summit London - Kafka based Global Data Mesh at WixKafka Summit London - Kafka based Global Data Mesh at Wix
Kafka Summit London - Kafka based Global Data Mesh at Wix
Natan Silnitsky487 views
Migrating to Multi Cluster Managed Kafka - Conf42 - CloudNative by Natan Silnitsky
Migrating to Multi Cluster Managed Kafka - Conf42 - CloudNative Migrating to Multi Cluster Managed Kafka - Conf42 - CloudNative
Migrating to Multi Cluster Managed Kafka - Conf42 - CloudNative
Natan Silnitsky99 views
5 Takeaways from Migrating a Library to Scala 3 - Scala Love by Natan Silnitsky
5 Takeaways from Migrating a Library to Scala 3 - Scala Love5 Takeaways from Migrating a Library to Scala 3 - Scala Love
5 Takeaways from Migrating a Library to Scala 3 - Scala Love
Natan Silnitsky424 views
Open sourcing a successful internal project - Reversim 2021 by Natan Silnitsky
Open sourcing a successful internal project - Reversim 2021Open sourcing a successful internal project - Reversim 2021
Open sourcing a successful internal project - Reversim 2021
Natan Silnitsky513 views
How to successfully manage a ZIO fiber’s lifecycle - Functional Scala 2021 by Natan Silnitsky
How to successfully manage a ZIO fiber’s lifecycle - Functional Scala 2021How to successfully manage a ZIO fiber’s lifecycle - Functional Scala 2021
How to successfully manage a ZIO fiber’s lifecycle - Functional Scala 2021
Natan Silnitsky267 views
Advanced Caching Patterns used by 2000 microservices - Code Motion by Natan Silnitsky
Advanced Caching Patterns used by 2000 microservices - Code MotionAdvanced Caching Patterns used by 2000 microservices - Code Motion
Advanced Caching Patterns used by 2000 microservices - Code Motion
Natan Silnitsky87 views
Advanced Caching Patterns used by 2000 microservices - Devoxx Ukraine by Natan Silnitsky
Advanced Caching Patterns used by 2000 microservices - Devoxx UkraineAdvanced Caching Patterns used by 2000 microservices - Devoxx Ukraine
Advanced Caching Patterns used by 2000 microservices - Devoxx Ukraine
Natan Silnitsky150 views
Advanced Microservices Caching Patterns - Devoxx UK by Natan Silnitsky
Advanced Microservices Caching Patterns - Devoxx UKAdvanced Microservices Caching Patterns - Devoxx UK
Advanced Microservices Caching Patterns - Devoxx UK
Natan Silnitsky121 views
Battle-tested event-driven patterns for your microservices architecture - Sca... by Natan Silnitsky
Battle-tested event-driven patterns for your microservices architecture - Sca...Battle-tested event-driven patterns for your microservices architecture - Sca...
Battle-tested event-driven patterns for your microservices architecture - Sca...
Natan Silnitsky137 views
Advanced Caching Patterns used by 2000 microservices - Api World by Natan Silnitsky
Advanced Caching Patterns used by 2000 microservices - Api WorldAdvanced Caching Patterns used by 2000 microservices - Api World
Advanced Caching Patterns used by 2000 microservices - Api World
Natan Silnitsky106 views
Kafka based Global Data Mesh at Wix by Natan Silnitsky
Kafka based Global Data Mesh at WixKafka based Global Data Mesh at Wix
Kafka based Global Data Mesh at Wix
Natan Silnitsky362 views
Jax london - Battle-tested event-driven patterns for your microservices archi... by Natan Silnitsky
Jax london - Battle-tested event-driven patterns for your microservices archi...Jax london - Battle-tested event-driven patterns for your microservices archi...
Jax london - Battle-tested event-driven patterns for your microservices archi...
Natan Silnitsky178 views

Recently uploaded

DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon by
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - AfternoonDSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - AfternoonDeltares
13 views43 slides
Citi TechTalk Session 2: Kafka Deep Dive by
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Diveconfluent
17 views60 slides
Tridens DevOps by
Tridens DevOpsTridens DevOps
Tridens DevOpsTridens
9 views28 slides
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -... by
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...Deltares
6 views15 slides
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit... by
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...Deltares
13 views34 slides
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the... by
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...Deltares
6 views22 slides

Recently uploaded(20)

DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon by Deltares
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - AfternoonDSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon
Deltares13 views
Citi TechTalk Session 2: Kafka Deep Dive by confluent
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
confluent17 views
Tridens DevOps by Tridens
Tridens DevOpsTridens DevOps
Tridens DevOps
Tridens9 views
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -... by Deltares
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
Deltares6 views
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit... by Deltares
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...
Deltares13 views
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the... by Deltares
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...
Deltares6 views
Copilot Prompting Toolkit_All Resources.pdf by Riccardo Zamana
Copilot Prompting Toolkit_All Resources.pdfCopilot Prompting Toolkit_All Resources.pdf
Copilot Prompting Toolkit_All Resources.pdf
Riccardo Zamana6 views
MariaDB stored procedures and why they should be improved by Federico Razzoli
MariaDB stored procedures and why they should be improvedMariaDB stored procedures and why they should be improved
MariaDB stored procedures and why they should be improved
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx by animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm13 views
Software evolution understanding: Automatic extraction of software identifier... by Ra'Fat Al-Msie'deen
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...
Headless JS UG Presentation.pptx by Jack Spektor
Headless JS UG Presentation.pptxHeadless JS UG Presentation.pptx
Headless JS UG Presentation.pptx
Jack Spektor7 views
Consulting for Data Monetization Maximizing the Profit Potential of Your Data... by Flexsin
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Flexsin 15 views
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema by Deltares
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - GeertsemaDSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema
Deltares17 views
SUGCON ANZ Presentation V2.1 Final.pptx by Jack Spektor
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptx
Jack Spektor22 views
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)... by Deltares
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
Deltares9 views
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut... by Deltares
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...
Deltares6 views
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t... by Deltares
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
Deltares9 views

Workflow Engines & Event Streaming Brokers - Can they work together? [Current 2023]

  • 1. September 2023 Workflow Engines & Event Streaming Brokers Can they work together? Natan Silnitsky, Backend Infra TL @Wix natansil.com twitter@NSilnitsky linkedin/natansilnitsky github.com/natansil
  • 2. Workflow Engines & Event Streaming Brokers @NSilnitsky Would you implement a complex business flow with Kafka and Event Driven Architecture? A B C D E
  • 3. Workflow Engines & Event Streaming Brokers @NSilnitsky Hi, I’m Natan → → → Backend Infra Tech Lead @Wix Yoga enthusiast Speaker Blogger →
  • 4. Workflow Engines & Event Streaming Brokers @NSilnitsky
  • 5. Workflow Engines & Event Streaming Brokers @NSilnitsky ~1B Unique visitors use Wix platform every month ~3.5B Daily HTTP Transactions ~70B Kafka messages a day >600 GAs every day 3000 Microservices in production
  • 6. Workflow Engines & Event Streaming Brokers @NSilnitsky @Wix Is great for ● Event Streaming @Scale ● Asynchronous Messaging Pub/Sub ● Decoupling & Extensibility ● Optimize Queries - Materialized views
  • 7. Workflow Engines & Event Streaming Brokers @NSilnitsky Gaps @Wix ● Complex business flows - Comprehension & Changes ● Long running tasks - Internal job processing
  • 8. Workflow Engines & Event Streaming Brokers @NSilnitsky Gaps @Wix
  • 9. Workflow Engines & Event Streaming Brokers @NSilnitsky Battle of the Microservices Coordination Strategies
  • 10. Workflow Engines & Event Streaming Brokers @NSilnitsky ● Simplifies complex orchestration ● Fault-tolerant & resilient ● Boosts developer productivity
  • 11. Workflow Engines & Event Streaming Brokers @NSilnitsky What’s now Complex business flow Temporal Overview Long running tasks Integrating Workflow Engines into Wix → → → →
  • 12. Workflow Engines & Event Streaming Brokers @NSilnitsky Complex business flow Inventory Service Payments Service Order Service Create Order Reserve Inventory process payment Cart Service
  • 13. Workflow Engines & Event Streaming Brokers @NSilnitsky Complex business flow Inventory Service Payments Service Order Service Create Order Reserve Inventory process payment Cart Service
  • 14. Workflow Engines & Event Streaming Brokers @NSilnitsky Complex business flow Inventory Service Payments Service Order Service Create Order Reserve Inventory process payment Cancel reservation Cart Service
  • 15. Workflow Engines & Event Streaming Brokers @NSilnitsky Complex business flow Payments Service Order Service Create Order Reserve Inventory process payment Cancel order Cancel reservation Inventory Service Cart Service
  • 16. Workflow Engines & Event Streaming Brokers @NSilnitsky Complex business flow
  • 17. Workflow Engines & Event Streaming Brokers @NSilnitsky How would you do it with Kafka events Inventory Service Payments Service Order Service Checkout Started Order Created Inventory reserved Cart Service
  • 18. Workflow Engines & Event Streaming Brokers @NSilnitsky Inventory Service Payments Service Order Service Checkout Started Order Created Inventory reserved Cart Service Reservation canceled Payment failed Order canceled How would you do it with Kafka events
  • 19. Workflow Engines & Event Streaming Brokers @NSilnitsky Order Service Cart Service function checkout(): summarize cart // publish CheckoutStarted event listen to checkoutStarted event: create order publish orderCreated event listen to inventoryCancelled event: cancel order publish orderCancelled event How would you do it with Kafka / EDA
  • 20. Workflow Engines & Event Streaming Brokers @NSilnitsky listen to orderCreated event: reserve inventory if reservation successful: publish inventoryReserved event else: publish inventoryCancelled event listen to paymentCancelled event: release reserved inventory listen to inventoryReserved event: process payment if payment successful: publish paymentProcessed event else: publish paymentFailed event Inventory Service Payments Service How would you do it with Kafka events * only once, changing order
  • 21. Workflow Engines & Event Streaming Brokers @NSilnitsky https://cdn.confluent.io/wp-content/uploads/stream-lineage-data-flow-stock-events.png
  • 22. Workflow Engines & Event Streaming Brokers @NSilnitsky Complex business flow
  • 23. Workflow Engines & Event Streaming Brokers @NSilnitsky How would you do it with Workflow engine? Inventory Service Payments Service Order Service Cart Service function checkout(): cart = summarizeCart() order = createOrder(cart) result = reserveInventory(order) if result != "Success": cancelOrder(order) # Rollback order creation return "Inventory reservation failed" result = processPayment(order) if result != "Success": releaseInventory(order) cancelOrder(order) return "Payment processing failed" completeOrder(order) return "Order placed successfully"
  • 24. Workflow Engines & Event Streaming Brokers @NSilnitsky How would you do it with Workflow engine?
  • 25. Workflow Engines & Event Streaming Brokers @NSilnitsky Complex business flow Seeing the Big Picture beats* Production Monitoring and Debugging Changing the sequence of the business flow
  • 26. Workflow Engines & Event Streaming Brokers @NSilnitsky What’s now Complex business flow Temporal Overview Long running tasks Integrating Workflow Engines into Wix → → → →
  • 27. Workflow Engines & Event Streaming Brokers @NSilnitsky Temporal Workflow Order Service Cart Service Summarize Cart Activity Checkout Workflow Order creation Activity Logical definition
  • 28. Workflow Engines & Event Streaming Brokers @NSilnitsky public interface CartActivity { @ActivityMethod CartSummary summarizeCart(Cart cart); } public interface CheckoutWorkflow { @WorkflowMethod void processCheckout(Cart cart); } public interface OrderActivity { @ActivityMethod Order createOrder(CartSummary cartSummary); }
  • 29. Workflow Engines & Event Streaming Brokers @NSilnitsky public class CheckoutWorkflowImpl implements CheckoutWorkflow { CartActivity cartActivity = Workflow.newActivityStub(CartActivity.class); @Override public void processCheckout(Cart cart) { // Summarize the cart CartSummary summary = cartActivity.summarizeCart(cart); // rest of the checkout process here... } }
  • 30. Workflow Engines & Event Streaming Brokers @NSilnitsky Temporal Workflow Temporal Server Cart Service Summarize Cart Activity Worker Checkout Workflow Worker Workers Order creation Activity Worker Order Service
  • 31. Workflow Engines & Event Streaming Brokers @NSilnitsky Temporal Workflow Temporal Server Cart Service Summarize Cart Activity Worker Checkout Workflow Worker Task Queues Order creation Activity Worker Order Service
  • 32. Workflow Engines & Event Streaming Brokers @NSilnitsky public class CartServiceCompositionLayer { public static void init(String[] args) { // Create a new worker factory WorkerFactory factory = WorkerFactory.newInstance(... WorkflowClient ...); // Create a new worker that listens on the specified task queue Worker worker = factory.newWorker("MY_TASK_QUEUE"); // Register your workflow and activity implementations worker.registerWorkflowImplementationTypes(CheckoutWorkflowImpl.class); worker.registerActivitiesImplementations(new CartActivityImpl()); // Start listening for tasks factory.start(); } }
  • 33. Workflow Engines & Event Streaming Brokers @NSilnitsky Temporal Server Temporal Workflow Cart Service Summarize Cart Activity Worker Checkout Workflow Worker Retries Order creation Activity Worker Order Service * Wix infra
  • 34. Workflow Engines & Event Streaming Brokers @NSilnitsky public class CheckoutWorkflowImpl implements CheckoutWorkflow { public CheckoutWorkflowImpl() { ActivityOptions options = ActivityOptions.newBuilder() .setStartToCloseTimeout(Duration.ofSeconds(10)) .setRetryOptions( RetryOptions.newBuilder() .setInitialInterval(Duration.ofSeconds(1)) .setMaximumInterval(Duration.ofSeconds(100)) .setBackoffCoefficient(2) .setMaximumAttempts(3) .build() ) .build(); CartActivity cartActivity = Workflow.newActivityStub( CartActivity.class, options); } }
  • 35. Workflow Engines & Event Streaming Brokers @NSilnitsky Temporal Supports Temporal Server Cart Service Summarize Cart Activity Worker Checkout Workflow Worker Major languages Order creation Activity Worker Order Service Service written with Python Service written with JS&TS * Wix infra
  • 36. Workflow Engines & Event Streaming Brokers @NSilnitsky Temporal Workflow Debugging
  • 37. Workflow Engines & Event Streaming Brokers @NSilnitsky Temporal Workflow Debugging
  • 38. Workflow Engines & Event Streaming Brokers @NSilnitsky Temporal disadvantages ● workflow code has to be deterministic ● Activity Input and Output must be serializable ● No support for Very low Latency
  • 39. Workflow Engines & Event Streaming Brokers @NSilnitsky public class CheckoutWorkflowImpl implements CheckoutWorkflow { public String processCheckout() { Cart cart = cartActivity.summarizeCart(); Order order = orderActivity.createOrder(cart); String result = inventoryActivity.reserveInventory(order); if (!"Success".equals(result)) { orderActivity.cancelOrder(order); return "Inventory reservation failed"; } result = paymentActivity.processPayment(order); if (!"Success".equals(result)) { inventoryActivity.releaseInventory(order); orderActivity.cancelOrder(order); return "Payment processing failed"; } orderActivity.completeOrder(order); return "Order placed successfully"; } } Non-deterministic code has to be inside activity. Parameters must be serializable!
  • 40. Workflow Engines & Event Streaming Brokers @NSilnitsky Temporal Server Temporal Workflow Cart Service Summarize Cart Activity Worker Checkout Workflow Worker Serializable Order creation Activity Worker Order Service Order must be serializable Cart must be serializable
  • 41. Workflow Engines & Event Streaming Brokers @NSilnitsky What’s now Complex business flow Temporal Overview Long running tasks Integrating Workflow Engines into Wix → → → →
  • 42. Workflow Engines & Event Streaming Brokers @NSilnitsky Long Running tasks
  • 43. Workflow Engines & Event Streaming Brokers @NSilnitsky Kafka Broker renew-sub-topic 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 Kafka Consumer Greyhound Consumer Payment Service Long Running tasks
  • 44. Workflow Engines & Event Streaming Brokers @NSilnitsky Kafka Broker renew-sub-topic 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 Kafka Consumer Greyhound Consumer Partition Revoked Message Poll Timeout! Payment Service Long Running tasks Kafka Consumer Greyhound Consumer
  • 45. Workflow Engines & Event Streaming Brokers @NSilnitsky Temporal Server Cart Service Summarize Cart Activity Worker Checkout Workflow Worker Product Info Activity Worker Order Service Long Running tasks
  • 46. Workflow Engines & Event Streaming Brokers @NSilnitsky public class PaymentActivityImpl implements PaymentActivity { public processPayment(order) { ... ExecutionContext executionContext = Activity.getExecutionContext; executionContext.heartbeat("waiting for bank."); ... } }
  • 47. Workflow Engines & Event Streaming Brokers @NSilnitsky What’s now Complex business flow Temporal Overview Long running tasks Integrating Workflow Engines into Wix → → → →
  • 48. Workflow Engines & Event Streaming Brokers @NSilnitsky Wix has built an Open Platform Wix Orders service Wix Inventory service 3rd party Checkout app 3rd party Analytics app 3rd party Tax Calculator SPI API Produce order created
  • 49. Workflow Engines & Event Streaming Brokers @NSilnitsky Can Temporal do Pub/Sub messaging? Checkout Started json Cart Service Temporal Signal Checkout workflow1 Checkout workflow2 Checkout workflow3 Order Service * Not design high throu, for same exec, or for distributing work
  • 50. Workflow Engines & Event Streaming Brokers @NSilnitsky public interface CheckoutWorkflow { @SignalMethod void checkoutStarted(Cart cart); } CheckoutWorkflow workflow1 = client.newWorkflowStub(...); … workflow1.checkoutStarted(...);
  • 51. Workflow Engines & Event Streaming Brokers @NSilnitsky public class CheckoutWorkflowImpl implements CheckoutWorkflow { public String processCheckout() { Cart cart = cartActivity.summarizeCart(); Order order = orderActivity.createOrder(cart); String result = inventoryActivity.reserveInventory(order); if (!"Success".equals(result)) { orderActivity.cancelOrder(order); return "Inventory reservation failed"; } result = paymentActivity.processPayment(order); if (!"Success".equals(result)) { inventoryActivity.releaseInventory(order); orderActivity.cancelOrder(order); return "Payment processing failed"; } orderActivity.completeOrder(order); return "Order placed successfully"; } } Coupled orchestration
  • 52. Workflow Engines & Event Streaming Brokers @NSilnitsky Where is Wix thinking of utilizing Temporal
  • 53. Workflow Engines & Event Streaming Brokers @NSilnitsky Where Wix is thinking of utilizing Temporal long running processes Cron jobs Internal microservice jobs Dual use
  • 54. Workflow Engines & Event Streaming Brokers @NSilnitsky Fitting Temporal in Wix- cron jobs Cron Job
  • 55. Workflow Engines & Event Streaming Brokers @NSilnitsky client.newWorkflowStub( ..., WorkflowOptions.newBuilder() .setCronSchedule("* * * * *") .build()); );
  • 56. Workflow Engines & Event Streaming Brokers @NSilnitsky Where Wix is thinking of utilizing Temporal long running processes Cron jobs Internal microservice jobs Dual use
  • 57. Workflow Engines & Event Streaming Brokers @NSilnitsky Cart Service Order Service 3rd party HTTP WebHook Fitting Temporal in Wix Option 1 - intra service jobs gRPC HTTP
  • 58. Workflow Engines & Event Streaming Brokers @NSilnitsky Option 2 - dual use Cart Service Order Service 3rd party HTTP WebHook Fitting Temporal in Wix gRPC HTTP
  • 59. Workflow Engines & Event Streaming Brokers @NSilnitsky Low Latency Long Running Tasks vs Customized Decoupled Logic Standalone Business Processes Summary - Microservices Coordination
  • 60. Workflow Engines & Event Streaming Brokers @NSilnitsky Summary - Wix plans Wix has a rich and diverse distributed system and open platform mindset Kafka and Wix Infra allow us to have flexibility, extensibility and resiliency built into the system Wix is considering to inject Temporal in strategic places in order to increase dev velocity * things to consider. Some companies. Can together?
  • 61. Workflow Engines & Event Streaming Brokers @NSilnitsky github.com/wix/greyhound
  • 62. Workflow Engines & Event Streaming Brokers @NSilnitsky Lessons Learned From Working with 2000 Event-Driven Microservices The Next Step https://www.youtube.com/watch?v= H4OSmOYTCkM Scan the code
  • 63. Thank You! September 2023 natansil.com twitter@NSilnitsky linkedin/natansilnitsky github.com/natansil 👉 slideshare.net/NatanSilnitsky