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

Recomendados

How we eased out security journey with OAuth (Goodbye Kerberos!) | Paul Makka... von
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 views33 Folien
Financial Event Sourcing at Enterprise Scale von
Financial Event Sourcing at Enterprise ScaleFinancial Event Sourcing at Enterprise Scale
Financial Event Sourcing at Enterprise Scaleconfluent
2.4K views20 Folien
Getting Started with AWS Lambda Serverless Computing von
Getting Started with AWS Lambda Serverless ComputingGetting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingAmazon Web Services
901 views54 Folien
Using Apache Kafka to Analyze Session Windows von
Using Apache Kafka to Analyze Session WindowsUsing Apache Kafka to Analyze Session Windows
Using Apache Kafka to Analyze Session Windowsconfluent
717 views35 Folien
Building Event Driven (Micro)services with Apache Kafka von
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 views48 Folien
High Availability Websites: part one von
High Availability Websites: part oneHigh Availability Websites: part one
High Availability Websites: part oneAmazon Web Services
15.8K views63 Folien

Más contenido relacionado

Was ist angesagt?

KSQL Deep Dive - The Open Source Streaming Engine for Apache Kafka von
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 views79 Folien
Changelog Stream Processing with Apache Flink von
Changelog Stream Processing with Apache FlinkChangelog Stream Processing with Apache Flink
Changelog Stream Processing with Apache FlinkFlink Forward
399 views27 Folien
Stream processing with Apache Flink (Timo Walther - Ververica) von
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 views48 Folien
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka... von
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 views18 Folien
Disaster Recovery for Multi-Region Apache Kafka Ecosystems at Uber von
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 views22 Folien
SingleStore & Kafka: Better Together to Power Modern Real-Time Data Architect... von
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 views18 Folien

Was ist angesagt?(20)

KSQL Deep Dive - The Open Source Streaming Engine for Apache Kafka von 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 views
Changelog Stream Processing with Apache Flink von Flink Forward
Changelog Stream Processing with Apache FlinkChangelog Stream Processing with Apache Flink
Changelog Stream Processing with Apache Flink
Flink Forward399 views
Stream processing with Apache Flink (Timo Walther - Ververica) von 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 views
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka... von 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 views
Disaster Recovery for Multi-Region Apache Kafka Ecosystems at Uber von 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 views
SingleStore & Kafka: Better Together to Power Modern Real-Time Data Architect... von 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...
HostedbyConfluent667 views
Everything You Always Wanted to Know About Kafka’s Rebalance Protocol but Wer... von 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 views
Secrets of Performance Tuning Java on Kubernetes von Bruno Borges
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes
Bruno Borges3K views
When NOT to use Apache Kafka? von 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 views
Introducing Saga Pattern in Microservices with Spring Statemachine von 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 views
user Behavior Analysis with Session Windows and Apache Kafka's Streams API von 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 views
Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap... von 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 views
Apache Kafka® Use Cases for Financial Services von confluent
Apache Kafka® Use Cases for Financial ServicesApache Kafka® Use Cases for Financial Services
Apache Kafka® Use Cases for Financial Services
confluent4.1K views
Apache Flink, AWS Kinesis, Analytics von Araf Karsh Hamid
Apache Flink, AWS Kinesis, Analytics Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics
Araf Karsh Hamid538 views
Data In Motion Paris 2023 von confluent
Data In Motion Paris 2023Data In Motion Paris 2023
Data In Motion Paris 2023
confluent236 views
Kafka as an Event Store - is it Good Enough? von 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 views

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

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

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

Event Driven Streaming Analytics - Demostration on Architecture of IoT von 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 von 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 von 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 von 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 (... von 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 von Yan Cui
Serverless Design PatternsServerless Design Patterns
Serverless Design Patterns
Yan Cui759 views
Serveless design patterns von Yan Cui
Serveless design patternsServeless design patterns
Serveless design patterns
Yan Cui390 views
Long running processes in DDD von 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 von 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 von 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 von 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 von 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) von 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 von 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 von 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 von 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 von 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 von 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 von 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

Más de Natan Silnitsky

DevSum - Lessons Learned from 2000 microservices von
DevSum - Lessons Learned from 2000 microservicesDevSum - Lessons Learned from 2000 microservices
DevSum - Lessons Learned from 2000 microservicesNatan Silnitsky
5 views60 Folien
GeeCon - Lessons Learned from 2000 microservices von
GeeCon - Lessons Learned from 2000 microservicesGeeCon - Lessons Learned from 2000 microservices
GeeCon - Lessons Learned from 2000 microservicesNatan Silnitsky
91 views60 Folien
Wix+Confluent Meetup - Lessons Learned from 2000 Event Driven Microservices von
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 views60 Folien
Create Atomic habits to become a better developer von
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 Folien
BuildStuff - Lessons Learned from 2000 Event Driven Microservices von
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 views61 Folien
Lessons Learned from 2000 Event Driven Microservices - Reversim von
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 Folien

Más de Natan Silnitsky(20)

DevSum - Lessons Learned from 2000 microservices von 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 von 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 von 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 views
Create Atomic habits to become a better developer von 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 von 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 views
Lessons Learned from 2000 Event Driven Microservices - Reversim von 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 von 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 von 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 von 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 von 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 von 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 von 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 von 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 von 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 von 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 von 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... von 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 von 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 von 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... von 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

Último

The Path to DevOps von
The Path to DevOpsThe Path to DevOps
The Path to DevOpsJohn Valentino
5 views6 Folien
DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook Automation von
DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook AutomationDRYiCE™ iAutomate: AI-enhanced Intelligent Runbook Automation
DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook AutomationHCLSoftware
6 views8 Folien
Introduction to Gradle von
Introduction to GradleIntroduction to Gradle
Introduction to GradleJohn Valentino
6 views7 Folien
predicting-m3-devopsconMunich-2023-v2.pptx von
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptxTier1 app
12 views33 Folien
Bootstrapping vs Venture Capital.pptx von
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptxZeljko Svedic
15 views17 Folien
Agile 101 von
Agile 101Agile 101
Agile 101John Valentino
12 views20 Folien

Último(20)

DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook Automation von HCLSoftware
DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook AutomationDRYiCE™ iAutomate: AI-enhanced Intelligent Runbook Automation
DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook Automation
HCLSoftware6 views
predicting-m3-devopsconMunich-2023-v2.pptx von Tier1 app
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptx
Tier1 app12 views
Bootstrapping vs Venture Capital.pptx von Zeljko Svedic
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptx
Zeljko Svedic15 views
Top-5-production-devconMunich-2023-v2.pptx von Tier1 app
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptx
Tier1 app8 views
360 graden fabriek von info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info33492165 views
tecnologia18.docx von nosi6702
tecnologia18.docxtecnologia18.docx
tecnologia18.docx
nosi67025 views
predicting-m3-devopsconMunich-2023.pptx von Tier1 app
predicting-m3-devopsconMunich-2023.pptxpredicting-m3-devopsconMunich-2023.pptx
predicting-m3-devopsconMunich-2023.pptx
Tier1 app8 views
Navigating container technology for enhanced security by Niklas Saari von Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy15 views
Generic or specific? Making sensible software design decisions von Bert Jan Schrijver
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
ADDO_2022_CICID_Tom_Halpin.pdf von TomHalpin9
ADDO_2022_CICID_Tom_Halpin.pdfADDO_2022_CICID_Tom_Halpin.pdf
ADDO_2022_CICID_Tom_Halpin.pdf
TomHalpin95 views
Dapr Unleashed: Accelerating Microservice Development von Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski15 views
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated... von TomHalpin9
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
TomHalpin96 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