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

Recomendados

Azure App Service Deep Dive por
Azure App Service Deep DiveAzure App Service Deep Dive
Azure App Service Deep DiveAzure Riyadh User Group
1.8K vistas54 diapositivas
Introduction to Amazon Relational Database Service (Amazon RDS) por
Introduction to Amazon Relational Database Service (Amazon RDS)Introduction to Amazon Relational Database Service (Amazon RDS)
Introduction to Amazon Relational Database Service (Amazon RDS)Amazon Web Services
944 vistas30 diapositivas
Azure Web Apps - Introduction por
Azure Web Apps - IntroductionAzure Web Apps - Introduction
Azure Web Apps - IntroductionChristopher Gomez
1.1K vistas17 diapositivas
Deep Dive - Infrastructure as Code por
Deep Dive - Infrastructure as CodeDeep Dive - Infrastructure as Code
Deep Dive - Infrastructure as CodeAmazon Web Services
3.9K vistas47 diapositivas
Terraform -- Infrastructure as Code por
Terraform -- Infrastructure as CodeTerraform -- Infrastructure as Code
Terraform -- Infrastructure as CodeMartin Schütte
8.1K vistas42 diapositivas
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018 por
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018Amazon Web Services
1.9K vistas58 diapositivas

Más contenido relacionado

La actualidad más candente

Azure Cost Management por
Azure Cost ManagementAzure Cost Management
Azure Cost ManagementStefano Tempesta
669 vistas11 diapositivas
Why Kubernetes on Azure por
Why Kubernetes on AzureWhy Kubernetes on Azure
Why Kubernetes on AzureMicrosoft Tech Community
2.1K vistas52 diapositivas
Databases on AWS Workshop.pdf por
Databases on AWS Workshop.pdfDatabases on AWS Workshop.pdf
Databases on AWS Workshop.pdfAmazon Web Services
3.7K vistas109 diapositivas
Can Apache Kafka Replace a Database? por
Can Apache Kafka Replace a Database?Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?Kai Wähner
998 vistas44 diapositivas
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft... por
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Amazon Web Services
10.4K vistas22 diapositivas
Introduction to Amazon Aurora por
Introduction to Amazon AuroraIntroduction to Amazon Aurora
Introduction to Amazon AuroraAmazon Web Services
5.1K vistas38 diapositivas

La actualidad más candente(20)

Can Apache Kafka Replace a Database? por Kai Wähner
Can Apache Kafka Replace a Database?Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?
Kai Wähner998 vistas
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft... por Amazon Web Services
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Amazon Web Services10.4K vistas
Amazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | Edureka por Edureka!
Amazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | EdurekaAmazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | Edureka
Amazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | Edureka
Edureka!1.2K vistas
Microsoft azure overview por Ali Mkahal
Microsoft azure overviewMicrosoft azure overview
Microsoft azure overview
Ali Mkahal773 vistas
Webinar: Simplifying the Enterprise Hybrid Cloud with Azure Stack HCI por Storage Switzerland
Webinar: Simplifying the Enterprise Hybrid Cloud with Azure Stack HCIWebinar: Simplifying the Enterprise Hybrid Cloud with Azure Stack HCI
Webinar: Simplifying the Enterprise Hybrid Cloud with Azure Stack HCI
Storage Switzerland821 vistas
Azure DNS Privé por AZUG FR
Azure DNS PrivéAzure DNS Privé
Azure DNS Privé
AZUG FR459 vistas
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To... por Edureka!
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
Edureka!3.6K vistas
TechnicalTerraformLandingZones121120229238.pdf por MIlton788007
TechnicalTerraformLandingZones121120229238.pdfTechnicalTerraformLandingZones121120229238.pdf
TechnicalTerraformLandingZones121120229238.pdf
MIlton788007244 vistas
Jenkins를 활용한 Openshift CI/CD 구성 por rockplace
Jenkins를 활용한 Openshift CI/CD 구성 Jenkins를 활용한 Openshift CI/CD 구성
Jenkins를 활용한 Openshift CI/CD 구성
rockplace757 vistas
Q&A with Confluent Professional Services: Confluent Service Mesh por confluent
Q&A with Confluent Professional Services: Confluent Service MeshQ&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service Mesh
confluent67 vistas
Introduction to Microsoft Azure por Guy Barrette
Introduction to Microsoft AzureIntroduction to Microsoft Azure
Introduction to Microsoft Azure
Guy Barrette1.6K vistas
Azure Availability Options por Emre Martin
Azure Availability OptionsAzure Availability Options
Azure Availability Options
Emre Martin680 vistas
Azure Stack Fundamentals por Cenk Ersoy
Azure Stack FundamentalsAzure Stack Fundamentals
Azure Stack Fundamentals
Cenk Ersoy2.6K vistas

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

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

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

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

Más de Natan Silnitsky

DevSum - Lessons Learned from 2000 microservices por
DevSum - Lessons Learned from 2000 microservicesDevSum - Lessons Learned from 2000 microservices
DevSum - Lessons Learned from 2000 microservicesNatan Silnitsky
5 vistas60 diapositivas
GeeCon - Lessons Learned from 2000 microservices por
GeeCon - Lessons Learned from 2000 microservicesGeeCon - Lessons Learned from 2000 microservices
GeeCon - Lessons Learned from 2000 microservicesNatan Silnitsky
91 vistas60 diapositivas
Wix+Confluent Meetup - Lessons Learned from 2000 Event Driven Microservices por
Wix+Confluent Meetup - Lessons Learned from 2000 Event Driven MicroservicesWix+Confluent Meetup - Lessons Learned from 2000 Event Driven Microservices
Wix+Confluent Meetup - Lessons Learned from 2000 Event Driven MicroservicesNatan Silnitsky
19 vistas60 diapositivas
Create Atomic habits to become a better developer por
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 vistas45 diapositivas
BuildStuff - Lessons Learned from 2000 Event Driven Microservices por
BuildStuff - Lessons Learned from 2000 Event Driven MicroservicesBuildStuff - Lessons Learned from 2000 Event Driven Microservices
BuildStuff - Lessons Learned from 2000 Event Driven MicroservicesNatan Silnitsky
143 vistas61 diapositivas
Lessons Learned from 2000 Event Driven Microservices - Reversim por
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 vistas59 diapositivas

Más de Natan Silnitsky(20)

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

Último

AI and Ml presentation .pptx por
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptxFayazAli87
11 vistas15 diapositivas
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -... por
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...Deltares
6 vistas15 diapositivas
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... por
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Marc Müller
37 vistas83 diapositivas
Keep por
KeepKeep
KeepGeniusee
75 vistas10 diapositivas
A first look at MariaDB 11.x features and ideas on how to use them por
A first look at MariaDB 11.x features and ideas on how to use themA first look at MariaDB 11.x features and ideas on how to use them
A first look at MariaDB 11.x features and ideas on how to use themFederico Razzoli
45 vistas36 diapositivas
Advanced API Mocking Techniques por
Advanced API Mocking TechniquesAdvanced API Mocking Techniques
Advanced API Mocking TechniquesDimpy Adhikary
19 vistas11 diapositivas

Último(20)

AI and Ml presentation .pptx por FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8711 vistas
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -... por Deltares
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
Deltares6 vistas
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... por Marc Müller
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Marc Müller37 vistas
A first look at MariaDB 11.x features and ideas on how to use them por Federico Razzoli
A first look at MariaDB 11.x features and ideas on how to use themA first look at MariaDB 11.x features and ideas on how to use them
A first look at MariaDB 11.x features and ideas on how to use them
Federico Razzoli45 vistas
Advanced API Mocking Techniques por Dimpy Adhikary
Advanced API Mocking TechniquesAdvanced API Mocking Techniques
Advanced API Mocking Techniques
Dimpy Adhikary19 vistas
Airline Booking Software por SharmiMehta
Airline Booking SoftwareAirline Booking Software
Airline Booking Software
SharmiMehta5 vistas
Software testing company in India.pptx por SakshiPatel82
Software testing company in India.pptxSoftware testing company in India.pptx
Software testing company in India.pptx
SakshiPatel827 vistas
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... por Donato Onofri
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Donato Onofri773 vistas
The Era of Large Language Models.pptx por AbdulVahedShaik
The Era of Large Language Models.pptxThe Era of Large Language Models.pptx
The Era of Large Language Models.pptx
AbdulVahedShaik5 vistas
DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h... por Deltares
DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h...DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h...
DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h...
Deltares5 vistas
SUGCON ANZ Presentation V2.1 Final.pptx por Jack Spektor
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptx
Jack Spektor22 vistas
DSD-INT 2023 Salt intrusion Modelling of the Lauwersmeer, towards a measureme... por Deltares
DSD-INT 2023 Salt intrusion Modelling of the Lauwersmeer, towards a measureme...DSD-INT 2023 Salt intrusion Modelling of the Lauwersmeer, towards a measureme...
DSD-INT 2023 Salt intrusion Modelling of the Lauwersmeer, towards a measureme...
Deltares5 vistas
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema por Deltares
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - GeertsemaDSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema
DSD-INT 2023 Delft3D FM Suite 2024.01 1D2D - Beta testing programme - Geertsema
Deltares17 vistas
DSD-INT 2023 The Danube Hazardous Substances Model - Kovacs por Deltares
DSD-INT 2023 The Danube Hazardous Substances Model - KovacsDSD-INT 2023 The Danube Hazardous Substances Model - Kovacs
DSD-INT 2023 The Danube Hazardous Substances Model - Kovacs
Deltares8 vistas
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action por Márton Kodok
Gen Apps on Google Cloud PaLM2 and Codey APIs in ActionGen Apps on Google Cloud PaLM2 and Codey APIs in Action
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action
Márton Kodok5 vistas
FIMA 2023 Neo4j & FS - Entity Resolution.pptx por Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j6 vistas
Software evolution understanding: Automatic extraction of software identifier... por Ra'Fat Al-Msie'deen
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...

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