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 sur 63

Recommandé

How we eased out security journey with OAuth (Goodbye Kerberos!) | Paul Makka... par
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
742 vues33 diapositives
Financial Event Sourcing at Enterprise Scale par
Financial Event Sourcing at Enterprise ScaleFinancial Event Sourcing at Enterprise Scale
Financial Event Sourcing at Enterprise Scaleconfluent
2.4K vues20 diapositives
Getting Started with AWS Lambda Serverless Computing par
Getting Started with AWS Lambda Serverless ComputingGetting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingAmazon Web Services
901 vues54 diapositives
Using Apache Kafka to Analyze Session Windows par
Using Apache Kafka to Analyze Session WindowsUsing Apache Kafka to Analyze Session Windows
Using Apache Kafka to Analyze Session Windowsconfluent
717 vues35 diapositives
Building Event Driven (Micro)services with Apache Kafka par
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaGuido Schmutz
2.2K vues48 diapositives
High Availability Websites: part one par
High Availability Websites: part oneHigh Availability Websites: part one
High Availability Websites: part oneAmazon Web Services
15.8K vues63 diapositives

Contenu connexe

Tendances

KSQL Deep Dive - The Open Source Streaming Engine for Apache Kafka par
KSQL Deep Dive - The Open Source Streaming Engine for Apache KafkaKSQL Deep Dive - The Open Source Streaming Engine for Apache Kafka
KSQL Deep Dive - The Open Source Streaming Engine for Apache KafkaKai Wähner
4.9K vues79 diapositives
Changelog Stream Processing with Apache Flink par
Changelog Stream Processing with Apache FlinkChangelog Stream Processing with Apache Flink
Changelog Stream Processing with Apache FlinkFlink Forward
399 vues27 diapositives
Stream processing with Apache Flink (Timo Walther - Ververica) par
Stream processing with Apache Flink (Timo Walther - Ververica)Stream processing with Apache Flink (Timo Walther - Ververica)
Stream processing with Apache Flink (Timo Walther - Ververica)KafkaZone
606 vues48 diapositives
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka... par
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...HostedbyConfluent
3.2K vues18 diapositives
Disaster Recovery for Multi-Region Apache Kafka Ecosystems at Uber par
Disaster Recovery for Multi-Region Apache Kafka Ecosystems at UberDisaster Recovery for Multi-Region Apache Kafka Ecosystems at Uber
Disaster Recovery for Multi-Region Apache Kafka Ecosystems at Uberconfluent
1.5K vues22 diapositives
SingleStore & Kafka: Better Together to Power Modern Real-Time Data Architect... par
SingleStore & Kafka: Better Together to Power Modern Real-Time Data Architect...SingleStore & Kafka: Better Together to Power Modern Real-Time Data Architect...
SingleStore & Kafka: Better Together to Power Modern Real-Time Data Architect...HostedbyConfluent
667 vues18 diapositives

Tendances(20)

KSQL Deep Dive - The Open Source Streaming Engine for Apache Kafka par Kai Wähner
KSQL Deep Dive - The Open Source Streaming Engine for Apache KafkaKSQL Deep Dive - The Open Source Streaming Engine for Apache Kafka
KSQL Deep Dive - The Open Source Streaming Engine for Apache Kafka
Kai Wähner4.9K vues
Changelog Stream Processing with Apache Flink par Flink Forward
Changelog Stream Processing with Apache FlinkChangelog Stream Processing with Apache Flink
Changelog Stream Processing with Apache Flink
Flink Forward399 vues
Stream processing with Apache Flink (Timo Walther - Ververica) par KafkaZone
Stream processing with Apache Flink (Timo Walther - Ververica)Stream processing with Apache Flink (Timo Walther - Ververica)
Stream processing with Apache Flink (Timo Walther - Ververica)
KafkaZone606 vues
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka... par HostedbyConfluent
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
HostedbyConfluent3.2K vues
Disaster Recovery for Multi-Region Apache Kafka Ecosystems at Uber par confluent
Disaster Recovery for Multi-Region Apache Kafka Ecosystems at UberDisaster Recovery for Multi-Region Apache Kafka Ecosystems at Uber
Disaster Recovery for Multi-Region Apache Kafka Ecosystems at Uber
confluent1.5K vues
SingleStore & Kafka: Better Together to Power Modern Real-Time Data Architect... par HostedbyConfluent
SingleStore & Kafka: Better Together to Power Modern Real-Time Data Architect...SingleStore & Kafka: Better Together to Power Modern Real-Time Data Architect...
SingleStore & Kafka: Better Together to Power Modern Real-Time Data Architect...
Everything You Always Wanted to Know About Kafka’s Rebalance Protocol but Wer... par confluent
Everything You Always Wanted to Know About Kafka’s Rebalance Protocol but Wer...Everything You Always Wanted to Know About Kafka’s Rebalance Protocol but Wer...
Everything You Always Wanted to Know About Kafka’s Rebalance Protocol but Wer...
confluent8.6K vues
Secrets of Performance Tuning Java on Kubernetes par Bruno Borges
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes
Bruno Borges3K vues
When NOT to use Apache Kafka? par Kai Wähner
When NOT to use Apache Kafka?When NOT to use Apache Kafka?
When NOT to use Apache Kafka?
Kai Wähner1.5K vues
Introducing Saga Pattern in Microservices with Spring Statemachine par VMware Tanzu
Introducing Saga Pattern in Microservices with Spring StatemachineIntroducing Saga Pattern in Microservices with Spring Statemachine
Introducing Saga Pattern in Microservices with Spring Statemachine
VMware Tanzu3.9K vues
user Behavior Analysis with Session Windows and Apache Kafka's Streams API par confluent
user Behavior Analysis with Session Windows and Apache Kafka's Streams APIuser Behavior Analysis with Session Windows and Apache Kafka's Streams API
user Behavior Analysis with Session Windows and Apache Kafka's Streams API
confluent4.6K vues
Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap... par Flink Forward
Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...
Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...
Flink Forward3.2K vues
Apache Kafka® Use Cases for Financial Services par confluent
Apache Kafka® Use Cases for Financial ServicesApache Kafka® Use Cases for Financial Services
Apache Kafka® Use Cases for Financial Services
confluent4.1K vues
Data In Motion Paris 2023 par confluent
Data In Motion Paris 2023Data In Motion Paris 2023
Data In Motion Paris 2023
confluent236 vues
Kafka as an Event Store - is it Good Enough? par Guido Schmutz
Kafka as an Event Store - is it Good Enough?Kafka as an Event Store - is it Good Enough?
Kafka as an Event Store - is it Good Enough?
Guido Schmutz10.2K vues

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

Event Driven Streaming Analytics - Demostration on Architecture of IoT par
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 vues32 diapositives
Real-time analytics as a service at King par
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 vues20 diapositives
Working with data using Azure Functions.pdf par
Working with data using Azure Functions.pdfWorking with data using Azure Functions.pdf
Working with data using Azure Functions.pdfStephanie Locke
80 vues31 diapositives
Experiences in Architecting & Implementing Platforms using Serverless.pdf par
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 vues42 diapositives
Building microservices with Scala, functional domain models and Spring Boot (... par
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 vues77 diapositives
Serverless Design Patterns par
Serverless Design PatternsServerless Design Patterns
Serverless Design PatternsYan Cui
759 vues170 diapositives

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

Event Driven Streaming Analytics - Demostration on Architecture of IoT par 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 vues
Real-time analytics as a service at King par 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 vues
Working with data using Azure Functions.pdf par Stephanie Locke
Working with data using Azure Functions.pdfWorking with data using Azure Functions.pdf
Working with data using Azure Functions.pdf
Stephanie Locke80 vues
Experiences in Architecting & Implementing Platforms using Serverless.pdf par 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 (... par 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 vues
Serverless Design Patterns par Yan Cui
Serverless Design PatternsServerless Design Patterns
Serverless Design Patterns
Yan Cui759 vues
Serveless design patterns par Yan Cui
Serveless design patternsServeless design patterns
Serveless design patterns
Yan Cui390 vues
Building Event Driven (Micro)services with Apache Kafka par 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 vues
Goto meetup Stockholm - Let your microservices flow par Bernd Ruecker
Goto meetup Stockholm - Let your microservices flowGoto meetup Stockholm - Let your microservices flow
Goto meetup Stockholm - Let your microservices flow
Bernd Ruecker708 vues
Kafka as an Event Store (Guido Schmutz, Trivadis) Kafka Summit NYC 2019 par 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 vues
Building event-driven Microservices with Kafka Ecosystem par 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 vues
Developing event-driven microservices with event sourcing and CQRS (phillyete) par 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)
Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architecture par 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 vues
apidays LIVE JAKARTA - Event Driven APIs by Phil Scanlon par 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 vues
Public v1 real world example of azure functions serverless conf london 2016 par 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 vues
Couchbase@live person meetup july 22nd par Ido Shilon
Couchbase@live person meetup   july 22ndCouchbase@live person meetup   july 22nd
Couchbase@live person meetup july 22nd
Ido Shilon1.2K vues
Code first in the cloud: going serverless with Azure par 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 vues
Building event-driven (Micro)Services with Apache Kafka Ecosystem par 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 vues

Plus de Natan Silnitsky

DevSum - Lessons Learned from 2000 microservices par
DevSum - Lessons Learned from 2000 microservicesDevSum - Lessons Learned from 2000 microservices
DevSum - Lessons Learned from 2000 microservicesNatan Silnitsky
5 vues60 diapositives
GeeCon - Lessons Learned from 2000 microservices par
GeeCon - Lessons Learned from 2000 microservicesGeeCon - Lessons Learned from 2000 microservices
GeeCon - Lessons Learned from 2000 microservicesNatan Silnitsky
91 vues60 diapositives
Wix+Confluent Meetup - Lessons Learned from 2000 Event Driven Microservices par
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
20 vues60 diapositives
Create Atomic habits to become a better developer par
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 vues45 diapositives
BuildStuff - Lessons Learned from 2000 Event Driven Microservices par
BuildStuff - Lessons Learned from 2000 Event Driven MicroservicesBuildStuff - Lessons Learned from 2000 Event Driven Microservices
BuildStuff - Lessons Learned from 2000 Event Driven MicroservicesNatan Silnitsky
144 vues61 diapositives
Lessons Learned from 2000 Event Driven Microservices - Reversim par
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 vues59 diapositives

Plus de Natan Silnitsky(20)

DevSum - Lessons Learned from 2000 microservices par Natan Silnitsky
DevSum - Lessons Learned from 2000 microservicesDevSum - Lessons Learned from 2000 microservices
DevSum - Lessons Learned from 2000 microservices
GeeCon - Lessons Learned from 2000 microservices par Natan Silnitsky
GeeCon - Lessons Learned from 2000 microservicesGeeCon - Lessons Learned from 2000 microservices
GeeCon - Lessons Learned from 2000 microservices
Natan Silnitsky91 vues
Wix+Confluent Meetup - Lessons Learned from 2000 Event Driven Microservices par 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 Silnitsky20 vues
Create Atomic habits to become a better developer par 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 vues
BuildStuff - Lessons Learned from 2000 Event Driven Microservices par 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 Silnitsky144 vues
Lessons Learned from 2000 Event Driven Microservices - Reversim par 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 vues
Devoxx Ukraine - Kafka based Global Data Mesh par Natan Silnitsky
Devoxx Ukraine - Kafka based Global Data MeshDevoxx Ukraine - Kafka based Global Data Mesh
Devoxx Ukraine - Kafka based Global Data Mesh
Natan Silnitsky79 vues
Dev Days Europe - Kafka based Global Data Mesh at Wix par 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 vues
Kafka Summit London - Kafka based Global Data Mesh at Wix par 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 vues
Migrating to Multi Cluster Managed Kafka - Conf42 - CloudNative par 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 vues
5 Takeaways from Migrating a Library to Scala 3 - Scala Love par 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 vues
Open sourcing a successful internal project - Reversim 2021 par 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 vues
How to successfully manage a ZIO fiber’s lifecycle - Functional Scala 2021 par 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 vues
Advanced Caching Patterns used by 2000 microservices - Code Motion par 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 vues
Advanced Caching Patterns used by 2000 microservices - Devoxx Ukraine par 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 vues
Advanced Microservices Caching Patterns - Devoxx UK par Natan Silnitsky
Advanced Microservices Caching Patterns - Devoxx UKAdvanced Microservices Caching Patterns - Devoxx UK
Advanced Microservices Caching Patterns - Devoxx UK
Natan Silnitsky121 vues
Battle-tested event-driven patterns for your microservices architecture - Sca... par 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 vues
Advanced Caching Patterns used by 2000 microservices - Api World par 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 vues
Jax london - Battle-tested event-driven patterns for your microservices archi... par 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 vues

Dernier

Dapr Unleashed: Accelerating Microservice Development par
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice DevelopmentMiroslav Janeski
15 vues29 diapositives
Automated Testing of Microsoft Power BI Reports par
Automated Testing of Microsoft Power BI ReportsAutomated Testing of Microsoft Power BI Reports
Automated Testing of Microsoft Power BI ReportsRTTS
10 vues20 diapositives
Introduction to Maven par
Introduction to MavenIntroduction to Maven
Introduction to MavenJohn Valentino
6 vues10 diapositives
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... par
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...NimaTorabi2
16 vues17 diapositives
Benefits in Software Development par
Benefits in Software DevelopmentBenefits in Software Development
Benefits in Software DevelopmentJohn Valentino
5 vues15 diapositives
EV Charging App Case par
EV Charging App Case EV Charging App Case
EV Charging App Case iCoderz Solutions
9 vues1 diapositive

Dernier(20)

Dapr Unleashed: Accelerating Microservice Development par Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Automated Testing of Microsoft Power BI Reports par RTTS
Automated Testing of Microsoft Power BI ReportsAutomated Testing of Microsoft Power BI Reports
Automated Testing of Microsoft Power BI Reports
RTTS10 vues
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... par NimaTorabi2
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
NimaTorabi216 vues
JioEngage_Presentation.pptx par admin125455
JioEngage_Presentation.pptxJioEngage_Presentation.pptx
JioEngage_Presentation.pptx
admin1254558 vues
Top-5-production-devconMunich-2023.pptx par Tier1 app
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptx
Tier1 app9 vues
predicting-m3-devopsconMunich-2023-v2.pptx par Tier1 app
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptx
Tier1 app12 vues
Top-5-production-devconMunich-2023-v2.pptx par Tier1 app
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptx
Tier1 app8 vues
Transport Management System - Shipment & Container Tracking par Freightoscope
Transport Management System - Shipment & Container TrackingTransport Management System - Shipment & Container Tracking
Transport Management System - Shipment & Container Tracking

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